modified: docs/fluxcd.md

This commit is contained in:
Márcio Fernandes
2026-07-04 12:34:48 +00:00
parent 4bc1af17cc
commit abf2e93f3f
+60 -9
View File
@@ -9,22 +9,73 @@ AGE_FILE=age.agekey
age-keygen -o ${AGE_FILE} age-keygen -o ${AGE_FILE}
``` ```
**Create key and Import to kubernetes:** **Example using sops decryption:**
```yaml
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: sample-sync
spec:
interval: 1m
sourceRef:
kind: GitRepository
name: git-repo-name
path: deploy/sample-app
prune: true
decryption:
provider: sops
secretRef:
name: flux-sops-age
```
**Importing sops private key:**
Using kustomization used by operator to deploy base fluxcd manifests for deployments and reconciliation.
``` bash ``` bash
NAMESPACE=ns-name apiVersion: kustomize.config.k8s.io/v1beta1
AGE_FILE=deploy/flux/.env.d/age.agekey kind: Kustomization
SECRET_NAME=flux-sops-age namespace: your-namespace
resources:
- sample-app.yaml
secretGenerator:
- name: flux-sops-age
files:
- "age.agekey=./.env.d/age.agekey" #change to private key file path
generatorOptions:
disableNameSuffixHash: true
```
# creates age key **Import using kubectl:**
age-keygen -o ${AGE_FILE}
# imports to an namespace ```bash
cat ${AGE_FILE} | SECRET_NAME="flux-sops-age"
NAMESPACE="your-namespace"
kubectl create secret generic ${SECRET_NAME} \ kubectl create secret generic ${SECRET_NAME} \
--namespace=${NAMESPACE} \ --namespace=${NAMESPACE} \
--from-file=age.agekey=/dev/stdin --from-file=age.agekey=/dev/stdin #change to private key file path
``` ```
```yaml
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: sample-sync
spec:
interval: 1m
sourceRef:
kind: GitRepository
name: git-repo-name
path: deploy/sample-app
prune: true
decryption:
provider: sops
secretRef:
name: flux-sops-age
```
## kustomization prune ## kustomization prune
**Disable:** **Disable:**