commit 34a521c925a93390f7452c3428c1cade84223f08 Author: Radar231 Date: Fri Jul 23 15:58:33 2021 -0400 initial checkin diff --git a/configs/mqtt-config/mosquitto.conf b/configs/mqtt-config/mosquitto.conf new file mode 100644 index 0000000..dcfacaa --- /dev/null +++ b/configs/mqtt-config/mosquitto.conf @@ -0,0 +1,5 @@ +persistence true +persistence_location /mosquitto/data/ +log_dest file /mosquitto/log/mosquitto.log +password_file /mosquitto/config/passwdfile +listener 1883 0.0.0.0 diff --git a/mosquitto_deployment.yml b/mosquitto_deployment.yml new file mode 100644 index 0000000..abe2979 --- /dev/null +++ b/mosquitto_deployment.yml @@ -0,0 +1,60 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mosquitto + labels: + app: mosquitto +spec: + replicas: 1 + selector: + matchLabels: + app: mosquitto + strategy: + type: Recreate + template: + metadata: + labels: + app: mosquitto + spec: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: beta.kubernetes.io/arch + operator: In + values: + - arm64 + containers: + - name: mosquitto + image: eclipse-mosquitto:latest + env: + - name: TZ + value: "EST5EDT" + - name: PUID + value: "65534" + - name: PgID + value: "65534" + ports: + - containerPort: 1883 + - containerPort: 9001 + volumeMounts: + - name : mqtt-data + mountPath: /mosquitto/data + - name : mqtt-log + mountPath: /mosquitto/log + - name: mqtt-config + mountPath: /mosquitto/config + volumes: + - name: mqtt-data + persistentVolumeClaim: + claimName: mqtt-data-pvc + - name: mqtt-log + persistentVolumeClaim: + claimName: mqtt-log-pvc + - name: mqtt-config + persistentVolumeClaim: + claimName: mqtt-config-pvc + +# EOF diff --git a/mosquitto_metallb.yml b/mosquitto_metallb.yml new file mode 100644 index 0000000..1f30f39 --- /dev/null +++ b/mosquitto_metallb.yml @@ -0,0 +1,21 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: mosquitto + annotations: + metallb.universe.tf/allow-shared-ip: share222 +spec: + selector: + app: mosquitto + type: LoadBalancer + # loadBalancerIP is optional. MetalLB will automatically allocate an IP + # from its pool if not specified. You can also specify one manually. + # loadBalancerIP: x.y.z.a + loadBalancerIP: 192.168.7.222 + ports: + - name: port1883 + protocol: TCP + port: 1883 + +# EOF diff --git a/mosquitto_pv.yml b/mosquitto_pv.yml new file mode 100644 index 0000000..225c55d --- /dev/null +++ b/mosquitto_pv.yml @@ -0,0 +1,61 @@ +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: mqtt-data-pv + labels: + name: mqtt-data-pv +spec: + storageClassName: manual + capacity: + storage: 5Gi + accessModes: + - ReadWriteOnce + mountOptions: + - hard + - nfsvers=4.0 + nfs: + server: 192.168.7.11 + path: "/volume1/k8s-storage/mqtt-data" + +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: mqtt-log-pv + labels: + name: mqtt-log-pv +spec: + storageClassName: manual + capacity: + storage: 5Gi + accessModes: + - ReadWriteOnce + mountOptions: + - hard + - nfsvers=4.0 + nfs: + server: 192.168.7.11 + path: "/volume1/k8s-storage/mqtt-log" + +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: mqtt-config-pv + labels: + name: mqtt-config-pv +spec: + storageClassName: manual + capacity: + storage: 5Gi + accessModes: + - ReadWriteOnce + mountOptions: + - hard + - nfsvers=4.0 + nfs: + server: 192.168.7.11 + path: "/volume1/k8s-storage/mqtt-config" + +# EOF diff --git a/mosquitto_pvc.yml b/mosquitto_pvc.yml new file mode 100644 index 0000000..65bbf5f --- /dev/null +++ b/mosquitto_pvc.yml @@ -0,0 +1,54 @@ +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: mqtt-data-pvc + labels: + app: mosquitto +spec: + accessModes: + - ReadWriteOnce + storageClassName: "manual" + resources: + requests: + storage: 5Gi + selector: + matchLabels: + name: mqtt-data-pv + +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: mqtt-log-pvc + labels: + app: mosquitto +spec: + accessModes: + - ReadWriteOnce + storageClassName: "manual" + resources: + requests: + storage: 5Gi + selector: + matchLabels: + name: mqtt-log-pv +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: mqtt-config-pvc + labels: + app: mosquitto +spec: + accessModes: + - ReadWriteOnce + storageClassName: "manual" + resources: + requests: + storage: 5Gi + selector: + matchLabels: + name: mqtt-config-pv + +# EOF diff --git a/mosquitto_svclb.yml b/mosquitto_svclb.yml new file mode 100644 index 0000000..6537fe3 --- /dev/null +++ b/mosquitto_svclb.yml @@ -0,0 +1,15 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: mosquitto +spec: + selector: + app: mosquitto + ports: + - protocol: TCP + port: 1883 + targetPort: 1883 + type: LoadBalancer + +# EOF