Skip to content

Commit

Permalink
Create federation secret with default consul-gossip-encryption-key
Browse files Browse the repository at this point in the history
…secret when global.gossipEncryption.autoGenerate is set to true (#854)

* adding conditional to check autogenerate

* adding conditional around create federation secret flag command

* add changelog
  • Loading branch information
David Yu authored Nov 15, 2021
1 parent 1eb2075 commit 31586a7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ BUG FIXES:
Consul destination namespace for connect or catalog sync. [[GH-846](https://github.com/hashicorp/consul-k8s/pull/846)]
* Truncate Persistent Volume Claim names when namespace names are too long. [[GH-799](https://github.com/hashicorp/consul-k8s/pull/799)]
* Fix issue where UI metrics would be enabled when `global.metrics=false` and `ui.metrics.enabled=-`. [[GH-841](https://github.com/hashicorp/consul-k8s/pull/841)]
* Populate the federation secret with the generated Gossip key when `global.gossipEncryption.autoGenerate` is set to true. [[GH-854](https://github.com/hashicorp/consul-k8s/pull/854)]

## 0.36.0 (November 02, 2021)

Expand Down
13 changes: 11 additions & 2 deletions charts/consul/templates/create-federation-secret-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ spec:
items:
- key: {{ .Values.global.gossipEncryption.secretKey }}
path: gossip.key
{{- else if .Values.global.gossipEncryption.autoGenerate }}
- name: gossip-encryption-key
secret:
secretName: consul-gossip-encryption-key
items:
- key: key
path: gossip.key
{{- end }}

{{- if .Values.global.tls.enableAutoEncrypt }}
Expand Down Expand Up @@ -107,7 +114,8 @@ spec:
mountPath: /consul/tls/client/ca
readOnly: true
{{- end }}
{{- if (and .Values.global.gossipEncryption.secretName .Values.global.gossipEncryption.secretKey) }}
{{- if (or .Values.global.gossipEncryption.autoGenerate
(and .Values.global.gossipEncryption.secretName .Values.global.gossipEncryption.secretKey)) }}
- name: gossip-encryption-key
mountPath: /consul/gossip
readOnly: true
Expand All @@ -119,7 +127,8 @@ spec:
consul-k8s-control-plane create-federation-secret \
-log-level={{ .Values.global.logLevel }} \
-log-json={{ .Values.global.logJSON }} \
{{- if (and .Values.global.gossipEncryption.secretName .Values.global.gossipEncryption.secretKey) }}
{{- if (or .Values.global.gossipEncryption.autoGenerate (and
.Values.global.gossipEncryption.secretName .Values.global.gossipEncryption.secretKey)) }}
-gossip-key-file=/consul/gossip/gossip.key \
{{- end }}
{{- if .Values.global.acls.createReplicationToken }}
Expand Down

0 comments on commit 31586a7

Please sign in to comment.