Skip to content

Commit

Permalink
kommander: Only copy opsportal secret username
Browse files Browse the repository at this point in the history
  • Loading branch information
gracedo committed Jan 31, 2020
1 parent ac8c0c6 commit 0a2615e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: batch/v1
kind: Job
metadata:
name: copy-opsportal-credentials-secret
name: copy-{{ .Values.grafana.hooks.secretKeyRef }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "kommander.labels" . | indent 4 }}
Expand All @@ -13,7 +13,7 @@ metadata:
spec:
template:
metadata:
name: copy-opsportal-credentials-secret
name: copy-{{ .Values.grafana.hooks.secretKeyRef }}
spec:
containers:
- name: kubectl
Expand All @@ -23,13 +23,13 @@ spec:
command:
- /bin/sh
- -c
- kubectl get secret ops-portal-credentials --namespace=kubeaddons --export -o yaml | kubectl apply --namespace={{ .Release.Namespace }} -f -
- kubectl create secret generic {{ .Values.grafana.hooks.secretKeyRef }} -n {{ .Release.Namespace }} --from-literal=username=$(kubectl get secret ops-portal-credentials --namespace=kubeaddons --export -o jsonpath="{.data.username}" | base64 --decode)
restartPolicy: OnFailure
---
apiVersion: batch/v1
kind: Job
metadata:
name: cleanup-opsportal-credentials-secret
name: cleanup-{{ .Values.grafana.hooks.secretKeyRef }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "kommander.labels" . | indent 4 }}
Expand All @@ -40,7 +40,7 @@ metadata:
spec:
template:
metadata:
name: cleanup-opsportal-credentials-secret
name: cleanup-{{ .Values.grafana.hooks.secretKeyRef }}
spec:
serviceAccountName: {{ .Values.grafana.hooks.kommanderServiceAccount }}
containers:
Expand All @@ -50,6 +50,6 @@ spec:
command:
- /bin/sh
- -c
- kubectl delete secret ops-portal-credentials --namespace={{ .Release.Namespace }}
- kubectl delete secret {{ .Values.grafana.hooks.secretKeyRef }} --namespace={{ .Release.Namespace }}
restartPolicy: OnFailure
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion stable/kommander/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ grafana:
hooks:
jobName: set-kommander-grafana-home-dashboard
image: dwdraju/alpine-curl-jq
secretKeyRef: ops-portal-credentials
secretKeyRef: ops-portal-username
serviceURL: http://kommander-kubeaddons-grafana.kommander
# This is the UID of the "Kubernetes / Compute Resources / Clusters" summary dashboard
homeDashboardUID: efa86fd1d0c121a26444b636a3f509a8
Expand Down

0 comments on commit 0a2615e

Please sign in to comment.