generated from onedr0p/cluster-template
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(kubernetes): install mosquitto MQTT broker #211
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
martinohmann
force-pushed
the
mosquitto
branch
from
January 9, 2024 20:06
c7a32c0
to
a18e90f
Compare
github-actions
bot
added
the
area/kubernetes
Changes made in the kubernetes directory
label
Jan 9, 2024
--- HelmRelease: default/mosquitto Service: default/mosquitto
+++ HelmRelease: default/mosquitto Service: default/mosquitto
@@ -0,0 +1,25 @@
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: mosquitto
+ labels:
+ app.kubernetes.io/instance: mosquitto
+ app.kubernetes.io/managed-by: Helm
+ app.kubernetes.io/name: mosquitto
+ app.kubernetes.io/service: mosquitto
+ annotations:
+ external-dns.alpha.kubernetes.io/hostname: mosquitto.18b.haus
+ io.cilium/lb-ipam-ips: 192.168.40.250
+spec:
+ type: LoadBalancer
+ ports:
+ - port: 1883
+ targetPort: 1883
+ protocol: TCP
+ name: http
+ selector:
+ app.kubernetes.io/component: main
+ app.kubernetes.io/instance: mosquitto
+ app.kubernetes.io/name: mosquitto
+
--- HelmRelease: default/mosquitto Deployment: default/mosquitto
+++ HelmRelease: default/mosquitto Deployment: default/mosquitto
@@ -0,0 +1,114 @@
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: mosquitto
+ labels:
+ app.kubernetes.io/component: main
+ app.kubernetes.io/instance: mosquitto
+ app.kubernetes.io/managed-by: Helm
+ app.kubernetes.io/name: mosquitto
+ annotations:
+ reloader.stakater.com/auto: 'true'
+spec:
+ revisionHistoryLimit: 3
+ replicas: 1
+ strategy:
+ type: Recreate
+ selector:
+ matchLabels:
+ app.kubernetes.io/component: main
+ app.kubernetes.io/name: mosquitto
+ app.kubernetes.io/instance: mosquitto
+ template:
+ metadata:
+ labels:
+ app.kubernetes.io/component: main
+ app.kubernetes.io/instance: mosquitto
+ app.kubernetes.io/name: mosquitto
+ spec:
+ enableServiceLinks: true
+ serviceAccountName: default
+ automountServiceAccountToken: true
+ securityContext:
+ fsGroup: 568
+ fsGroupChangePolicy: OnRootMismatch
+ runAsGroup: 568
+ runAsNonRoot: true
+ runAsUser: 568
+ hostIPC: false
+ hostNetwork: false
+ hostPID: false
+ dnsPolicy: ClusterFirst
+ initContainers:
+ - args:
+ - cp /tmp/secret/* /mosquitto/external_config/ && mosquitto_passwd -U /mosquitto/external_config/mosquitto_passwd
+ command:
+ - /bin/sh
+ - -c
+ image: docker.io/library/eclipse-mosquitto:2.0.18@sha256:8c49a0fab9a1ee9bf5d229061eec4e279f04484c07f60c85c13821788360ce4f
+ name: init-config
+ volumeMounts:
+ - mountPath: /data
+ name: config
+ - mountPath: /mosquitto/external_config
+ name: external-config
+ - mountPath: /tmp/secret
+ name: secret-file
+ containers:
+ - image: docker.io/library/eclipse-mosquitto:2.0.18@sha256:8c49a0fab9a1ee9bf5d229061eec4e279f04484c07f60c85c13821788360ce4f
+ livenessProbe:
+ failureThreshold: 3
+ initialDelaySeconds: 0
+ periodSeconds: 10
+ tcpSocket:
+ port: 1883
+ timeoutSeconds: 1
+ name: main
+ readinessProbe:
+ failureThreshold: 3
+ initialDelaySeconds: 0
+ periodSeconds: 10
+ tcpSocket:
+ port: 1883
+ timeoutSeconds: 1
+ resources:
+ limits:
+ memory: 20Mi
+ requests:
+ cpu: 10m
+ memory: 15Mi
+ securityContext:
+ allowPrivilegeEscalation: false
+ capabilities:
+ drop:
+ - ALL
+ readOnlyRootFilesystem: true
+ startupProbe:
+ failureThreshold: 30
+ initialDelaySeconds: 0
+ periodSeconds: 5
+ tcpSocket:
+ port: 1883
+ timeoutSeconds: 1
+ volumeMounts:
+ - mountPath: /data
+ name: config
+ - mountPath: /mosquitto/config/mosquitto.conf
+ name: config-file
+ subPath: mosquitto.conf
+ - mountPath: /mosquitto/external_config
+ name: external-config
+ volumes:
+ - name: config
+ persistentVolumeClaim:
+ claimName: mosquitto
+ - configMap:
+ name: mosquitto
+ name: config-file
+ - emptyDir: {}
+ name: external-config
+ - name: secret-file
+ secret:
+ secretName: mosquitto
+ |
--- kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/mosquitto
+++ kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/mosquitto
@@ -0,0 +1,34 @@
+---
+apiVersion: kustomize.toolkit.fluxcd.io/v1
+kind: Kustomization
+metadata:
+ labels:
+ kustomize.toolkit.fluxcd.io/name: cluster-apps
+ kustomize.toolkit.fluxcd.io/namespace: flux-system
+ name: mosquitto
+ namespace: flux-system
+spec:
+ commonMetadata:
+ labels:
+ app.kubernetes.io/name: mosquitto
+ decryption:
+ provider: sops
+ secretRef:
+ name: sops-age
+ interval: 30m
+ path: ./kubernetes/apps/default/mosquitto/app
+ postBuild:
+ substituteFrom:
+ - kind: ConfigMap
+ name: cluster-settings
+ - kind: Secret
+ name: cluster-secrets
+ prune: true
+ retryInterval: 1m
+ sourceRef:
+ kind: GitRepository
+ name: home-kubernetes
+ targetNamespace: default
+ timeout: 5m
+ wait: false
+
--- kubernetes/apps/default/mosquitto/app Kustomization: flux-system/mosquitto PersistentVolumeClaim: default/mosquitto
+++ kubernetes/apps/default/mosquitto/app Kustomization: flux-system/mosquitto PersistentVolumeClaim: default/mosquitto
@@ -0,0 +1,18 @@
+---
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+ labels:
+ app.kubernetes.io/name: mosquitto
+ kustomize.toolkit.fluxcd.io/name: mosquitto
+ kustomize.toolkit.fluxcd.io/namespace: flux-system
+ name: mosquitto
+ namespace: default
+spec:
+ accessModes:
+ - ReadWriteMany
+ resources:
+ requests:
+ storage: 200Mi
+ storageClassName: longhorn
+
--- kubernetes/apps/default/mosquitto/app Kustomization: flux-system/mosquitto HelmRelease: default/mosquitto
+++ kubernetes/apps/default/mosquitto/app Kustomization: flux-system/mosquitto HelmRelease: default/mosquitto
@@ -0,0 +1,107 @@
+---
+apiVersion: helm.toolkit.fluxcd.io/v2beta2
+kind: HelmRelease
+metadata:
+ labels:
+ app.kubernetes.io/name: mosquitto
+ kustomize.toolkit.fluxcd.io/name: mosquitto
+ kustomize.toolkit.fluxcd.io/namespace: flux-system
+ name: mosquitto
+ namespace: default
+spec:
+ chart:
+ spec:
+ chart: app-template
+ sourceRef:
+ kind: HelmRepository
+ name: bjw-s
+ namespace: flux-system
+ version: 2.4.0
+ dependsOn:
+ - name: longhorn
+ namespace: longhorn-system
+ install:
+ remediation:
+ retries: 3
+ interval: 30m
+ uninstall:
+ keepHistory: false
+ upgrade:
+ cleanupOnFail: true
+ remediation:
+ retries: 3
+ values:
+ controllers:
+ main:
+ annotations:
+ reloader.stakater.com/auto: 'true'
+ containers:
+ main:
+ image:
+ repository: docker.io/library/eclipse-mosquitto
+ tag: 2.0.18@sha256:8c49a0fab9a1ee9bf5d229061eec4e279f04484c07f60c85c13821788360ce4f
+ resources:
+ limits:
+ memory: 20Mi
+ requests:
+ cpu: 10m
+ memory: 15Mi
+ securityContext:
+ allowPrivilegeEscalation: false
+ capabilities:
+ drop:
+ - ALL
+ readOnlyRootFilesystem: true
+ initContainers:
+ init-config:
+ args:
+ - cp /tmp/secret/* /mosquitto/external_config/ && mosquitto_passwd -U
+ /mosquitto/external_config/mosquitto_passwd
+ command:
+ - /bin/sh
+ - -c
+ image:
+ repository: docker.io/library/eclipse-mosquitto
+ tag: 2.0.18@sha256:8c49a0fab9a1ee9bf5d229061eec4e279f04484c07f60c85c13821788360ce4f
+ pod:
+ securityContext:
+ fsGroup: 568
+ fsGroupChangePolicy: OnRootMismatch
+ runAsGroup: 568
+ runAsNonRoot: true
+ runAsUser: 568
+ persistence:
+ config:
+ enabled: true
+ existingClaim: mosquitto
+ globalMounts:
+ - path: /data
+ config-file:
+ advancedMounts:
+ main:
+ main:
+ - path: /mosquitto/config/mosquitto.conf
+ subPath: mosquitto.conf
+ name: mosquitto
+ type: configMap
+ external-config:
+ globalMounts:
+ - path: /mosquitto/external_config
+ type: emptyDir
+ secret-file:
+ advancedMounts:
+ main:
+ init-config:
+ - path: /tmp/secret
+ name: mosquitto
+ type: secret
+ service:
+ main:
+ annotations:
+ external-dns.alpha.kubernetes.io/hostname: mosquitto.18b.haus
+ io.cilium/lb-ipam-ips: 192.168.40.250
+ ports:
+ http:
+ port: 1883
+ type: LoadBalancer
+
--- kubernetes/apps/default/mosquitto/app Kustomization: flux-system/mosquitto ConfigMap: default/mosquitto
+++ kubernetes/apps/default/mosquitto/app Kustomization: flux-system/mosquitto ConfigMap: default/mosquitto
@@ -0,0 +1,24 @@
+---
+apiVersion: v1
+data:
+ mosquitto.conf: |
+ per_listener_settings false
+ listener 1883
+ allow_anonymous false
+ persistence true
+ persistence_location /data
+ autosave_interval 1800
+ connection_messages false
+ autosave_interval 60
+ password_file /mosquitto/external_config/mosquitto_passwd
+kind: ConfigMap
+metadata:
+ annotations:
+ kustomize.toolkit.fluxcd.io/substitute: disabled
+ labels:
+ app.kubernetes.io/name: mosquitto
+ kustomize.toolkit.fluxcd.io/name: mosquitto
+ kustomize.toolkit.fluxcd.io/namespace: flux-system
+ name: mosquitto
+ namespace: default
+ |
martinohmann
force-pushed
the
mosquitto
branch
from
January 9, 2024 20:07
a18e90f
to
8e24860
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.