flux: add image update automation
This commit is contained in:
@@ -2,19 +2,10 @@
|
||||
|
||||
Currently hosted on [kubernetes cluster - casa](https://git.limbosolutions.com/myLimbo/casa).
|
||||
|
||||
## Namespace
|
||||
## Setup and Deploy
|
||||
|
||||
```bash { cwd=../ terminalRows=15 }
|
||||
kubectl create namespace mosquitto
|
||||
Using flux for reconciliation.
|
||||
|
||||
``` 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)
|
||||
|
||||
@@ -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
|
||||
@@ -0,0 +1,7 @@
|
||||
apiVersion: image.toolkit.fluxcd.io/v1
|
||||
kind: ImageRepository
|
||||
metadata:
|
||||
name: eclipse-mosquitto
|
||||
spec:
|
||||
image: eclipse-mosquitto
|
||||
interval: 72h
|
||||
@@ -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
|
||||
@@ -5,3 +5,6 @@ resources:
|
||||
- statefulset.yaml
|
||||
- pvc.yaml
|
||||
- secret.yaml
|
||||
- image-policy.yaml
|
||||
- image-repo.yaml
|
||||
- image-update-automation.yaml
|
||||
@@ -19,7 +19,9 @@ spec:
|
||||
hostNetwork: true
|
||||
containers:
|
||||
- name: mosquitto
|
||||
image: eclipse-mosquitto:latest
|
||||
### Maintained by flux - Image Update Automation
|
||||
image: eclipse-mosquitto:latest # {"$imagepolicy": "mqtt:eclipse-mosquitto"}
|
||||
###
|
||||
imagePullPolicy: Always
|
||||
command: ["/usr/sbin/mosquitto"]
|
||||
args: ["-c", "/etc/mosquitto/mosquitto.conf"]
|
||||
|
||||
@@ -6,7 +6,7 @@ spec:
|
||||
interval: 1m
|
||||
sourceRef:
|
||||
kind: GitRepository
|
||||
name: lms
|
||||
name: mosquitto
|
||||
path: deploy/app
|
||||
prune: true
|
||||
|
||||
@@ -5,13 +5,13 @@ resources:
|
||||
- app-sync.yaml
|
||||
secretGenerator:
|
||||
- name: flux-repo-ssh-credentials
|
||||
namespace: lyrionmusicserver
|
||||
namespace: mqtt
|
||||
files:
|
||||
- "identity=./.env.d/flux-repo-ssh-key"
|
||||
- "known_hosts=./.env.d/flux-repo-ssh-known_hosts"
|
||||
- "pubkey=./.env.d/flux-repo-ssh-key.pub"
|
||||
- name: flux-sops-age
|
||||
namespace: lyrionmusicserver
|
||||
namespace: mqtt
|
||||
files:
|
||||
- "age.agekey=./.env.d/age.agekey"
|
||||
generatorOptions:
|
||||
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
kubectl kustomize deploy/flux | kubectl apply -f -
|
||||
Reference in New Issue
Block a user