diff --git a/charts/all/medical-diagnosis/grafana/templates/eso-grafana-sa-token.yaml b/charts/all/medical-diagnosis/grafana/templates/eso-grafana-sa-token.yaml new file mode 100644 index 00000000..209b2384 --- /dev/null +++ b/charts/all/medical-diagnosis/grafana/templates/eso-grafana-sa-token.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Values.rbac.serviceAccountName }}-token + namespace: xraylab-1 + annotations: + kubernetes.io/service-account.name: {{ .Values.rbac.serviceAccountName }} + argocd.argoproj.io/sync-wave: "1" +type: kubernetes.io/service-account-token diff --git a/charts/all/medical-diagnosis/grafana/templates/job-create-prometheus-datasource.yaml b/charts/all/medical-diagnosis/grafana/templates/job-create-prometheus-datasource.yaml index d660cbe4..07e7da02 100644 --- a/charts/all/medical-diagnosis/grafana/templates/job-create-prometheus-datasource.yaml +++ b/charts/all/medical-diagnosis/grafana/templates/job-create-prometheus-datasource.yaml @@ -2,7 +2,7 @@ apiVersion: batch/v1 kind: Job metadata: name: create-prometheus-datasource-object - namespace: {{ .Values.global.xraylab.namespace }} + namespace: xraylab-1 annotations: argocd.argoproj.io/hook: PostSync spec: @@ -14,9 +14,9 @@ spec: - /bin/bash - -c - | - #!/usr/bin/env bash - SECRET=$(oc get secret | grep xraylab-grafana-sa-token | head -n1 | awk '{print $1}') - TOKEN=$(oc extract secret/$SECRET --keys=token --to=-) + #TOKEN=$(oc create token {{ .Values.rbac.serviceAccountName }}-token --duration=$((365*24))h) + #SECRET=$(oc get secret | grep xraylab-grafana-sa-token | head -n1 | awk '{print $1}') + TOKEN=$(oc extract secret/{{ .Values.rbac.serviceAccountName }}-token --keys=token --to=-) cat <