-
Notifications
You must be signed in to change notification settings - Fork 326
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
Use docker-entrypoint when running consul #590
Conversation
Previously we were executing consul directly via /bin/consul and we were using the Kubernetes `command` key which overrides the default Docker ENTRYPOINT. This had no issues, however I propose that it's best to execute via the entrypoint so we keep things consistent with how the Docker image was supposed to be run. This is also consistent with Vault's Helm chart. If you step through the entrypoint script, nothing actually changes with how we execute consul because we don't trigger any of the `if` statements. So there is no real effect right now. In order to support using the entrypoint script, we need to disable part of the script that attempts to change the ownership of the /consul directory because the ownership is already set via Kube. Entrypoint script is here: https://github.com/hashicorp/docker-consul/blob/master/0.X/docker-entrypoint.sh
Test now uses map/select instead of using fixed indices.
There was a problem hiding this 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, given my pretty limited knowledge of the domain. I only had a nitpick in the Changelog.
CHANGELOG.md
Outdated
@@ -2,6 +2,7 @@ | |||
|
|||
IMPROVEMENTS: | |||
* Add flags `-log-level`, `-log-json` to all subcommands to control log level and json formatting. [[GH-523](https://github.com/hashicorp/consul-k8s/pull/523)] | |||
* Execute consul clients and servers using the docker entrypoint to keep consistent. [[GH-590](https://github.com/hashicorp/consul-k8s/pull/590)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: "Consul" instead of "consul" and "Docker" instead of "docker" to be consistent with previous Changelog items.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!!
CHANGELOG.md
Outdated
@@ -2,6 +2,7 @@ | |||
|
|||
IMPROVEMENTS: | |||
* Add flags `-log-level`, `-log-json` to all subcommands to control log level and json formatting. [[GH-523](https://github.com/hashicorp/consul-k8s/pull/523)] | |||
* Execute consul clients and servers using the docker entrypoint to keep consistent. [[GH-590](https://github.com/hashicorp/consul-k8s/pull/590)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Execute consul clients and servers using the docker entrypoint to keep consistent. [[GH-590](https://github.com/hashicorp/consul-k8s/pull/590)] | |
* Execute consul clients and servers using the docker entrypoint for consistency. [[GH-590](https://github.com/hashicorp/consul-k8s/pull/590)] |
Previously we were executing consul directly via /bin/consul and we were
using the Kubernetes
command
key which overrides the default DockerENTRYPOINT.
This had no issues, however I propose that it's best to execute via the
entrypoint so we keep things consistent with how the Docker image was
supposed to be run. This is also consistent with Vault's Helm chart. If
you step through the entrypoint script, nothing actually changes with
how we execute consul because we don't trigger any of the
if
statements. So there is no real effect right now.
In order to support using the entrypoint script, we need to disable part of the
script that attempts to change the ownership of the /consul directory
because the ownership is already set via Kube. To disable this we set the
DISABLE_PERM_MGMT
env var totrue
.Entrypoint script is here: https://github.com/hashicorp/docker-consul/blob/master/0.X/docker-entrypoint.sh
How I've tested this PR:
How I expect reviewers to test this PR:
Checklist: