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

Add config for webhook-cert-manager tolerations #712

Merged
merged 7 commits into from
Sep 9, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ IMPROVEMENTS:
* Add readiness, liveness and startup probes to the connect inject deployment. [[GH-626](https://github.com/hashicorp/consul-k8s/pull/626)][[GH-701](https://github.com/hashicorp/consul-k8s/pull/701)]
* Add support for setting container security contexts on client and server Pods. [[GH-620](https://github.com/hashicorp/consul-k8s/pull/620)]
* Update Envoy image to 1.18.4 [[GH-699](https://github.com/hashicorp/consul-k8s/pull/699)]
* Add configuration for webhook-cert-manager tolerations [[GH-712](https://github.com/hashicorp/consul-k8s/pull/712)]
* Control Plane
* Add health endpoint to the connect inject webhook that will be healthy when webhook certs are present and not empty. [[GH-626](https://github.com/hashicorp/consul-k8s/pull/626)]
* Catalog Sync: Fix issue registering NodePort services with wrong IPs when a node has multiple IP addresses. [[GH-619](https://github.com/hashicorp/consul-k8s/pull/619)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,9 @@ spec:
- name: config
configMap:
name: {{ template "consul.fullname" . }}-webhook-cert-manager-config
{{- if .Values.webhookCertManager.tolerations }}
tolerations:
{{ tpl .Values.webhookCertManager.tolerations . | indent 8 | trim }}
{{- end}}

{{- end }}
23 changes: 23 additions & 0 deletions charts/consul/test/unit/webhook-cert-manager-deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,26 @@ load _helpers
yq 'length > 0' | tee /dev/stderr)
[ "${actual}" = "true" ]
}

@test "webhookCertManager/Deployment: no tolerations by default" {
cd `chart_dir`
local actual=$(helm template \
-s templates/webhook-cert-manager-deployment.yaml \
--set 'controller.enabled=true' \
--set 'connectInject.enabled=true' \
. | tee /dev/stderr |
yq -r '.spec.template.spec.tolerations' | tee /dev/stderr)
[ "${actual}" = "null" ]
}

@test "webhookCertManager/Deployment: tolerations can be set" {
cd `chart_dir`
local actual=$(helm template \
-s templates/webhook-cert-manager-deployment.yaml \
--set 'controller.enabled=true' \
--set 'connectInject.enabled=true' \
--set 'webhookCertManager.tolerations=- key: value' \
. | tee /dev/stderr |
yq -r '.spec.template.spec.tolerations[0].key' | tee /dev/stderr)
[ "${actual}" = "value" ]
}
10 changes: 10 additions & 0 deletions charts/consul/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2245,6 +2245,16 @@ terminatingGateways:
gateways:
- name: terminating-gateway

# Configuration settings for the webhook-cert-manager
t-eckert marked this conversation as resolved.
Show resolved Hide resolved
# webhook-cert-manager ensures that cert bundles are up to date for mutating webhooks
t-eckert marked this conversation as resolved.
Show resolved Hide resolved
webhookCertManager:

# Toleration Settings
# This should be a multi-line string matching the Toleration array
# in a PodSpec.
# @type: string
tolerations: null

# Configures a demo Prometheus installation.
prometheus:
# When true, the Helm chart will install a demo Prometheus server instance
Expand Down