LoadBalancer Envoy Envoy Envoy Application Envoy Service-A1 Cluster Application Envoy Service-A2 Cluster Application Envoy API-Gateway-B Cluster Application Envoy Service-B1 Cluster Application Envoy All of about 30 Services in 4 Subsystems are running as Nomad Job Traffic between envoys is protected by mTLS using Vault-issued certificates External Services DB MQ
Envoy Container Task Group Application Container Envoy Container Other Sercvices (Envoys) Control Plane Consul Client Consul Server Nomad Client Nomad Server Ansible/AWX kick job allocate start TaskGroup with service port assign register service propagate service info (Blocking Query) propagate config by xDS (gRPC stream) Dynamic Service Port Business Traffic propagate service info Dynamic Service Port Business Traffic make envoy config propagate config template (Blocking Query) register envoy config template for each service to KVS health check
(Static) App Admin Port (Static Port) Service Endpoint (Static Port) Healthcheck Endpoint (Static Port) Consul Other Service Application Task publishes no service directly. Watching if upsterams are healthy (ex: DB) Main Service Ingress Port (Dynamic) App Admin Port (Dynamic) Healthcheck Business Request
Application Container Task 2 Sidecar Container 192.168.200.aaa (by DHCP) 192.168.200.bbb (by DHCP) Docker Embedded DNS Server Lookup <name-of-task1> Lookup <name-of-task2> ENV EGRESS_HOST= <name-of-task2> ENV EGRESS_PORT= 3101 <name-of-task1>. IN A 192.168.200.aaa <name-of-task2>. IN A 192.168.200.bbb ENV LOCAL_APP_HOST= <name-of-task1> ENV LOCAL_APP_SERVICE_PORT= 8080 To be registered when Job started Necessary to use user-defined bridge network to enable embedded DNS Server. (not default bridge network)
Update Started Alloc1 Other Service Consul Control Plane Deregister Service Request Service Info (Alloc1,Alloc2) Update Kicked l UpdateがKickされると、Nomad Jobは最初にConsulからサービス情報を削除する l この時点でUpdate中のAllocationの情報はConsulのService Discoveryで提供されなくなるが、他サー ビスのRouting情報までは反映されておらず、 Requestは継続して届く Alloc2 Alloc2 Service Info (Alloc1,Alloc2) Service Info (Alloc1,Alloc2) Service Info (Alloc1,Alloc2)
shutdown_delay Passed New Allocation Start Before Shutdown Alloc1 Other Service Consul Control Plane Request Service Info (Alloc1,Alloc2) Alloc2 Service Info (Alloc1,Alloc2) Shutdown Alloc1 Other Service Consul Control Plane Request Alloc2 Service Info (Alloc2) Service Info (Alloc2)
Client Token Issued and injected when agent started Issued and injected when job started l Nomad Server Agentの起動時にServer Tokenを注⼊する l Nomad ServerはJobの起動時にServer Tokenを使ってClient Tokenを発⾏しTaskに注⼊する l TaskはClient Tokenを使ってVaultにアクセスしSecretを取得する Secret Secret Secret Approle Vault