File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed
Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -348,6 +348,56 @@ You'll use **SOPS** and **age** to encrypt sensitive YAML files before committin
348348
349349 Avoid leaving decrypted copies on disk.
350350
351+ 5. **Create a Kubernetes Secret containing the private key:**
352+ Flux needs access to the private age key to decrypt files during reconciliation.
353+ Create a Kubernetes Secret in the flux-system namespace containing the private key :
354+
355+ ` ` ` bash
356+ kubectl create secret generic --from-file=age.agekey=${HOME}/config/sops/age/${CLUSTER_NAME}_keys.txt sops-age -n flux-system
357+ ` ` `
358+
359+ 6. **Reference the Secret in your Flux Kustomization:**
360+ When defining your Flux `Kustomization` resource, add the **decryption** section to reference the secret created above.
361+ _File : ` applications/overlays/<env>/services/fluxcd/cert-manager.yaml` _
362+
363+ ` ` ` bash
364+ [...]
365+ apiVersion: kustomize.toolkit.fluxcd.io/v1
366+ kind: Kustomization
367+ metadata:
368+ name: cert-manager-override
369+ namespace: flux-system
370+ spec:
371+ dependsOn:
372+ - name: cert-manager-base
373+ namespace: flux-system
374+ interval: 5m
375+ retryInterval: 1m
376+ timeout: 10m
377+ decryption: ## <==
378+ provider: sops ## <==
379+ secretRef: ## <==
380+ name: sops-age ## <==
381+ sourceRef:
382+ kind: GitRepository
383+ name: flux-system
384+ namespace: flux-system
385+ path: ./applications/overlays/<env>/services/cert-manager
386+ targetNamespace: cert-manager
387+ prune: true
388+ wait: true
389+ healthChecks:
390+ - apiVersion: helm.toolkit.fluxcd.io/v2
391+ kind: HelmRelease
392+ name: cert-manager
393+ namespace: cert-manager
394+ commonMetadata:
395+ labels:
396+ app.kubernetes.io/part-of: cert-manager
397+ app.kubernetes.io/managed-by: flux
398+ opencenter/managed-by: opencenter
399+ ` ` `
400+
351401---
352402
353403# # Step 5: Authorize Flux to Read the Base Repository
You can’t perform that action at this time.
0 commit comments