Skip to content

Support deploying multiple injector replicas with auto-TLS#436

Merged
tomhjp merged 7 commits into
masterfrom
multiple-replicas
Jan 5, 2021
Merged

Support deploying multiple injector replicas with auto-TLS#436
tomhjp merged 7 commits into
masterfrom
multiple-replicas

Conversation

@tomhjp
Copy link
Copy Markdown
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
- 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
Copy Markdown
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?

Comment thread templates/injector-leader-endpoint.yaml
Comment thread values.yaml Outdated
Copy link
Copy Markdown
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
Copy Markdown
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

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