From 9dcf397a98252c1b279ff7362e86a26d5ad1e904 Mon Sep 17 00:00:00 2001 From: Eldad Assis Date: Wed, 5 Sep 2018 08:50:19 +0300 Subject: [PATCH] Change distributor token to be managed as a secret --- .../distribution/templates/distributor-statefulset.yaml | 7 +++---- stable/distribution/templates/distributor-token.yaml | 9 +++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/stable/distribution/templates/distributor-statefulset.yaml b/stable/distribution/templates/distributor-statefulset.yaml index 9c17936cd..a5c9c74cb 100644 --- a/stable/distribution/templates/distributor-statefulset.yaml +++ b/stable/distribution/templates/distributor-statefulset.yaml @@ -54,8 +54,7 @@ spec: mountPath: {{ .Values.distributor.persistence.mountPath | quote }} {{- if .Values.distributor.token }} - name: distributor-token - mountPath: "/tmp/security/token" - subPath: token + mountPath: "/tmp/security" {{- end }} containers: - name: {{ .Values.distributor.name }} @@ -93,8 +92,8 @@ spec: volumes: {{- if .Values.distributor.token }} - name: distributor-token - configMap: - name: {{ template "distributor.fullname" . }}-token + secret: + secretName: {{ template "distributor.fullname" . }}-token {{- end }} {{- if .Values.distributor.persistence.enabled }} volumeClaimTemplates: diff --git a/stable/distribution/templates/distributor-token.yaml b/stable/distribution/templates/distributor-token.yaml index 09eae85c2..2d4cbb182 100644 --- a/stable/distribution/templates/distributor-token.yaml +++ b/stable/distribution/templates/distributor-token.yaml @@ -1,14 +1,15 @@ {{- if .Values.distributor.token }} apiVersion: v1 -kind: ConfigMap +kind: Secret metadata: name: {{ template "distributor.fullname" . }}-token labels: app: {{ template "distribution.name" . }} chart: {{ template "distribution.chart" . }} - heritage: {{ .Release.Service }} release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +type: Opaque data: token: |- - {{ .Values.distributor.token }} -{{- end }} \ No newline at end of file + {{ .Values.distributor.token | b64enc }} +{{- end }}