Skip to content

Commit

Permalink
easy-secrets-gen: include secrets for nautobot sso
Browse files Browse the repository at this point in the history
  • Loading branch information
skrobul committed Mar 20, 2024
1 parent 3fef745 commit 1ca855d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions scripts/easy-secrets-gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ kubectl --namespace nautobot \
--from-literal=redis-password="$(./scripts/pwgen.sh)" \
> secret-nautobot-redis.yaml

NAUTOBOT_SSO_SECRET=$(./scripts/pwgen.sh)
for ns in nautobot dex; do
kubectl --namespace $ns \
create secret generic nautobot-sso \
--dry-run=client \
-o yaml \
--type Opaque \
--from-literal=client-secret="$NAUTOBOT_SSO_SECRET" \
> secret-nautobot-sso-$ns.yaml
done
unset NAUTOBOT_SSO_SECRET

kubectl --namespace openstack \
create secret generic keystone-rabbitmq-password \
--type Opaque \
Expand Down Expand Up @@ -105,6 +117,15 @@ for skrt in $(find . -maxdepth 1 -name "secret-keystone*.yaml" -o -name "secret-
-w "${encskrt}"
done

for ns in nautobot dex; do
kubeseal \
--scope cluster-wide \
--allow-empty-data \
-o yaml \
-f secret-nautobot-sso-$ns.yaml \
-w components/01-secrets/encrypted-nautobot-sso-$ns.yaml
done

cd components/01-secrets/
rm -f kustomization.yaml
kustomize create --autodetect
Expand Down

0 comments on commit 1ca855d

Please sign in to comment.