commit 886cc8e34ba85d01227d8c303f21251bce2c281e Author: Wolfgang Hottgenroth Date: Mon Feb 16 23:26:28 2026 +0100 initial diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..1611e06 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +NAMESPACE=cacti + +kubectl create namespace $NAMESPACE \ + --dry-run=client \ + -o yaml | \ + kubectl -f - apply + +kubectl create secret generic mariadb-secrets \ + --dry-run=client \ + -o yaml \ + --save-config \ + --from-literal=MARIADB_USER=cacti \ + --from-literal=MARIADB_DATABASE=cacti \ + --from-literal=MARIADB_PASSWORD=test123 \ + --from-literal=MARIADB_ROOT_PASSWORD=test1234 | \ +kubectl apply -n $NAMESPACE -f - + + +kubectl apply -f mariadb.yml -n $NAMESPACE + diff --git a/mariadb.yml b/mariadb.yml new file mode 100644 index 0000000..91e8d00 --- /dev/null +++ b/mariadb.yml @@ -0,0 +1,67 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: mariadb-data +spec: + accessModes: + - ReadWriteOnce + storageClassName: nfs-client + resources: + requests: + storage: 500Mi +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mariadb +spec: + replicas: 1 + selector: + matchLabels: + app: mariadb + template: + metadata: + labels: + app: mariadb + spec: + containers: + - name: mariadb + image: mariadb:10.2 + ports: + - name: mariadb + containerPort: 3306 + protocol: TCP + readinessProbe: + tcpSocket: + port: 3306 + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 3 + volumeMounts: + - name: mariadb-data + mountPath: /var/lib/mysql + readOnly: true + envFrom: + - secretRef: + name: mariadb-secrets + volumes: + - name: mariadb-data + persistentVolumeClaim: + claimName: mariadb-data +--- +apiVersion: v1 +kind: Service +metadata: + name: mariadb +spec: + type: ClusterIP + selector: + app: mariadb + ports: + - name: mariadb + port: 3306 + targetPort: 3306 + protocol: TCP +