Ravindra BagaleCourses & study guides मराठी

Chapter 96: Flux GitOps — Sources, Reconciliation and Safe Local Practice

DevOps

96.13 Secrets in GitOps without real keys

Fictional teaching story. At a fictional Ratnagiri shop, Aditi and Jack realize that encoding a password is not the same as encrypting it.

Why

Git history, rendered output and controller logs can preserve mistakes long after a file is changed.

What

Compare encoding, encrypted files and external secret retrieval at a teaching level.

How

Secrets in GitOps without real keys
Original classroom diagram: Secrets in GitOps without real keys

Encoding is not encryption

Base64 is an encoding that changes representation. Encryption protects confidentiality using keys. A Kubernetes Secret’s encoded data is not automatically safe to commit to Git.

Immediate practice example

  1. Read the example from top to bottom. Do not send it to a real cluster.
A fake non-secret word is encoded as a reversible representation.
Anyone who can decode it can recover that word.
Decision: do not put real credentials into this demonstration.
  1. Read the expected result.

Illustrative output: not executed by Flux, kubectl, Helm or Kubernetes.

Changing text representation does not create a confidentiality boundary.
  1. Understand each line in plain English.

The first line describes encoding without printing even a pretend credential value. The second explains reversibility. The third is the classroom safety decision. Kubernetes Secret storage, access and encryption-at-rest controls require separate review; naming something Secret is not a complete security design.

SOPS decryption in a Flux Kustomization

SOPS encrypts selected content in structured files. A Flux Kustomization can use its documented SOPS decryption integration. The decrypting identity and key management remain separate sensitive responsibilities.

Immediate practice example

  1. Read the example from top to bottom. Do not send it to a real cluster.
spec:
  decryption:
    provider: sops
  1. Read the expected result.

Illustrative output: not executed by Flux, kubectl, Helm or Kubernetes.

This partial manifest selects the SOPS provider; it is deliberately incomplete and cannot decrypt anything here.
  1. Understand each line in plain English.

decryption configures a build-time boundary in the reconciler. provider: sops names the integration, not a key. No secretRef, private key, cloud identity or Vault credential is provided. Encrypting a file does not prevent sensitive values appearing in rendered resources or diagnostics after decryption.

Sealed Secrets and Vault are not the same mechanism

Sealed Secrets uses its own controller to turn encrypted custom resources into Kubernetes Secrets. Vault is a separate secrets-management service with identity, policy and secret lifecycles. A reference to a secret is not permission to read it.

Immediate practice example

  1. Read the example from top to bottom. Do not send it to a real cluster.
SOPS route: encrypted file -> authorized decryption during reconciliation
Sealed Secrets route: encrypted custom resource -> its controller
Vault route: authenticated application/integration -> authorized secret access
  1. Read the expected result.

Illustrative output: not executed by Flux, kubectl, Helm or Kubernetes.

These routes have different controllers, keys, identities and recovery plans.
  1. Understand each line in plain English.

Each line defines a mechanism rather than a working integration. Flux does not become a Vault server or a Sealed Secrets controller by reading an encrypted file. Chapter 94 covers Vault foundations. No provider setup, authentication, key generation, secret fetch or key material is executed or included.

Ravindra Bagale's Tip

Keep real keys out of Git, examples, screenshots and debug output.

Did you understand? Let us try it once more.