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

Annotate deployments with hashed extraconfig #550

Merged
merged 2 commits into from
Jul 24, 2020
Merged

Conversation

thisisnotashwin
Copy link

@thisisnotashwin thisisnotashwin commented Jul 23, 2020

When the extra config for a client or server is updated, it updates the underlying configMap but has no way of informing the server statefulSet or client daemonSet of the update.With this PR, the values for server.extraConfig & client.extraConfig are saved as annotations on the server statefulSet spec and client daemonsetSpec respectfully. If a user updates the extraConfig and performs a helm upgrade, it will force a reconcile of the server and client pods (depending on what changed) and will keep them updated with the latest config.

Signed-off-by: Ashwin Venkatesh [email protected]

Testing:
• Install consul using helm install with some values file
• Update sever.extraConfig and perform a helm upgrade with the file
• Observe kubectl get pods. The existing server pod will terminate and a new one will spin up with the updated config. You can compare the value of the annotation "consul.hashicorp.com/config-checksum" before and after the upgrade to see it change.
• Update client.extraConfig and perform a helm upgrade with the file
• Observe kubectl get pods. The existing client pod will terminate and a new one will spin up with the updated config. You can compare the value of the annotation "consul.hashicorp.com/config-checksum" before and after the upgrade to see it change.
• Be in awe.

@thisisnotashwin thisisnotashwin requested review from lkysow, a team and ishustava and removed request for a team July 23, 2020 22:15
@thisisnotashwin thisisnotashwin marked this pull request as ready for review July 23, 2020 22:51
Copy link
Contributor

@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 great! I tested it, and clients and servers were upgraded. I was in awe 😄

Copy link
Member

@lkysow lkysow left a comment

Choose a reason for hiding this comment

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

Looks great!

@lkysow
Copy link
Member

lkysow commented Jul 24, 2020

Oh, I think we need to add a changelog entry

@@ -1,5 +1,11 @@
## Unreleased

IMPROVEMENTS:
Copy link
Member

Choose a reason for hiding this comment

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

I think this might need to be listed as a breaking change too? Since doing a full restart of all the clients and servers can be destructive.

Copy link
Author

Choose a reason for hiding this comment

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

Sure thing.

Copy link
Author

Choose a reason for hiding this comment

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

done 👍

- When the extra config for a client or server is updated, it updates
  the underlying configMap but has no way of informing the server statefulSet or client daemonSet of the update.With this PR, the values for server.extraConfig & client.extraConfig
are saved as annotations on the server statefulSet spec and client
daemonsetSpec respectfully. If a user updates the extraConfig and
performs a `helm upgrade`, it will force a reconcile of the server and
client pods (depending on what changed) and will keep them updated with
the latest config.

Signed-off-by: Ashwin Venkatesh <[email protected]>
CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Luke Kysow <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants