From 899dae1e54f861fec5e88aff498f9b868879920f Mon Sep 17 00:00:00 2001 From: Jonathan Stacks Date: Sun, 13 Aug 2017 12:07:27 -0500 Subject: [PATCH] Allow consul's gossip encryption to be turned off (#1512) --- stable/consul/README.md | 1 + stable/consul/templates/consul.yaml | 4 ++++ stable/consul/values.yaml | 3 +++ 3 files changed, 8 insertions(+) diff --git a/stable/consul/README.md b/stable/consul/README.md index 090f75c2c7..1e53c12dcc 100644 --- a/stable/consul/README.md +++ b/stable/consul/README.md @@ -35,6 +35,7 @@ The following tables lists the configurable parameters of the consul chart and t | `Cpu` | container requested cpu | `100m` | | `DatacenterName` | Consul Datacenter Name | `dc1` (The consul default) | | `DisableHostNodeId` | Disable Node Id creation (uses random)| `false` | +| `EncryptGossip` | Whether or not gossip is encrypted | `true` | | `Memory` | container requested memory | `512Mi` | | `Storage` | Persistent volume size | `1Gi` | | `StorageClass` | Persistent volume storage class | `nil` | diff --git a/stable/consul/templates/consul.yaml b/stable/consul/templates/consul.yaml index 5040660c77..2a51ecaf2e 100644 --- a/stable/consul/templates/consul.yaml +++ b/stable/consul/templates/consul.yaml @@ -156,10 +156,12 @@ spec: - | IP=$(hostname -i) + {{- if .Values.EncryptGossip }} if [ -e /etc/consul/secrets/gossip-key ]; then echo "{\"encrypt\": \"$(base64 /etc/consul/secrets/gossip-key)\"}" > /etc/consul/encrypt.json GOSSIP_KEY="-config-file /etc/consul/encrypt.json" fi + {{- end }} for i in $(seq 0 $((${INITIAL_CLUSTER_SIZE} - 1))); do while true; do @@ -190,7 +192,9 @@ spec: -bind=0.0.0.0 \ -advertise=${IP} \ ${PEERS} \ + {{- if .Values.EncryptGossip }} ${GOSSIP_KEY} \ + {{- end }} -client=0.0.0.0 \ -dns-port=${DNSPORT} volumes: diff --git a/stable/consul/values.yaml b/stable/consul/values.yaml index 31f0f3ea82..1992d3eb68 100644 --- a/stable/consul/values.yaml +++ b/stable/consul/values.yaml @@ -32,6 +32,9 @@ DisableHostNodeId: false ## default 'dc1' # DatacenterName: dc1 +## Encrypt Gossip traffic +EncryptGossip: true + ## StorageClass name for use with Persistent Volume Claim (PVC) using beta notations # StorageClass: