Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

[stable/consul] Provide advanced configuration options for consul #1269

Closed
wants to merge 7 commits into from

Conversation

mitom
Copy link

@mitom mitom commented Jun 9, 2017

As per #1198 this adds another option to configure consul, allowing to pass in configuration by both configMaps and secrets. It would be fairly trivial to extend this to any other type that kubernetes can mount as a volume (like hostpath) if the list grows, or if there is a usecase.

It also allows to re-use parts of the configuration in case of multiple clusters as these can be separated into multiple objects.

There is one drawback, the new ConsulConfig option can't be set using helm's --set. The reason being --set can't set list of hashes at the moment (AFAIK). The suggested approach is to just use a hash, however in this scenario it could be possible to have a secret and configMap named the same and therefore a hash wouldn't work. The attribute could be separated into 2, which would solve the --set issue as well, however this would degrade functionality as the order in which configuration is loaded could not be influenced per type, not globally (without post-processing the files on the container).

There are no breaking changes or degradations.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 9, 2017
@lachie83
Copy link
Contributor

@mitom Thanks for the contrib. I'll review as soon as I can. If anyone else is available to review that would be great too. Thanks

@mitom
Copy link
Author

mitom commented Jun 20, 2017

A thing I discovered is that due to the fact that these are mounted as volumes and kubernetes won't allow the volume specification to change for pods in a statefulset after creation, the list can only be updated by re-creating the statefulset. This would lead to #1143 as all containers would attempt to leave the cluster and would also cause downtime.

The contents of each item in the list can be changed easily and the pods reloaded/roll-restarted.

@unguiculus unguiculus added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 20, 2017
@@ -32,6 +32,8 @@ The following tables lists the configurable parameters of the consul chart and t
| `ImagePullPolicy` | Container pull policy | `Always` |
| `Replicas` | k8s statefulset replicas | `3` |
| `Component` | k8s selector key | `consul` |
| `ConsulConfig.[].type` | either `secret` or `configMap` | - |
Copy link
Member

Choose a reason for hiding this comment

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

I don't like the syntax you used. This is confusing. May just add ConsulConfig and add an example to values.yaml.

@@ -45,6 +45,8 @@ uiService:
enabled: true
type: "NodePort"

ConsulConfig: []

Copy link
Member

Choose a reason for hiding this comment

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

Add example.

ConsulConfig: []
#  - type: secret
#    name: consul-defaults
#  - type: configMap
#    name: consul-defaults

@unguiculus
Copy link
Member

ping @lachie83

@lachie83
Copy link
Contributor

I agree with your review @unguiculus

@mitom mitom force-pushed the consul_extended_config branch from 83140e1 to 63d81f3 Compare August 18, 2017 10:16
@mitom
Copy link
Author

mitom commented Aug 18, 2017

I have made the changes you requested and also rebased the branch.

@mgoodness mgoodness assigned mgoodness and unassigned mgoodness Sep 10, 2017
@unguiculus
Copy link
Member

ping @lachie83

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 25, 2018
@lachie83
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 25, 2018
@lachie83 lachie83 dismissed unguiculus’s stale review January 25, 2018 23:53

Addressed all concerns

Copy link
Contributor

@lachie83 lachie83 left a comment

Choose a reason for hiding this comment

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

lgtm

@unguiculus
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 22, 2018
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 22, 2018
@unguiculus
Copy link
Member

/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mitom, unguiculus

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@unguiculus
Copy link
Member

@mitom Any chance you can fix the conflicts?

@pgdagenais
Copy link
Contributor

pgdagenais commented May 1, 2018

@unguiculus conflicts have been fixed in this PR #4765 by @timstoop

@pgdagenais
Copy link
Contributor

We can now close this PR since #4765 have been merged.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants