flux: add image update automation

This commit is contained in:
Márcio Fernandes
2026-06-06 00:56:37 +00:00
parent 32a5849d3d
commit dc6cdb1686
9 changed files with 61 additions and 18 deletions
+5 -14
View File
@@ -2,19 +2,10 @@
Currently hosted on [kubernetes cluster - casa](https://git.limbosolutions.com/myLimbo/casa). Currently hosted on [kubernetes cluster - casa](https://git.limbosolutions.com/myLimbo/casa).
## Namespace ## Setup and Deploy
```bash { cwd=../ terminalRows=15 } Using flux for reconciliation.
kubectl create namespace mosquitto
``` bash
./ops-scripts/apply-flux.sh
``` ```
## Deploy
- [deployment](./deploy/cicd-rbac.yaml)
- [cicd-rbac](./deploy/cicd-rbac.yaml)
## Continuous Deploy
Weekly cron update.
[Gitea Workflow](./.gitea/workflows/%20deploy.yml)
+13
View File
@@ -0,0 +1,13 @@
apiVersion: image.toolkit.fluxcd.io/v1
kind: ImagePolicy
metadata:
name: eclipse-mosquitto
spec:
imageRepositoryRef:
name: eclipse-mosquitto
filterTags:
pattern: '^latest$'
policy:
alphabetical: {}
digestReflectionPolicy: Always
interval: 24h
+7
View File
@@ -0,0 +1,7 @@
apiVersion: image.toolkit.fluxcd.io/v1
kind: ImageRepository
metadata:
name: eclipse-mosquitto
spec:
image: eclipse-mosquitto
interval: 72h
+24
View File
@@ -0,0 +1,24 @@
apiVersion: image.toolkit.fluxcd.io/v1
kind: ImageUpdateAutomation
metadata:
name: lms
spec:
interval: 30m
sourceRef:
kind: GitRepository
name: mosquitto
git:
checkout:
ref:
branch: master
commit:
author:
name: FluxCD
email: flux@local
messageTemplate: |
Update mosquitto image.
push:
branch: master
update:
path: ./deploy/app/statefulset.yaml
strategy: Setters
+3
View File
@@ -5,3 +5,6 @@ resources:
- statefulset.yaml - statefulset.yaml
- pvc.yaml - pvc.yaml
- secret.yaml - secret.yaml
- image-policy.yaml
- image-repo.yaml
- image-update-automation.yaml
+3 -1
View File
@@ -19,7 +19,9 @@ spec:
hostNetwork: true hostNetwork: true
containers: containers:
- name: mosquitto - name: mosquitto
image: eclipse-mosquitto:latest ### Maintained by flux - Image Update Automation
image: eclipse-mosquitto:latest # {"$imagepolicy": "mqtt:eclipse-mosquitto"}
###
imagePullPolicy: Always imagePullPolicy: Always
command: ["/usr/sbin/mosquitto"] command: ["/usr/sbin/mosquitto"]
args: ["-c", "/etc/mosquitto/mosquitto.conf"] args: ["-c", "/etc/mosquitto/mosquitto.conf"]
+1 -1
View File
@@ -6,7 +6,7 @@ spec:
interval: 1m interval: 1m
sourceRef: sourceRef:
kind: GitRepository kind: GitRepository
name: lms name: mosquitto
path: deploy/app path: deploy/app
prune: true prune: true
+2 -2
View File
@@ -5,13 +5,13 @@ resources:
- app-sync.yaml - app-sync.yaml
secretGenerator: secretGenerator:
- name: flux-repo-ssh-credentials - name: flux-repo-ssh-credentials
namespace: lyrionmusicserver namespace: mqtt
files: files:
- "identity=./.env.d/flux-repo-ssh-key" - "identity=./.env.d/flux-repo-ssh-key"
- "known_hosts=./.env.d/flux-repo-ssh-known_hosts" - "known_hosts=./.env.d/flux-repo-ssh-known_hosts"
- "pubkey=./.env.d/flux-repo-ssh-key.pub" - "pubkey=./.env.d/flux-repo-ssh-key.pub"
- name: flux-sops-age - name: flux-sops-age
namespace: lyrionmusicserver namespace: mqtt
files: files:
- "age.agekey=./.env.d/age.agekey" - "age.agekey=./.env.d/age.agekey"
generatorOptions: generatorOptions:
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
set -e
kubectl kustomize deploy/flux | kubectl apply -f -