Compare commits
No commits in common. "b9dbeb98b0e99c8bb95276e3f2706126b36f220f" and "324ee3464837132345d0cf0b9fd8e9f3d0c4e6b2" have entirely different histories.
b9dbeb98b0
...
324ee34648
@ -6,6 +6,7 @@ resources:
|
|||||||
- synapse-rendered.yaml
|
- synapse-rendered.yaml
|
||||||
- synapse-signingkey-ensure-job.yaml
|
- synapse-signingkey-ensure-job.yaml
|
||||||
- mas-configmap.yaml
|
- mas-configmap.yaml
|
||||||
|
- mas-admin-client-secret.yaml
|
||||||
- mas-admin-client-secret-ensure-job.yaml
|
- mas-admin-client-secret-ensure-job.yaml
|
||||||
- mas-deployment.yaml
|
- mas-deployment.yaml
|
||||||
- mas-ingress.yaml
|
- mas-ingress.yaml
|
||||||
|
|||||||
@ -13,11 +13,8 @@ metadata:
|
|||||||
rules:
|
rules:
|
||||||
- apiGroups: [""]
|
- apiGroups: [""]
|
||||||
resources: ["secrets"]
|
resources: ["secrets"]
|
||||||
resourceNames: ["mas-admin-client-runtime"]
|
resourceNames: ["mas-admin-client"]
|
||||||
verbs: ["get", "patch", "update"]
|
verbs: ["get", "patch", "update"]
|
||||||
- apiGroups: [""]
|
|
||||||
resources: ["secrets"]
|
|
||||||
verbs: ["create"]
|
|
||||||
---
|
---
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: RoleBinding
|
kind: RoleBinding
|
||||||
@ -36,7 +33,7 @@ subjects:
|
|||||||
apiVersion: batch/v1
|
apiVersion: batch/v1
|
||||||
kind: Job
|
kind: Job
|
||||||
metadata:
|
metadata:
|
||||||
name: mas-admin-client-secret-ensure-7
|
name: mas-admin-client-secret-ensure-6
|
||||||
namespace: comms
|
namespace: comms
|
||||||
spec:
|
spec:
|
||||||
backoffLimit: 2
|
backoffLimit: 2
|
||||||
@ -67,18 +64,12 @@ spec:
|
|||||||
args:
|
args:
|
||||||
- |
|
- |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
if kubectl -n comms get secret mas-admin-client-runtime >/dev/null 2>&1; then
|
if kubectl -n comms get secret mas-admin-client -o jsonpath='{.data.client_secret}' 2>/dev/null | grep -q .; then
|
||||||
if kubectl -n comms get secret mas-admin-client-runtime -o jsonpath='{.data.client_secret}' 2>/dev/null | grep -q .; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
kubectl -n comms create secret generic mas-admin-client-runtime \
|
|
||||||
--from-file=client_secret=/work/client_secret >/dev/null
|
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
secret_b64="$(base64 /work/client_secret | tr -d '\n')"
|
secret_b64="$(base64 /work/client_secret | tr -d '\n')"
|
||||||
payload="$(printf '{"data":{"client_secret":"%s"}}' "${secret_b64}")"
|
payload="$(printf '{"data":{"client_secret":"%s"}}' "${secret_b64}")"
|
||||||
kubectl -n comms patch secret mas-admin-client-runtime --type=merge -p "${payload}" >/dev/null
|
kubectl -n comms patch secret mas-admin-client --type=merge -p "${payload}" >/dev/null
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: work
|
- name: work
|
||||||
mountPath: /work
|
mountPath: /work
|
||||||
|
|||||||
7
services/communication/mas-admin-client-secret.yaml
Normal file
7
services/communication/mas-admin-client-secret.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# services/communication/mas-admin-client-secret.yaml
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: mas-admin-client
|
||||||
|
namespace: comms
|
||||||
|
type: Opaque
|
||||||
Loading…
x
Reference in New Issue
Block a user