This commit is contained in:
2026-01-29 10:38:43 +01:00
commit 14c7ad04fc
5 changed files with 194 additions and 0 deletions

31
deploy.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/bin/bash
NAMESPACE=mosquitto
kubectl create namespace $NAMESPACE \
--dry-run=client \
-o yaml | \
kubectl -f - apply
echo "Applying certificate ..."
kubectl apply -f $DEPLOYMENT_DIR/certificate.yml -n $NAMESPACE
echo "Applyiny configuration ..."
kubectl create configmap mosquitto-broker-config
--from-file=mosquitto.conf=mosquitto.conf
--from-file=pwfile=pwfile
--namespace=$NAMESPACE
--dry-run=client -o yaml | kubectl apply -f - -n $NAMESPACE
echo "Waiting for certificate secret to be created..."
kubectl wait --for=condition=Ready certificate/mosquitto-broker-cert -n $NAMESPACE --timeout=300s
if [ $? -ne 0 ]; then
echo "Certificate secret creation failed or timed out"
exit 1
fi
echo "Certificate ready, applying deployment ..."
kubectl apply -f deploy.yml -n $NAMESPACE