secret cloner

This commit is contained in:
Danijel Simeunovic
2026-03-06 08:48:33 +01:00
parent daec2b1bb2
commit 1a621c038f
2 changed files with 73 additions and 2 deletions

View File

@@ -45,8 +45,8 @@ This is a **Kubernetes cluster bootstrapping and GitOps configuration repository
## Architecture & Key Concepts ## Architecture & Key Concepts
### GitOps Model ### GitOps Model
- **App-of-Apps Pattern**: `infra/_app-of-apps.yaml` is the root Application that manages all infrastructure applications - **App-of-Apps Pattern**: `_app-of-apps.yaml` is the root Application that manages all infrastructure applications
- **App-of-Apps Pattern**: `apps/_app-of-apps.yaml` is the root Application that manages all custom applications - **App-of-Apps Pattern**: `infra/enterprise-apps.yaml` is the main Application that manages all custom applications
- **Source of Truth**: GitHub repository (`https://github.com/snothub/sturdy-adventure.git`) is the single source of truth - **Source of Truth**: GitHub repository (`https://github.com/snothub/sturdy-adventure.git`) is the single source of truth
- **Auto-sync**: All Applications have automated sync enabled with auto-pruning and self-healing - **Auto-sync**: All Applications have automated sync enabled with auto-pruning and self-healing
- **Namespace Creation**: `CreateNamespace=true` allows ArgoCD to create namespaces as needed - **Namespace Creation**: `CreateNamespace=true` allows ArgoCD to create namespaces as needed

View File

@@ -0,0 +1,71 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kyverno:secrets:view
labels:
rbac.kyverno.io/aggregate-to-admission-controller: "true"
rbac.kyverno.io/aggregate-to-reports-controller: "true"
rbac.kyverno.io/aggregate-to-background-controller: "true"
rules:
- apiGroups:
- ''
resources:
- secrets
verbs:
- get
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kyverno:secrets:manage
labels:
rbac.kyverno.io/aggregate-to-background-controller: "true"
rules:
- apiGroups:
- ''
resources:
- secrets
verbs:
- create
- update
- delete
---
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: sync-secret-with-multi-clone
spec:
rules:
- name: sync-secrets
match:
any:
- resources:
kinds:
- Namespace
exclude:
any:
- resources:
namespaces:
- kube-system
- trivy-system
- monitoring
- argocd
- cert-manager
- kyverno
- default
- cilium-secrets
- kube-public
- kyverno
generate:
generateExisting: false
namespace: "{{request.object.metadata.name}}"
synchronize: true
cloneList:
namespace: secrets
kinds:
- v1/Secret
selector:
matchLabels:
allowedToBeCloned: "true"