fluxcd: zigbee2mqtt
This commit is contained in:
@@ -1,57 +0,0 @@
|
|||||||
name: Deploy Casa services CI/CD Pipeline
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- fix/*
|
|
||||||
- main
|
|
||||||
- master
|
|
||||||
paths:
|
|
||||||
- 'services/**'
|
|
||||||
- '.gitea/workflows/casa-services**'
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- 'services/**'
|
|
||||||
- '.gitea/workflows/casa-services**'
|
|
||||||
schedule:
|
|
||||||
- cron: '0 15 * * 0' # every sunday 3 pm
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
runs-on: ["casa-vlan-cicd", "kubectl", "helm", "deploy"]
|
|
||||||
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 zigbee2mqtt
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
kubectl apply -f ./services/zigbee2mqtt/deploy/zigbee2mqtt-deploy.yaml
|
|
||||||
|
|
||||||
- name: Deploy wyoming
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
kubectl apply -f ./services/wyoming/deploy/wyoming-deploy.yaml
|
|
||||||
|
|
||||||
# - name: Deploy node-red
|
|
||||||
# shell: bash
|
|
||||||
# run: |
|
|
||||||
# ./services/node-red/ops-scripts/apply-app.sh
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
name: Monitoring services CI/CD Pipeline
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- fix/*
|
|
||||||
- main
|
|
||||||
- master
|
|
||||||
paths:
|
|
||||||
- 'monitoring/**'
|
|
||||||
- '.gitea/workflows/monitoring**'
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- 'monitoring/**'
|
|
||||||
- '.gitea/workflows/monitoring**'
|
|
||||||
schedule:
|
|
||||||
- cron: '0 12 * * 0' # every sunday 12 am
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
runs-on: ["casa-vlan-cicd", "kubectl", "helm", "deploy"]
|
|
||||||
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 }}
|
|
||||||
|
|
||||||
# secrets.LOKI_URL = https://<LOKISERVER>/loki/api/v1/push
|
|
||||||
- name: Deploy promtail
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
LOKI_URL: "${{ secrets.LOKI_URL }}"
|
|
||||||
run: |
|
|
||||||
# add repo
|
|
||||||
helm repo add grafana https://grafana.github.io/helm-charts
|
|
||||||
# Install & Upgrade
|
|
||||||
helm upgrade --install promtail grafana/promtail --namespace monitoring \
|
|
||||||
--values=./monitoring/promtail/values.yaml --set config.clients[0].url=${LOKI_URL}
|
|
||||||
|
|
||||||
# - name: Deploy Telegraf
|
|
||||||
# shell: bash
|
|
||||||
# run: |
|
|
||||||
# # add repo
|
|
||||||
# helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
|
|
||||||
# # Install & Upgrade
|
|
||||||
# helm upgrade --install prometheus-stack prometheus-community/kube-prometheus-stack \
|
|
||||||
# --namespace monitoring \
|
|
||||||
# --values=./monitoring/prometheus/deploy/helm/01-only-crd-and-operator.yaml \
|
|
||||||
# --values=./monitoring/prometheus/deploy//helm/02-kube-metrics.yaml \
|
|
||||||
# --values=./monitoring/prometheus/deploy/helm/03-node-exporter.yaml \
|
|
||||||
# --values=./monitoring/prometheus/deploy/helm/04-kubelet.yaml
|
|
||||||
# kubectl apply -f ./monitoring/prometheus/deploy/prometheus-agent.yaml
|
|
||||||
|
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
apiVersion: image.toolkit.fluxcd.io/v1
|
||||||
|
kind: ImagePolicy
|
||||||
|
metadata:
|
||||||
|
name: zigbee2mqtt
|
||||||
|
spec:
|
||||||
|
imageRepositoryRef:
|
||||||
|
name: zigbee2mqtt
|
||||||
|
filterTags:
|
||||||
|
pattern: '^latest$'
|
||||||
|
policy:
|
||||||
|
alphabetical: {}
|
||||||
|
digestReflectionPolicy: Always
|
||||||
|
interval: 24h
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: image.toolkit.fluxcd.io/v1
|
||||||
|
kind: ImageRepository
|
||||||
|
metadata:
|
||||||
|
name: zigbee2mqtt
|
||||||
|
spec:
|
||||||
|
image: koenkk/zigbee2mqtt
|
||||||
|
interval: 72h
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
apiVersion: image.toolkit.fluxcd.io/v1
|
||||||
|
kind: ImageUpdateAutomation
|
||||||
|
metadata:
|
||||||
|
name: zigbee2mqtt
|
||||||
|
spec:
|
||||||
|
interval: 72h
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: casa
|
||||||
|
namespace: casa-limbosolutions-com
|
||||||
|
git:
|
||||||
|
checkout:
|
||||||
|
ref:
|
||||||
|
branch: main
|
||||||
|
commit:
|
||||||
|
author:
|
||||||
|
name: FluxCD
|
||||||
|
email: flux@local
|
||||||
|
messageTemplate: |
|
||||||
|
Update zigbee2mqtt image.
|
||||||
|
push:
|
||||||
|
branch: main
|
||||||
|
update:
|
||||||
|
path: ./services/zigbee2mqtt/deploy/app/statefulset.yaml
|
||||||
|
strategy: Setters
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
namespace: mqtt
|
||||||
|
resources:
|
||||||
|
- pvc.yaml
|
||||||
|
- statefulset.yaml
|
||||||
|
- image-policy.yaml
|
||||||
|
- image-repo.yaml
|
||||||
|
- image-update-automation.yaml
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: zigbee2mqtt-data
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
||||||
|
storageClassName: local-path
|
||||||
+4
-16
@@ -1,23 +1,8 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: PersistentVolumeClaim
|
|
||||||
metadata:
|
|
||||||
name: zigbee2mqtt-data
|
|
||||||
namespace: mqtt
|
|
||||||
spec:
|
|
||||||
accessModes:
|
|
||||||
- ReadWriteOnce
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
storage: 1Gi
|
|
||||||
storageClassName: local-path
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: StatefulSet
|
kind: StatefulSet
|
||||||
metadata:
|
metadata:
|
||||||
name: zigbee2mqtt
|
name: zigbee2mqtt
|
||||||
namespace: mqtt
|
|
||||||
labels:
|
labels:
|
||||||
app: zigbee2mqtt
|
app: zigbee2mqtt
|
||||||
spec:
|
spec:
|
||||||
@@ -35,7 +20,10 @@ spec:
|
|||||||
- name: zigbee2mqtt
|
- name: zigbee2mqtt
|
||||||
securityContext:
|
securityContext:
|
||||||
privileged: true
|
privileged: true
|
||||||
image: koenkk/zigbee2mqtt
|
### Maintained by flux - Image Update Automation
|
||||||
|
image: koenkk/zigbee2mqtt # {"$imagepolicy": "mqtt:zigbee2mqtt"}
|
||||||
|
###
|
||||||
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: zigbee2mqtt-data
|
- name: zigbee2mqtt-data
|
||||||
mountPath: /app/data
|
mountPath: /app/data
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: zigbee2mqtt
|
||||||
|
spec:
|
||||||
|
interval: 1m
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: casa
|
||||||
|
namespace: casa-limbosolutions-com
|
||||||
|
path: deploy/app
|
||||||
|
prune: true
|
||||||
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
namespace: mqtt
|
||||||
|
resources:
|
||||||
|
- app-sync.yaml
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
kubectl kustomize deploy/flux | kubectl apply -f -
|
||||||
Reference in New Issue
Block a user