...
draw.io Diagram |
---|
border | true |
---|
| |
---|
diagramName | us-to-us intent |
---|
simpleViewer | false |
---|
width | |
---|
links | auto |
---|
tbstyle | top |
---|
lbox | true |
---|
diagramWidth | 1136 |
---|
revision | 3 |
---|
|
NOTE - For communication between the cluster, ISTIO_MUTUAL mode is default
Add Inbound service
The intent for this scenario
...
Code Block |
---|
language | js |
---|
theme | Midnight |
---|
title | POST |
---|
linenumbers | true |
---|
|
URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/traffic-intent-set/us-to-us-intents/
POST BODY:
{
"metadata": {
"name": "<name>" // unique name for each intent
"description": "connectivity intent for stateless micro-service to stateless micro-service communication"
"userdata1": <>,
"userdata2": <>
}
"spec": { // update the memory allocation for each field as per OpenAPI standards
"application": "<app1>",
"servicename": "httpbin" //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": "SIMPLE", // Support 2 modes. SIMPLE and ISTIO_MUTUAL. For external Client, it is SIMPLE and MUTUAL (caCertificate required)
"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
"istio-proxy": "yes", // The features (mTLS, LB, Circuit breaking) are no limitedavaialble to services without istio-proxy
// Traffic configuration - Loadbalancing is applicable per service. The traffic to this service is distrbuted amongst the pods under it.
"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
"httpCookie": "useruser1" // Input for Hash in "ConsistenHash" LB and mode as "httpCookie" . Name of the cookie to maitain stick sessions
// Circuit Breaking
"maxConnections": 10 //connection pool for tcp and http traffic
"concurrenthttp2Requests": 1000 // concurent http2 requests which can be allowed
"httpRequestPerConnection": 100 //number of http requests per connection. Valid only for http traffic
// Connection termination
"consecutiveErrors": 8 // Default is 5. Number of consecutive error before the host is removed from load balancing pool
"baseEjectionTime" : 15 // Default is 5, time for which the host will be removed from load balancing pool when it returns error for no of times more than "consecutiveErrors" limit
"timeOutintervalSweep" : 55m, // in Seconds. Connection timeout for tcp and idleTimeout for httptime limit before the removed hosts are added back to the load balancing pool.
// credentials for mTLS. Not required in "SIMPLE" mode this scenario since the services are in one logical cloud with common rootCA. ISTIO_MUTUAL is enabled by default.
"Servicecertificate" : {serviceCertificate.pem}"" // Present actual certificate here.
"ServicePrivateKey" : {servicePrivateKey.pem}"" // Present actual private key here.
// Access Control
namespaces: [] // Workloads from this namespaces can access the inbound service
}
}
RETURN STATUS: 201
RETURN BODY:
{
"name": "servicehttpbin"
"Message": "inbound service created"
} |
...
Name of the Cluster | Microservice | Istio Configuration | Comments |
---|
Cluster01 | - echo
- sleep
|
Microservice | Resource |
---|
common | serviceEntry (httpbin) | echo | destinationRule for simple TLS | sleep | destinationRule for simple TLS |
|
|
|
|
Cluster02 | httpbin |
Microservice | Resource |
---|
httpbin | destinationRule for simple TLS destinationRule for Loadbalancing AuthorizationPolicy for Access Control
|
|
|
Cluster01 Resources
ServiceEntry - To enable sleep to access httpbin
Code Block |
---|
language | yml |
---|
theme | Eclipse |
---|
title | ServiceEntry |
---|
linenumbers | true |
---|
|
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: servicename-httpbin
spec:
hosts:
# template for the remote service name - <servicename.namespace.global>
# Treat remote cluster services as part of the service mesh
# as all clusters in the service mesh share the same root of trust.
location: MESH_INTERNAL
ports:
- name: http1
number: 8000
protocol: http
resolution: DNS
addresses:
# the IP address to which httpbin.<namespace>.<logicalcloudname> will resolve to
# must be unique for each remote service, within a given cluster.
# This address need not be routable. Traffic for this IP will be captured
# by the sidecar and routed appropriately.
- 240.0.0.2
endpoints:
# This is the routable address of the istio ingress gateway in cluster02
# routed to this address.
- address: 172.25.55.50
ports:
http1: 15443 //Sni. Do not change this
|
Cluster 02 Resources
Code Block |
---|
language | yml |
---|
theme | Eclipse |
---|
title | ServiceEntry |
---|
linenumbers | true |
---|
|
|