Initial commit - working through the Flux D1 reference architecture@

This commit is contained in:
V
2025-11-15 17:03:21 +00:00
commit 7f8014b20b
13 changed files with 220 additions and 0 deletions
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- sync-configmaps.yaml
- sync-git-token.yaml
@@ -0,0 +1,29 @@
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: sync-flux-configmaps
annotations:
kustomize.toolkit.fluxcd.io/force: "Enabled"
spec:
validationFailureAction: Enforce
background: false
generateExisting: true
rules:
# This rule ensures that all namespaces
# have a copy of the flux-runtime-info configmap from the flux-system namespace.
- name: sync-configmaps
match:
any:
- resources:
kinds:
- v1/Namespace
generate:
namespace: "{{request.object.metadata.name}}"
synchronize: true
cloneList:
namespace: flux-system
kinds:
- v1/ConfigMap
selector:
matchLabels:
toolkit.fluxcd.io/runtime: "true"
@@ -0,0 +1,27 @@
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: sync-git-token
spec:
mutateExistingOnPolicyUpdate: true
rules:
- name: copy-token-from-password
match:
any:
- resources:
kinds:
- Secret
names:
- flux-system
namespaces:
- flux-system
mutate:
targets:
- apiVersion: v1
kind: Secret
name: flux-system
namespace: flux-system
patchesJson6902: |-
- op: add
path: "/data/token"
value: "{{ request.object.data.password }}"