...
Types | Intent APIs | Functionality |
---|---|---|
| /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/traffic-intent-set/{set-name}/us-to-us-intents/ | communication between microservices deployed between two clusters |
2. external outbound service communication | /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/traffic-intent-set/{set-name}/inbound-intent/ | communication from external service to internal micro service |
4. external inbound service communiation | /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/traffic-intent-set/{set-name}/outbound-intent/ | communication from internal service to access external service |
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/traffic-intent-set/{set-name}/us-to-us-intents/ POST BODY: { "metadata":{ "name": "servicehttpbin" //unique name for each intent "description": "connectivity intent for micro-service to micro-service communication" "userdata1": <>, "userdata2": <> } "spec":{ // update the memory allocation for each field "application": "<app1>", "servicename": "httpbin01" //actual name of the client service "protocol": "HTTP", "headless": "false", // default is false. Option "True" will make sure all the instances of the headless service will have access to the client service "mutualTLS": "MUTUAL", // Support 2 modes. SIMPLE, MUTUAL with external client. For inter and intra cluster, mtls is enabled by default "port" : "80", // port on which service is exposed as through servicemesh, not the port it is actually running on "serviceMesh": "istio", // get it from cluster record // Traffic configuration "loadbalancingType": "ConsistenHash", // "Simple" and "consistentHash" are the two modes "loadBalancerMode": "httpCookie" // Modes for consistentHash - "httpHeaderName", "httpCookie", "useSourceIP", "minimumRingSize", Modes for simple - "LEAST_CONN", "ROUND_ROBIN", "RANDOM", "PASSTHROUGH" // choices of the mode must be explicit "httpHeader": john-user // Input for the hash when in "consistentHash" LB type and mode as "httpHeader" "httpCookie": user // Input for Hash in "ConsistenHash" LB and mode as "httpCookie" . Name of the cookie to maitain stick sessions. "maxConnections": 10 //connection pool for tcp and http traffic "timeOut" : 5 // in Seconds. Connection timeout for tcp and idleTimeout for http // credentials for mTLS "Servicecertificate" : {serverCertificate.pem} // Present actual certificate here. Optional, default "", required only if mTLS is set to "MUTUAL" "ServicePrivateKey" : {serverPrivateKey.pem} // Present actual private key here. Required only if mTLS is "MUTUAL" "caCertificate": {caCertificate.pem} // file should contain the public certificates for all root CAs that is trusted to authenticate your clients // not required for cluster level communication } } RETURN STATUS: 201 RETURN BODY: { "name": "servicehttpbin" "Message": "Inbound service created" } |
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/traffic-intent-set/{set-name}/userviceus-to-userviceus-intentintents/servicehttpbin RETURN STATUS: 201 RETURN BODY: { "metadata":{ "name": "servicehttpbin" //unique name for each intent "description": "connectivity intent for micro-service to microservice communication" } spec:{ "inboundservicename": "httpbin01" //actual name of the client service "protocol": "HTTP", "headless": "false", // default is false. Option "True" will make sure all the instances of the headless service will have access to the client service "mutualTLS": "MUTUAL", // Support 2 modes. SIMPLE, MUTUAL with external client. For inter and intra cluster, mtls is enabled by default "port" : "80", // port on which service is exposed as through servicemesh, not the port it is actually running on "serviceMesh": "istio", // get it from cluster record // Traffic configuration "loadbalancingType": "ConsistenHash", // "Simple" and "consistentHash" are the two modes "loadBalancerMode": "httpCookie" // Modes for consistentHash - "httpHeaderName", "httpCookie", "useSourceIP", "minimumRingSize", Modes for simple - "LEAST_CONN", "ROUND_ROBIN", "RANDOM", "PASSTHROUGH" "httpHeader": x-user // Input for the hash when in "consistentHash" LB type and mode as "httpHeader" "httpCookie": user // Input for Hash in "ConsistenHash" LB and mode as "httpCookie" . Name of the cookie to maitain stick sessions. "maxConnections": 10 //connection pool for tcp and http traffic "timeOut" : 5 // in Seconds. Connection timeout for tcp and idleTimeout for http // credentials for mTLS "Servicecertificate" : {serverCertificate.pem} // Present actual certificate here. Optional, default "", required only if mTLS is set to "MUTUAL" "ServicePrivateKey" : {serverPrivateKey.pem} // Present actual private key here. Required only if mTLS is "MUTUAL" "caCertificate": {caCertificate.pem} // file should contain the public certificates for all root CAs that is trusted to authenticate your clients // not required for cluster level communication } } |
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
DELETE URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/traffic-group-intent/userviceintent-set/{set-name}/us-to-userviceus-intentintents/servicehttpbin RETURN STATUS: 204 |
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/traffic-group-intent/userviceintent-set/{set-name}/us-to-userviceus-intent/{intent-name}/clients POST BODY: { "clientServiceName": "sleep01", // Name of the client service. "headless": "true", // default is false. Option "True" will generate the required configs for all the instances of headless service "egressgateway": "true" , // Optional, default = false, All the outbound traffic from this service will flow through a dedicated egress gateway } RETURN STATUS: 201 RETURN BODY: { "name": "sleep01" "Message": "Client created" } |
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/traffic-groupintent-intentset/uservice-{set-name}/us-to-userviceus-intents/{intent-name}/clients/sleep01 RETURN STATUS: 201 RETURN BODY: "clientService": { "clientServiceName": "sleep01", // if any then allow all the external applications to connect, check for serviceaccount level access "headless": "true", // default is false. Option "True" will generate the required configs for all the instances of headless service "egressgateway": "true" , // Optional, default = false, All the outbound traffic from this service will flow through a dedicated egress gateway } |
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/traffic-group-intent/uservice-intent-set/{set-name}/us-to-userviceus-intents/{intent-name}/clients/sleep01 RETURN STATUS: 204 |
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/traffic-group-intent/uservice-intent-set/{set-name}/us-to-userviceus-intents/{intent-name}/clients/sleep01/security/security-intent { "userAccess": [{userName: "Todd", accessList:Action:["/health_check": GET, "/status/: GET, "/upload": POST]}, {userName: "Thor", accessList:["/health_check": GET, "/status/: GET, "/upload": POST]} ] // These are the user in k8s } RETURN STATUS: 204 |
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/traffic-group-intent/uservice-intent-set/{set-name}/us-to-userviceus-intents/{intent-name}/clients/sleep01/traffic/traffic-intent { } RETURN STATUS: 204 |
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/traffic-group-intent/inbound-intent/set/{set-name}/inbound-intent/ POST BODY: { "name": <name> //unique name for each intent "description": <description> "inboundservicename": "mysql" //actual name of the client service "description": "bookinfo app", "protocol": "HTTP", "externalName": "", // Optional, default = "", Not required for Outbound access since the communication will be initialted from inboundservice the communication will be initialted from inboundservice "localDomain": "", // Optional, default = "", Update local network (cluster scope) DNS with records for '<externalName>.<localDomain>' "publicDomain": "", // Optional, default = "", Update public network (logical cloud scope) DNS with records for '<externalName>.<publicDomain>' "headless": "false", // default is false. Option "True" will make sure all the instances of the headless service will have access to the client service "mutualTLS": "true", // Setting this to true will create a dedicated egrees gateway for the service "httpbin01" on whichever cluster it is running on "port" : "80", // port on which service is exposed as through servicemesh, not the port it is actually running on "serviceMesh": "istio", // get it from cluster record "loadbalancing": "true", // optional } RETURN STATUS: 201 RETURN BODY: { "Message": "outbound coonectivityconnectivity intent creation success " "description": "Connectivity intent for inbound service to connect to external services" } |
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/traffic-group-intentintent-set/{set-name}/inbound-intent/<intent{intent-name>name}/clients POST BODY: { "name": <name> //unique name for each intent "description": <description> "externalServiceName": {cnn.edition.com} // Only the FQDN of the service name is required "externalCaCertificate" : {clientCaCert.pem} // Present the actual client certificate } RETURN STATUS: 201 RETURN BODY: { "Message": "Success " "description": "External service given access to inbound service" } |
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/traffic-group-intentintent-set/{set-name}/inbound-intent/<intent{intent-name>name}/clients/client01/security { "name": <name> //unique name for each intent "description": <description> "externalAuthenticationissuer": "https://accounts.google.com", "externalAuthenticationjwksURI" : "https://www.googleapis.com/oauth2/v3/certs", "userAccess": [{userName: "Todd", accessList:Action:["/health_check": GET, "/status/: GET, "/upload": POST]}, {userName: "Thor", accessList:["/health_check": GET, "/status/: GET, "/upload": POST]} ] // These are the external users } RETURN STATUS: 204 |
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/traffic-group-intent-intent-set/{set-name}/outbound-intent/<intent{intent-name>name}/clients/ POST BODY: { "name": "<name>" //unique name for each intent "description": <description> "inboundservicename": "httpbin01" //actual name of the client service "protocol": "HTTP", "headless": "false", // default is false. Option "True" will make sure all the instances of the headless service will have access to the client service "mutualTLS": "MUTUAL", // Support 2 modes. SIMPLE, MUTUAL with external client. For inter and intra cluster, mtls is enabled by default "port" : "80", // port on which service is exposed as through servicemesh, not the port it is actually running on "serviceMesh": "istio", // get it from cluster record // Traffic configuration "loadbalancingType": "ConsistenHash", // "Simple" and "consistentHash" are the two modes "loadBalancerMode": "httpCookie" // Modes for consistentHash - "httpHeaderName", "httpCookie", "useSourceIP", "minimumRingSize", Modes for simple - "LEAST_CONN", "ROUND_ROBIN", "RANDOM", "PASSTHROUGH" "httpHeader": x-user // Input for the hash when in "consistentHash" LB type and mode as "httpHeader" "httpCookie": user // Input for Hash in "ConsistenHash" LB and mode as "httpCookie" . Name of the cookie to maitain stick sessions. "maxConnections": 10 //connection pool for tcp and http traffic "timeOut" : 5 // in Seconds. Connection timeout for tcp and idleTimeout for http // credentials for mTLS "Servicecertificate" : {serverCertificate.pem} // Present actual certificate here. Optional, default "", required only if mTLS is set to "MUTUAL" "ServicePrivateKey" : {serverPrivateKey.pem} // Present actual private key here. Required only if mTLS is "MUTUAL" "caCertificate": {caCertificate.pem} // file should contain the public certificates for all root CAs that is trusted to authenticate your clients // not required for cluster level communication } RETURN STATUS: 201 RETURN BODY: { "name": "servicehttpbin" "Message": "Inbound service created" } |
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/traffic-group-intentintent-set/{set-name}/inbound-intent/ POST BODY: { "externalServiceName": {cnn.edition.com} // Only the FQDN of the service name is required } RETURN STATUS: 201 RETURN BODY: { "Message": "Success " "description": "External service given access to inbound service" } |
...