initial
This commit is contained in:
31
deploy.sh
Executable file
31
deploy.sh
Executable 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
|
||||
|
||||
Reference in New Issue
Block a user