28 lines
603 B
Bash
Executable File
28 lines
603 B
Bash
Executable File
#!/bin/bash
|
|
|
|
NAMESPACE=mosquitto
|
|
|
|
kubectl create namespace $NAMESPACE \
|
|
--dry-run=client \
|
|
-o yaml | \
|
|
kubectl -f - apply
|
|
|
|
echo "Applying certificate ..."
|
|
kubectl apply -f certificate.yml -n $NAMESPACE
|
|
|
|
echo "Applyiny configuration ..."
|
|
./update-config.sh
|
|
|
|
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
|
|
|