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

Use docker-entrypoint when running consul #1055

Closed
wants to merge 2 commits into from

Conversation

lkysow
Copy link
Member

@lkysow lkysow commented Jul 26, 2021

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

How I've tested this PR:

  • acceptance tests

How I expect reviewers to test this PR:

  • code

Checklist:

  • CHANGELOG entry added (HashiCorp engineers only, community PRs should not add a changelog entry)

@lkysow lkysow force-pushed the lkysow/consul-docker-entrypoint branch from 5605d0d to a89c157 Compare July 27, 2021 00:44
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
@lkysow lkysow force-pushed the lkysow/consul-docker-entrypoint branch from a89c157 to 39f3fd9 Compare August 6, 2021 16:00
@lkysow lkysow changed the title [wip] use docker entrypoint Use docker-entrypoint when running consul Aug 6, 2021
Test now uses map/select instead of using fixed indices.
@lkysow
Copy link
Member Author

lkysow commented Aug 6, 2021

Closing for hashicorp/consul-k8s#590

@lkysow lkysow closed this Aug 6, 2021
@lkysow lkysow deleted the lkysow/consul-docker-entrypoint branch August 6, 2021 23:09
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.

1 participant