Skip to content
Snippets Groups Projects
Commit a61327b5 authored by Julien Leduc's avatar Julien Leduc
Browse files

Copying ctaregsecret to the new namespace as secrets are only visible in

their namespace.
According to
https://kubernetes.io/docs/concepts/configuration/secret/#creating-a-secret-using-kubectl-create-secret:
```
Secret API objects reside in a namespace. They can only be referenced by
pods in that same namespace.
```
parent f42f9411
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
# CTA registry secret name
ctareg_secret='ctaregsecret'
# defaults objectstore to file
config_objectstore="./objectstore-file.yaml"
# defaults DB to sqlite
......@@ -142,6 +145,13 @@ echo -n "Creating ${instance} instance "
kubectl create namespace ${instance} || die "FAILED"
# The CTA registry secret must be copied in the instance namespace to be usable
kubectl get secret ${ctareg_secret} &> /dev/null
if [ $? -eq 0 ]; then
echo "Copying ${ctareg_secret} secret in ${instance} namespace"
kubectl get secret ctaregsecret -o yaml | grep -v '^ *namespace:' | kubectl --namespace ${instance} create -f -
fi
kubectl --namespace ${instance} create configmap init --from-literal=keepdatabase=${keepdatabase} --from-literal=keepobjectstore=${keepobjectstore}
kubectl --namespace ${instance} create configmap buildtree --from-literal=base=${buildtree} --from-literal=subdir=${buildtreesubdir}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment