From 0d3ebfdfac1097bcbf3ce354b2209117dbedcca9 Mon Sep 17 00:00:00 2001 From: Corey O'Brien Date: Mon, 7 May 2018 10:44:51 -0400 Subject: [PATCH] [stable/consul] Fix statefulset selector (#5151) * [stable/consul] Fix statefulset selectors Selectors need to be explicit and immutable so they can't contain the chart version * Add version back to label but remove from selector --- stable/consul/Chart.yaml | 2 +- stable/consul/templates/consul-ingress.yaml | 1 - stable/consul/templates/consul-statefulset.yaml | 4 ++++ stable/consul/templates/gossip-secret.yaml | 5 +++++ stable/consul/templates/pod-dist-budget.yaml | 5 +++++ 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/stable/consul/Chart.yaml b/stable/consul/Chart.yaml index 7e29cb1272..1fde599d0b 100755 --- a/stable/consul/Chart.yaml +++ b/stable/consul/Chart.yaml @@ -1,6 +1,6 @@ name: consul home: https://github.com/hashicorp/consul -version: 1.3.6 +version: 1.4.0 appVersion: 1.0.0 description: Highly available and distributed service discovery and key-value store designed with support for the modern data center to make distributed systems and diff --git a/stable/consul/templates/consul-ingress.yaml b/stable/consul/templates/consul-ingress.yaml index 8e4064aa6e..db07695dd8 100644 --- a/stable/consul/templates/consul-ingress.yaml +++ b/stable/consul/templates/consul-ingress.yaml @@ -29,4 +29,3 @@ spec: {{ toYaml .Values.uiIngress.tls | indent 4 }} {{- end -}} {{- end }} - diff --git a/stable/consul/templates/consul-statefulset.yaml b/stable/consul/templates/consul-statefulset.yaml index b5d43a5e99..76eaec5ec0 100644 --- a/stable/consul/templates/consul-statefulset.yaml +++ b/stable/consul/templates/consul-statefulset.yaml @@ -12,6 +12,10 @@ spec: replicas: {{ default 3 .Values.Replicas }} updateStrategy: type: RollingUpdate + selector: + matchLabels: + release: {{ .Release.Name | quote }} + component: "{{ .Release.Name }}-{{ .Values.Component }}" template: metadata: name: "{{ template "consul.fullname" . }}" diff --git a/stable/consul/templates/gossip-secret.yaml b/stable/consul/templates/gossip-secret.yaml index 94911c63a6..0dc777bdec 100644 --- a/stable/consul/templates/gossip-secret.yaml +++ b/stable/consul/templates/gossip-secret.yaml @@ -2,6 +2,11 @@ apiVersion: v1 kind: Secret metadata: name: {{ template "consul.fullname" . }}-gossip-key + labels: + heritage: {{ .Release.Service | quote }} + release: {{ .Release.Name | quote }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + component: "{{ .Release.Name }}-{{ .Values.Component }}" type: Opaque data: {{ if .Values.GossipKey }} diff --git a/stable/consul/templates/pod-dist-budget.yaml b/stable/consul/templates/pod-dist-budget.yaml index 06f36dc94e..0098619e6d 100644 --- a/stable/consul/templates/pod-dist-budget.yaml +++ b/stable/consul/templates/pod-dist-budget.yaml @@ -3,6 +3,11 @@ apiVersion: policy/v1beta1 kind: PodDisruptionBudget metadata: name: "{{ template "consul.fullname" . }}-pdb" + labels: + heritage: {{ .Release.Service | quote }} + release: {{ .Release.Name | quote }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + component: "{{ .Release.Name }}-{{ .Values.Component }}" spec: maxUnavailable: {{ .Values.maxUnavailable }} selector: