Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Add lifecycle sidecar to mesh gateway #380

Merged
merged 1 commit into from Mar 23, 2020

Conversation

lkysow
Copy link
Member

@lkysow lkysow commented Mar 11, 2020

When Consul clients in Kubernetes restart, they lose their
registrations. This causes any mesh gateways to be deregistered. To
solve this, we need to run a sidecar that ensures the service is always
registered: a lifecycle-sidecar.

For the lifecycle-sidecar to work, it needs a service.hcl service config
file. This required adding an init container that writes this file and
does the initial service registration. Since the init container is
registering the service, the consul connect envoy -mesh-gateway command
no longer needs the -register flag.

@lkysow lkysow added area/multi-dc Related to running with multiple datacenters bug Something isn't working labels Mar 12, 2020
@lkysow lkysow changed the base branch from wan-fed-acls to wan-federation March 17, 2020 22:46
@lkysow lkysow force-pushed the mesh-gateway-lifecycle-sidecar branch 2 times, most recently from e6aefe4 to 6b10e24 Compare March 17, 2020 22:53
@lkysow
Copy link
Member Author

lkysow commented Mar 17, 2020

For testing:

  • Use consul-k8s image lkysow/consul-k8s-dev:mar18-2020-acl-init that has the new -token-sink-file flag for acl-init (Add -token-sink-file flag to acl-init consul-k8s#232)
  • Start the mesh gateways, then delete the consul client pod on that node. The mesh gateway should be re-registered momentarily.

@lkysow lkysow marked this pull request as ready for review March 18, 2020 16:53
@lkysow lkysow requested a review from a team March 18, 2020 17:03
Copy link
Member

@ishustava ishustava left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Luke, it generally looks good. Great job on all those pesky tests! I left a few comments with suggestions and questions. Let me know what you think

templates/mesh-gateway-deployment.yaml Outdated Show resolved Hide resolved
templates/mesh-gateway-deployment.yaml Show resolved Hide resolved
templates/mesh-gateway-deployment.yaml Show resolved Hide resolved
templates/mesh-gateway-deployment.yaml Show resolved Hide resolved
templates/mesh-gateway-deployment.yaml Show resolved Hide resolved
@lkysow lkysow force-pushed the mesh-gateway-lifecycle-sidecar branch from 74c1880 to f46a444 Compare March 20, 2020 18:43
Copy link
Member

@ishustava ishustava left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🎉 ! Thanks for addressing my comments 🌮

When Consul clients in Kubernetes restart, they lose their
registrations. This causes any mesh gateways to be deregistered. To
solve this, we need to run a sidecar that ensures the service is always
registered: a lifecycle-sidecar.

For the lifecycle-sidecar to work, it needs a service.hcl service config
file. This required adding an init container that writes this file and
does the initial service registration. Since the init container is
registering the service, the consul connect envoy -mesh-gateway command
no longer needs the -register flag.
@lkysow lkysow force-pushed the mesh-gateway-lifecycle-sidecar branch from f46a444 to 0474f5d Compare March 20, 2020 19:36
@lkysow lkysow merged commit 8dd14ff into wan-federation Mar 23, 2020
@lkysow lkysow deleted the mesh-gateway-lifecycle-sidecar branch August 31, 2020 21:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/multi-dc Related to running with multiple datacenters bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants