Compare commits
97 Commits
83160162b6
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 255afea8be | |||
| 12fd3a599b | |||
| b950912f9d | |||
| 87461e3a02 | |||
| 31f0e0fe58 | |||
| 773384f57d | |||
| 4fa0cfa52e | |||
| ec151368ee | |||
| cc0e0fd91f | |||
| 365f71e604 | |||
| 799c4b9f67 | |||
| a3704c8138 | |||
| cb0166a123 | |||
| 830eeea6a6 | |||
| 6abd2b04cb | |||
| 1667f5e8a2 | |||
| 99055827a6 | |||
| afcfb04882 | |||
| 6d594242ba | |||
| 4d66b72ef6 | |||
| cf176d106c | |||
| 088b8172c3 | |||
| 1ee7d60348 | |||
| ac9c1acb14 | |||
| 474e9d6a3c | |||
| 2534a502d2 | |||
| 959a16ed81 | |||
| d60c086947 | |||
| 526f8eba89 | |||
| 2de0ea6e40 | |||
| 48e3108ce8 | |||
| 75b555a0d0 | |||
| 2e827cd28b | |||
| d72f4ad41e | |||
| c82e0e428c | |||
| ba5783bd20 | |||
| 2a12211a70 | |||
| 90144884a2 | |||
| 7ea40f82fa | |||
| b7c902c49b | |||
| 6f3437005e | |||
| d70b78186f | |||
| 0f59e1e651 | |||
| bd737a2951 | |||
| f8879e8037 | |||
| e2b19c9a42 | |||
| 2629823317 | |||
| 41bb81b8ba | |||
| aa767c2ca5 | |||
| a0d3839e10 | |||
| cdbb2ec631 | |||
| 1eb15bb31d | |||
| efd4be2cf0 | |||
| e0cb3f154b | |||
| 97a6a8e985 | |||
| 9a9eaedbe8 | |||
| f8c3bef977 | |||
| fb6a49770c | |||
| 8cf58e133b | |||
| 7c77b83737 | |||
| d79ed9076b | |||
| b6cc4f74de | |||
| 1e5500cd7c | |||
| e969a53839 | |||
| deb94cd06e | |||
| 8f794d054a | |||
| 8a3a5352de | |||
| e94253a4f6 | |||
| 727d9ee421 | |||
| 0740ed2912 | |||
| bf27e23022 | |||
| a3949eb57e | |||
| 6fe30e0d93 | |||
| 6d869259e1 | |||
| 8741ca6c8d | |||
| 63efbf37da | |||
| de1c21d928 | |||
| 0620240237 | |||
| d2001898f3 | |||
| d5b9bb989e | |||
| ba6c6fae94 | |||
| 04e8bcaeb6 | |||
| 6b344297fc | |||
| 49eee89916 | |||
| cb97c52e11 | |||
| b8098baf77 | |||
| 4cde38efd1 | |||
| 137ddc56a8 | |||
| 5b8b1350a3 | |||
| c4cc571ad4 | |||
| 5c3cf61c0f | |||
| 447f8b1b59 | |||
| 4b8822e4ea | |||
| bee6a5f74c | |||
| e8786b409e | |||
| 45156ff6c1 | |||
| 87ebdc5dfb |
42
.gitea/workflows/deploy.yml
Normal file
42
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
name: Mosquitto CI/CD Pipeline
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- fix/*
|
||||||
|
- main
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 15 * * 0' # every sunday 3 pm
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: casa-vlan-cicd
|
||||||
|
env:
|
||||||
|
GITHUB_TEMP: ${{ runner.temp }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Fetch limbo public actions
|
||||||
|
env:
|
||||||
|
RUNNER_TEMP: "${{ runner.temp }}"
|
||||||
|
WORKSPACE: "${{ gitea.workspace }}"
|
||||||
|
run: |
|
||||||
|
curl -fsSL https://git.limbosolutions.com/kb/gitea/raw/branch/main/cloud-scripts/setup-limbo-actions.sh | bash 2>&1
|
||||||
|
|
||||||
|
- name: Setup kubectl
|
||||||
|
uses: ./.gitea/limbo_actions/kubectl-setup
|
||||||
|
with:
|
||||||
|
kube_server: ${{ secrets.CASA_VLAN_KUBE_SERVER }}
|
||||||
|
kube_ca_base64: ${{ secrets.CASA_VLAN_KUBE_CA_BASE64 }}
|
||||||
|
kube_token: ${{ secrets.CASA_VLAN_KUBE_TOKEN }}
|
||||||
|
|
||||||
|
- name: Deploy Mosquitto
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
kubectl apply -f ./deploy/mosquitto-deploy.yaml
|
||||||
|
|
||||||
20
README.md
20
README.md
@@ -0,0 +1,20 @@
|
|||||||
|
# mosquitto
|
||||||
|
|
||||||
|
Currently hosted on [kubernetes cluster - casa](https://git.limbosolutions.com/myLimbo/casa).
|
||||||
|
|
||||||
|
## Namespace
|
||||||
|
|
||||||
|
```bash { cwd=../ terminalRows=15 }
|
||||||
|
kubectl create namespace mosquitto
|
||||||
|
```
|
||||||
|
|
||||||
|
## Deploy
|
||||||
|
|
||||||
|
- [deployment](./deploy/cicd-rbac.yaml)
|
||||||
|
- [cicd-rbac](./deploy/cicd-rbac.yaml)
|
||||||
|
|
||||||
|
## Continuous Deploy
|
||||||
|
|
||||||
|
Weekly cron update.
|
||||||
|
|
||||||
|
[Gitea Workflow](./.gitea/workflows/%20deploy.yml)
|
||||||
|
|||||||
32
deploy/cicd-rbac.yaml
Normal file
32
deploy/cicd-rbac.yaml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: Role
|
||||||
|
metadata:
|
||||||
|
namespace: mqtt
|
||||||
|
name: ci-cd
|
||||||
|
rules:
|
||||||
|
- apiGroups: [""]
|
||||||
|
resources: ["pods", "services", "secrets", "configmaps", "persistentvolumeclaims", "endpoints"]
|
||||||
|
verbs: ["get", "watch", "list", "create", "update", "patch", "delete"]
|
||||||
|
- apiGroups: ["apps"]
|
||||||
|
resources: ["deployments", "statefulsets"]
|
||||||
|
verbs: ["get", "watch", "list", "create", "update", "patch", "delete"]
|
||||||
|
- apiGroups: ["networking.k8s.io"]
|
||||||
|
resources: ["ingresses"]
|
||||||
|
verbs: ["get", "watch", "list", "create", "update", "patch", "delete"]
|
||||||
|
- apiGroups: ["traefik.io"]
|
||||||
|
resources: ["ingressroutes"]
|
||||||
|
verbs: ["get", "watch", "list", "create", "update", "patch", "delete"]
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: RoleBinding
|
||||||
|
metadata:
|
||||||
|
name: ci-cd
|
||||||
|
namespace: mqtt
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: casa-ci-cd
|
||||||
|
namespace: home-assistant
|
||||||
|
roleRef:
|
||||||
|
kind: Role
|
||||||
|
name: ci-cd
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
90
deploy/mosquitto-deploy.yaml
Normal file
90
deploy/mosquitto-deploy.yaml
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: mosquitto-data
|
||||||
|
namespace: mqtt
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
||||||
|
storageClassName: local-path
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: mosquitto
|
||||||
|
namespace: mqtt
|
||||||
|
type: Opaque
|
||||||
|
stringData:
|
||||||
|
config: |
|
||||||
|
listener 1883
|
||||||
|
allow_anonymous true
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: mosquitto
|
||||||
|
namespace: mqtt
|
||||||
|
labels:
|
||||||
|
app: mosquitto
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: mosquitto
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: mosquitto
|
||||||
|
spec:
|
||||||
|
hostNetwork: true
|
||||||
|
containers:
|
||||||
|
- name: mosquitto
|
||||||
|
image: eclipse-mosquitto:latest
|
||||||
|
imagePullPolicy: Always
|
||||||
|
command: ["/usr/sbin/mosquitto"]
|
||||||
|
args: ["-c", "/etc/mosquitto/mosquitto.conf"]
|
||||||
|
|
||||||
|
ports:
|
||||||
|
- containerPort: 8883 # Default MQTT port for encrypted communication using TLS/SSL
|
||||||
|
#hostPort: 8883
|
||||||
|
protocol: TCP
|
||||||
|
- containerPort: 1883 # Default MQTT port for unencrypted communication
|
||||||
|
protocol: TCP
|
||||||
|
#hostPort: 1883
|
||||||
|
|
||||||
|
volumeMounts:
|
||||||
|
- name: mosquitto-data
|
||||||
|
mountPath: /mosquitto-data
|
||||||
|
|
||||||
|
- mountPath: /etc/mosquitto/mosquitto.conf
|
||||||
|
name: mosquitto-secret
|
||||||
|
subPath: config
|
||||||
|
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
memory: "50Mi"
|
||||||
|
cpu: "100m"
|
||||||
|
limits:
|
||||||
|
memory: "100Mi"
|
||||||
|
cpu: "200m"
|
||||||
|
volumes:
|
||||||
|
|
||||||
|
- name: mosquitto-data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName : mosquitto-data
|
||||||
|
|
||||||
|
|
||||||
|
- name: mosquitto-secret
|
||||||
|
secret:
|
||||||
|
secretName: "mosquitto"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
|
|
||||||
version: "3"
|
|
||||||
services:
|
|
||||||
mosquitto:
|
|
||||||
container_name: mosquitto
|
|
||||||
image: eclipse-mosquitto:latest
|
|
||||||
ports:
|
|
||||||
- '1883:1883'
|
|
||||||
- '8883:8883'
|
|
||||||
volumes:
|
|
||||||
- 'data:/mosquitto/data/'
|
|
||||||
- 'config:/mosquitto/config/'
|
|
||||||
environment:
|
|
||||||
TZ: 'America/Chicago'
|
|
||||||
restart: unless-stopped
|
|
||||||
volumes:
|
|
||||||
data:
|
|
||||||
name: mosquitto_data
|
|
||||||
driver: local
|
|
||||||
driver_opts:
|
|
||||||
type: ${MOSQUITTO_VOLUME_DATA_TYPE}
|
|
||||||
o: ${MOSQUITTO_VOLUME_DATA_O}
|
|
||||||
device: "${MOSQUITTO_VOLUME_DATA_DEVICE}"
|
|
||||||
config:
|
|
||||||
name: mosquitto_config
|
|
||||||
driver: local
|
|
||||||
driver_opts:
|
|
||||||
type: ${MOSQUITTO_VOLUME_CONFIG_TYPE}
|
|
||||||
o: ${MOSQUITTO_VOLUME_CONFIG_O}
|
|
||||||
device: "${MOSQUITTO_VOLUME_CONFIG_DEVICE}"
|
|
||||||
Reference in New Issue
Block a user