39 lines
1.2 KiB
YAML
39 lines
1.2 KiB
YAML
apiVersion: batch/v1
|
|
kind: Job
|
|
metadata:
|
|
name: temporal-namespaces-setup
|
|
namespace: temporal
|
|
annotations:
|
|
argocd.argoproj.io/hook: PostSync
|
|
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
|
|
spec:
|
|
backoffLimit: 10
|
|
ttlSecondsAfterFinished: 86400
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/name: temporal
|
|
app.kubernetes.io/component: namespaces-setup
|
|
spec:
|
|
restartPolicy: OnFailure
|
|
containers:
|
|
- name: tctl
|
|
image: temporalio/admin-tools:1.31.0
|
|
env:
|
|
- name: TEMPORAL_ADDRESS
|
|
value: temporal-frontend.temporal:7233
|
|
command:
|
|
- /bin/sh
|
|
- -c
|
|
- |
|
|
set -eu
|
|
until temporal operator cluster health 2>/dev/null; do
|
|
echo "waiting for temporal-frontend..."; sleep 5;
|
|
done
|
|
for ns in prod-atlantis staging-atlantis beta-atlantis; do
|
|
echo "ensuring namespace ${ns}";
|
|
temporal operator namespace create --namespace "${ns}" --retention 30d \
|
|
|| echo "namespace ${ns} already exists";
|
|
done
|
|
temporal operator namespace list
|