24 lines
536 B
Bash
Executable File
24 lines
536 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -ex
|
|
|
|
NAMESPACE=mosquitto
|
|
|
|
SECRETS_PLAINTEXT=$(mktemp)
|
|
gpg --pinentry-mode=loopback --decrypt --output $SECRETS_PLAINTEXT secrets.asc
|
|
|
|
DHPARAM=$(mktemp)
|
|
openssl dhparam -out $DHPARAM 2048
|
|
|
|
kubectl create configmap mosquitto-broker-config \
|
|
--from-file=mosquitto.conf=mosquitto.conf \
|
|
--from-file=pwfile=$SECRETS_PLAINTEXT \
|
|
--from-file=aclfile=aclfile \
|
|
--from-file=dhparam.pem=$DHPARAM \
|
|
--namespace=$NAMESPACE \
|
|
--dry-run=client -o yaml | kubectl apply -f - -n $NAMESPACE
|
|
|
|
rm $SECRETS_PLAINTEXT
|
|
rm $DHPARAM
|
|
|