ci-demo: add flux image automation

This commit is contained in:
Brad Stein 2025-12-17 19:18:29 -03:00
parent 0a42289516
commit daa354e2cd
9 changed files with 136 additions and 1 deletions

View File

@ -0,0 +1,27 @@
# clusters/atlas/flux-system/applications/ci-demo/image-automation.yaml
apiVersion: image.toolkit.fluxcd.io/v1beta2
kind: ImageUpdateAutomation
metadata:
name: ci-demo
namespace: flux-system
spec:
interval: 1m0s
sourceRef:
kind: GitRepository
name: flux-system
namespace: flux-system
git:
checkout:
ref:
branch: feature/ci-gitops
commit:
author:
email: ops@bstein.dev
name: flux-bot
messageTemplate: "chore(ci-demo): update image to {{range .Updated.Images}}{{.}}{{end}}"
push:
branch: feature/ci-gitops
update:
strategy: Setters
path: ./services/ci-demo

View File

@ -0,0 +1,19 @@
# clusters/atlas/flux-system/applications/ci-demo/kustomization.yaml
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: ci-demo
namespace: flux-system
spec:
interval: 10m
path: ./services/ci-demo
prune: true
sourceRef:
kind: GitRepository
name: flux-system
namespace: flux-system
targetNamespace: ci-demo
dependsOn:
- name: core
wait: false

View File

@ -18,3 +18,5 @@ resources:
- oauth2-proxy/kustomization.yaml
- mailu/kustomization.yaml
- jenkins/kustomization.yaml
- ci-demo/kustomization.yaml
- ci-demo/image-automation.yaml

View File

@ -371,7 +371,7 @@ function xmrwallet_bootstrap --description "Interactive setup of monero-wallet-r
echo "Skipping daemon probe due to xmrwallet_SKIP_DAEMON_CHECK=1"
end
# Use your private image by default (in Zot)
# Use your private image by default (in Harbor)
read -P "Container image for wallet RPC [registry.bstein.dev/crypto/monero-wallet-rpc:0.18.4.1]: " image
if test -z "$image"; set image registry.bstein.dev/crypto/monero-wallet-rpc:0.18.4.1; end
_require "Container image" $image; or return 1

View File

@ -0,0 +1,31 @@
# services/ci-demo/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: ci-demo
namespace: ci-demo
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: ci-demo
template:
metadata:
labels:
app.kubernetes.io/name: ci-demo
spec:
nodeSelector:
hardware: rpi4
containers:
- name: ci-demo
image: registry.bstein.dev/infra/ci-demo:latest
ports:
- name: http
containerPort: 8080
readinessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 2
periodSeconds: 5

View File

@ -0,0 +1,25 @@
# services/ci-demo/image.yaml
apiVersion: image.toolkit.fluxcd.io/v1beta2
kind: ImageRepository
metadata:
name: ci-demo
namespace: ci-demo
spec:
image: registry.bstein.dev/infra/ci-demo
interval: 1m0s
---
apiVersion: image.toolkit.fluxcd.io/v1beta2
kind: ImagePolicy
metadata:
name: ci-demo
namespace: ci-demo
spec:
imageRepositoryRef:
name: ci-demo
filterTags:
pattern: '^v(?P<version>0\\.0\\.0-\\d+)$'
extract: '$version'
policy:
semver:
range: ">=0.0.0-0"

View File

@ -0,0 +1,11 @@
# services/ci-demo/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- image.yaml
- deployment.yaml
- service.yaml
images:
- name: registry.bstein.dev/infra/ci-demo
newTag: v0.0.0-0 # {"$imagepolicy": "ci-demo:ci-demo:tag"}

View File

@ -0,0 +1,6 @@
# services/ci-demo/namespace.yaml
apiVersion: v1
kind: Namespace
metadata:
name: ci-demo

View File

@ -0,0 +1,14 @@
# services/ci-demo/service.yaml
apiVersion: v1
kind: Service
metadata:
name: ci-demo
namespace: ci-demo
spec:
selector:
app.kubernetes.io/name: ci-demo
ports:
- name: http
port: 80
targetPort: http