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 vault-k8s internal leader election #568

Merged
merged 7 commits into from
Aug 31, 2021
Merged

Conversation

tvoran
Copy link
Member

@tvoran tvoran commented Jul 10, 2021

Adds extra RBAC and removes leader-elector container deployment to support hashicorp/vault-k8s#271.

@tvoran tvoran marked this pull request as ready for review August 23, 2021 06:12
@tvoran tvoran requested review from tomhjp and benashz August 23, 2021 06:12
owner=$(kubectl get configmaps vault-k8s-leader -o json | jq -r .metadata.ownerReferences\[0\].name)
leader=$(kubectl get pods $owner -o json | jq -r .metadata.name)
[ -n "${leader}" ] && [ "${leader}" != "null" ] && break
let "tries=tries+1"
Copy link
Contributor

Choose a reason for hiding this comment

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

You prefer to use let instead of the ++ operator?

Copy link
Member Author

Choose a reason for hiding this comment

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

I prefer whatever works, and this works 😄

Copy link
Member Author

Choose a reason for hiding this comment

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

(To explain more, ((tries++)) seems to always throw an error for me under bats.)

Copy link
Contributor

@benashz benashz left a comment

Choose a reason for hiding this comment

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

Only one question, otherwise 👍

@tvoran tvoran merged commit d31f942 into master Aug 31, 2021
@tvoran tvoran deleted the VAULT-2403/internal-leader branch August 31, 2021 22:16
tvoran added a commit that referenced this pull request Sep 3, 2021
Adds the leader-elector container support that was removed in
PR #568. The new vault-k8s uses an internal mechanism for leader
determination, so this is just for backwards compatibility, and can
be removed in the near future.
tvoran added a commit that referenced this pull request Sep 16, 2021
Adds the leader-elector container support that was removed in
PR #568. The new vault-k8s uses an internal mechanism for leader
determination, so this is just for backwards compatibility, and can
be removed in the near future.

* mark the endpoint as deprecated

* add a new useContainer option for leaderElector

Default to not deploying the old leader-elector container, unless
injector.leaderElector.useContainer is `true`.
@tvoran tvoran mentioned this pull request Sep 16, 2021
illegalnumbers pushed a commit to streamnative/vault-helm that referenced this pull request Mar 17, 2022
illegalnumbers pushed a commit to streamnative/vault-helm that referenced this pull request Mar 17, 2022
Adds the leader-elector container support that was removed in
PR hashicorp#568. The new vault-k8s uses an internal mechanism for leader
determination, so this is just for backwards compatibility, and can
be removed in the near future.

* mark the endpoint as deprecated

* add a new useContainer option for leaderElector

Default to not deploying the old leader-elector container, unless
injector.leaderElector.useContainer is `true`.
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