Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support deploying multiple injector replicas with auto-TLS #436

Merged
merged 7 commits into from
Jan 5, 2021

Conversation

tomhjp
Copy link
Contributor

@tomhjp tomhjp commented Dec 17, 2020

This PR implements support for the leader election functionality added in hashicorp/vault-k8s#198.

Acceptance test passing locally:

$ bats -t test/acceptance/injector-leader-elector.bats
1..1
ok 1 injector: testing leader elector

By default, no behaviour change other than some pod anti-affinity settings which I think are harmless, but please correct me if you think the default injector affinity settings should stay empty.

@tomhjp tomhjp changed the title Support deploying multiple injector replicas Support deploying multiple injector replicas with auto-TLS Dec 17, 2020
@@ -84,6 +84,14 @@ spec:
- name: AGENT_INJECT_TELEMETRY_PATH
value: "/metrics"
{{- end }}
{{- if and (eq (.Values.injector.leaderElector.enabled | toString) "true") (gt (.Values.injector.replicas | int) 1) }}
Copy link
Contributor

Choose a reason for hiding this comment

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

I see this being used a few times, should we just make it a helper function?

values.yaml Outdated Show resolved Hide resolved
Copy link
Member

@tvoran tvoran left a comment

Choose a reason for hiding this comment

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

I agree with Jason's comment about a helper function for the template line, and we may also want to add an election ttl configurable option: https://github.com/hashicorp/vault-k8s/blob/master/deploy/injector-deployment.yaml#L29

But I'd say neither of those are blockers, and can be done in subsequent PRs if we like.

@tomhjp
Copy link
Contributor Author

tomhjp commented Jan 4, 2021

I've added configurable TTL, and acceptance test is still passing locally:

bats -t test/acceptance/injector-leader-elector.bats
1..1
ok 1 injector: testing leader elector

@tomhjp tomhjp merged commit e6b4969 into master Jan 5, 2021
@tomhjp tomhjp deleted the multiple-replicas branch January 5, 2021 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants