initial
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
2025-02-10 12:37:46 +01:00
commit 9951c1ced5
9 changed files with 259 additions and 0 deletions

14
deployment/config.json Normal file
View File

@ -0,0 +1,14 @@
{
"mqtt": {
"broker": "mqtt://emqx01-anonymous-cluster-internal.broker.svc.cluster.local:1883",
"tlsEnable": "false",
"topic": "tsm"
},
"interval": 10,
"servers": [
{
"name": "172.16.13.10",
"label": "david"
}
]
}

View File

@ -0,0 +1,27 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: tsm-mqtt
namespace: homea
labels:
app: tsm-mqtt
annotations:
secret.reloader.stakater.com/reload: tsmsnmp-mqtt-conf
spec:
replicas: 1
selector:
matchLabels:
app: tsm-nmqtt
template:
metadata:
labels:
app: tsm-nmqtt
spec:
containers:
- name: tsm-nmqtt
image: %IMAGE%
envFrom:
- configMapRef:
name: tsm-mqtt-conf

34
deployment/deploy.sh Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash
if [ "$IMAGE_TAG" == "" ]; then
echo "Make sure IMAGE_TAG is set"
exit 1
fi
IMAGE_NAME=gitea.hottis.de/wn/timeserver-monitoring
NAMESPACE=homea
DEPLOYMENT_DIR=$PWD/deployment
CONFIG_FILE=config.json
pushd $DEPLOYMENT_DIR > /dev/null
kubectl create namespace $NAMESPACE \
--dry-run=client \
-o yaml | \
kubectl -f - apply
kubectl create configmap tsm-mqtt-conf \
--from-literal=TSM_MQTT_CONF="`cat $CONFIG_FILE`" \
--dry-run=client \
-o yaml \
--save-config | \
kubectl apply -f - -n $NAMESPACE
cat $DEPLOYMENT_DIR/deploy-yml.tmpl | \
sed -e 's,%IMAGE%,'$IMAGE_NAME':'$IMAGE_TAG','g | \
kubectl apply -f - -n $NAMESPACE
popd > /dev/null

4
deployment/pushconfig.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
kubectl create configmap tsm-mqtt-conf --from-literal=SNMP_MQTT_CONF="`cat config.json`" --dry-run=client -o yaml --save-config | kubectl apply -f - -n homea