feat(kube-system): add downflate app for Talos image pre-pulling - #3350
feat(kube-system): add downflate app for Talos image pre-pulling#3350Tanguille wants to merge 2 commits into
Conversation
@@ (root level) @@
# kustomize.toolkit.fluxcd.io/v1/Kustomization/kube-system/downflate
! + one document added:
+ apiVersion: kustomize.toolkit.fluxcd.io/v1
+ kind: Kustomization
+ metadata:
+ name: downflate
+ namespace: kube-system
+ labels:
+ kustomize.toolkit.fluxcd.io/name: cluster-apps
+ kustomize.toolkit.fluxcd.io/namespace: flux-system
+ spec:
+ decryption:
+ provider: sops
+ secretRef:
+ name: sops-age
+ deletionPolicy: WaitForTermination
+ dependsOn:
+ - name: spegel
+ interval: 1h
+ patches:
+ - patch: |
+ apiVersion: helm.toolkit.fluxcd.io/v2
+ kind: HelmRelease
+ metadata:
+ name: _
+ spec:
+ install:
+ crds: CreateReplace
+ rollback:
+ cleanupOnFail: true
+ upgrade:
+ cleanupOnFail: true
+ crds: CreateReplace
+ strategy:
+ name: RemediateOnFailure
+ remediation:
+ remediateLastFailure: true
+ retries: 2
+ target:
+ kind: HelmRelease
+ group: helm.toolkit.fluxcd.io
+ path: ./kubernetes/apps/kube-system/downflate/app
+ postBuild:
+ substituteFrom:
+ - name: cluster-settings
+ kind: ConfigMap
+ optional: false
+ - name: cluster-secrets
+ kind: Secret
+ optional: false
+ prune: true
+ retryInterval: 2m
+ sourceRef:
+ name: flux-system
+ kind: GitRepository
+ namespace: flux-system
+ targetNamespace: kube-system
+ timeout: 5m
+ wait: false
@@ (root level) @@
# helm.toolkit.fluxcd.io/v2/HelmRelease/kube-system/downflate
! + one document added:
+ apiVersion: helm.toolkit.fluxcd.io/v2
+ kind: HelmRelease
+ metadata:
+ name: downflate
+ namespace: kube-system
+ labels:
+ kustomize.toolkit.fluxcd.io/name: downflate
+ kustomize.toolkit.fluxcd.io/namespace: kube-system
+ spec:
+ chartRef:
+ name: app-template
+ kind: OCIRepository
+ install:
+ crds: CreateReplace
+ interval: 1h
+ rollback:
+ cleanupOnFail: true
+ upgrade:
+ cleanupOnFail: true
+ crds: CreateReplace
+ remediation:
+ remediateLastFailure: true
+ retries: 2
+ strategy:
+ name: RemediateOnFailure
+ values:
+ controllers:
+ downflate:
+ annotations:
+ reloader.stakater.com/auto: "true"
+ containers:
+ app:
+ resources:
+ limits:
+ cpu: 500m
+ memory: 128Mi
+ requests:
+ cpu: 10m
+ memory: 32Mi
+ env:
+ DOWNFLATE_CLUSTER_PATH: kubernetes
+ DOWNFLATE_LOG_LEVEL: info
+ DOWNFLATE_REPO: "github://tanguille/cluster"
+ DOWNFLATE_TALOSCONFIG: /var/run/secrets/talos.dev/talosconfig
+ image:
+ repository: ghcr.io/home-operations/downflate
+ tag: main
+ envFrom:
+ - secretRef:
+ name: "{{ .Release.Name }}-secret"
+ securityContext:
+ allowPrivilegeEscalation: false
+ capabilities:
+ drop:
+ - ALL
+ readOnlyRootFilesystem: true
+ probes:
+ liveness:
+ spec:
+ failureThreshold: 3
+ httpGet:
+ path: /healthz
+ port: 8080
+ initialDelaySeconds: 0
+ periodSeconds: 10
+ timeoutSeconds: 1
+ custom: true
+ enabled: true
+ readiness:
+ spec:
+ failureThreshold: 3
+ httpGet:
+ path: /healthz
+ port: 8080
+ initialDelaySeconds: 0
+ periodSeconds: 10
+ timeoutSeconds: 1
+ custom: true
+ enabled: true
+ pod:
+ securityContext:
+ fsGroup: 1000
+ fsGroupChangePolicy: OnRootMismatch
+ runAsGroup: 1000
+ runAsNonRoot: true
+ runAsUser: 1000
+ topologySpreadConstraints:
+ - labelSelector:
+ matchLabels:
+ app.kubernetes.io/name: downflate
+ maxSkew: 1
+ topologyKey: kubernetes.io/hostname
+ whenUnsatisfiable: ScheduleAnyway
+ replicas: 1
+ strategy: RollingUpdate
+ persistence:
+ talos:
+ name: "{{ .Release.Name }}"
+ type: secret
+ defaultMode: 256
+ globalMounts:
+ - path: /var/run/secrets/talos.dev
+ route:
+ app:
+ hostnames:
+ - "{{ .Release.Name }}...PLACEHOLDER_SECRET_DOMAIN.."
+ parentRefs:
+ - name: envoy-external
+ namespace: network
+ service:
+ app:
+ controller: downflate
+ ports:
+ http:
+ port: 8080
@@ (root level) @@
# talos.dev/v1alpha1/ServiceAccount/kube-system/downflate
! + one document added:
+ apiVersion: talos.dev/v1alpha1
+ kind: ServiceAccount
+ metadata:
+ name: downflate
+ namespace: kube-system
+ labels:
+ kustomize.toolkit.fluxcd.io/name: downflate
+ kustomize.toolkit.fluxcd.io/namespace: kube-system
+ spec:
+ roles:
+ - "os:admin"
|
@@ (root level) @@
# v1/ServiceAccount/kube-system/downflate
! + one document added:
+ apiVersion: v1
+ kind: ServiceAccount
+ metadata:
+ name: downflate
+ namespace: kube-system
+ labels:
+ app.kubernetes.io/instance: downflate
+ app.kubernetes.io/managed-by: Helm
+ app.kubernetes.io/name: downflate
+ helm.toolkit.fluxcd.io/name: downflate
+ helm.toolkit.fluxcd.io/namespace: kube-system
@@ (root level) @@
# v1/Service/kube-system/downflate
! + one document added:
+ apiVersion: v1
+ kind: Service
+ metadata:
+ name: downflate
+ namespace: kube-system
+ labels:
+ app.kubernetes.io/instance: downflate
+ app.kubernetes.io/managed-by: Helm
+ app.kubernetes.io/name: downflate
+ app.kubernetes.io/service: downflate
+ helm.toolkit.fluxcd.io/name: downflate
+ helm.toolkit.fluxcd.io/namespace: kube-system
+ spec:
+ type: ClusterIP
+ selector:
+ app.kubernetes.io/controller: downflate
+ app.kubernetes.io/instance: downflate
+ app.kubernetes.io/name: downflate
+ ports:
+ - name: http
+ port: 8080
+ protocol: TCP
+ targetPort: 8080
@@ (root level) @@
# apps/v1/Deployment/kube-system/downflate
! + one document added:
+ apiVersion: apps/v1
+ kind: Deployment
+ metadata:
+ name: downflate
+ namespace: kube-system
+ annotations:
+ reloader.stakater.com/auto: "true"
+ labels:
+ app.kubernetes.io/controller: downflate
+ app.kubernetes.io/instance: downflate
+ app.kubernetes.io/managed-by: Helm
+ app.kubernetes.io/name: downflate
+ helm.toolkit.fluxcd.io/name: downflate
+ helm.toolkit.fluxcd.io/namespace: kube-system
+ spec:
+ replicas: 1
+ revisionHistoryLimit: 3
+ selector:
+ matchLabels:
+ app.kubernetes.io/controller: downflate
+ app.kubernetes.io/instance: downflate
+ app.kubernetes.io/name: downflate
+ strategy:
+ type: RollingUpdate
+ template:
+ metadata:
+ labels:
+ app.kubernetes.io/controller: downflate
+ app.kubernetes.io/instance: downflate
+ app.kubernetes.io/name: downflate
+ spec:
+ automountServiceAccountToken: false
+ containers:
+ - name: app
+ image: "ghcr.io/home-operations/downflate:main"
+ env:
+ - name: DOWNFLATE_CLUSTER_PATH
+ value: kubernetes
+ - name: DOWNFLATE_LOG_LEVEL
+ value: info
+ - name: DOWNFLATE_REPO
+ value: "github://tanguille/cluster"
+ - name: DOWNFLATE_TALOSCONFIG
+ value: /var/run/secrets/talos.dev/talosconfig
+ livenessProbe:
+ failureThreshold: 3
+ httpGet:
+ path: /healthz
+ port: 8080
+ initialDelaySeconds: 0
+ periodSeconds: 10
+ timeoutSeconds: 1
+ readinessProbe:
+ failureThreshold: 3
+ httpGet:
+ path: /healthz
+ port: 8080
+ initialDelaySeconds: 0
+ periodSeconds: 10
+ timeoutSeconds: 1
+ resources:
+ limits:
+ cpu: 500m
+ memory: 128Mi
+ requests:
+ cpu: 10m
+ memory: 32Mi
+ volumeMounts:
+ - name: talos
+ mountPath: /var/run/secrets/talos.dev
+ envFrom:
+ - secretRef:
+ name: downflate-secret
+ securityContext:
+ allowPrivilegeEscalation: false
+ capabilities:
+ drop:
+ - ALL
+ readOnlyRootFilesystem: true
+ dnsPolicy: ClusterFirst
+ enableServiceLinks: false
+ hostIPC: false
+ hostNetwork: false
+ hostPID: false
+ securityContext:
+ fsGroup: 1000
+ fsGroupChangePolicy: OnRootMismatch
+ runAsGroup: 1000
+ runAsNonRoot: true
+ runAsUser: 1000
+ serviceAccountName: downflate
+ topologySpreadConstraints:
+ - labelSelector:
+ matchLabels:
+ app.kubernetes.io/name: downflate
+ maxSkew: 1
+ topologyKey: kubernetes.io/hostname
+ whenUnsatisfiable: ScheduleAnyway
+ volumes:
+ - name: talos
+ secret:
+ defaultMode: 256
+ secretName: downflate
@@ (root level) @@
# gateway.networking.k8s.io/v1alpha2/HTTPRoute/kube-system/downflate
! + one document added:
+ apiVersion: gateway.networking.k8s.io/v1alpha2
+ kind: HTTPRoute
+ metadata:
+ name: downflate
+ namespace: kube-system
+ labels:
+ app.kubernetes.io/instance: downflate
+ app.kubernetes.io/managed-by: Helm
+ app.kubernetes.io/name: downflate
+ helm.toolkit.fluxcd.io/name: downflate
+ helm.toolkit.fluxcd.io/namespace: kube-system
+ spec:
+ hostnames:
+ - downflate...PLACEHOLDER_SECRET_DOMAIN..
+ parentRefs:
+ - name: envoy-external
+ group: gateway.networking.k8s.io
+ kind: Gateway
+ namespace: network
+ rules:
+ - backendRefs:
+ - name: downflate
+ group:
+ kind: Service
+ namespace: kube-system
+ port: 8080
+ weight: 1
|
a79fdba to
d489432
Compare
|
Warning Your free Security trial is over. An organization admin can activate billing to continue. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
Add downflate — a Go webhook server that pre-pulls container images onto Talos nodes before a PR merges.
Downflate listens for GitHub webhooks (PR opened/synchronized), reads the PR diff to detect new/changed container images in
kubernetes/, and calls the TalosImageService.PullAPI on all cluster nodes.Files
kubernetes/apps/kube-system/downflate/ks.yamlkubernetes/apps/kube-system/downflate/app/helmrelease.yamlkubernetes/apps/kube-system/downflate/app/talos-sa.yamlos:adminrole)kubernetes/apps/kube-system/downflate/app/secret.sops.yamlkubernetes/apps/kube-system/kustomization.yamlPre-merge
DOWNFLATE_TOKEN/DOWNFLATE_WEBHOOK_SECRETwith real values: