Skills2026年4月15日·1 分钟阅读

Sealed Secrets — One-Way Encrypted Kubernetes Secrets

Sealed Secrets is a Bitnami Labs controller and kubeseal CLI that lets teams commit encrypted secrets safely to Git, and have a cluster-side controller decrypt them into real Secrets at apply time.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Sealed Secrets
直接安装命令
npx -y tokrepo@latest install 96d329e7-38fa-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

TL;DR
Bitnami Labs controller and CLI for committing encrypted Kubernetes secrets to Git. Cluster-side decryption into real Secrets at apply time.
§01

What it is

Sealed Secrets is a Kubernetes controller and CLI tool from Bitnami Labs that enables GitOps-safe secret management. It lets you encrypt Kubernetes Secrets into SealedSecret resources that are safe to commit to Git. The cluster-side controller decrypts them into real Secrets at apply time.

Sealed Secrets solves the fundamental GitOps problem: you want all configuration in Git, but Kubernetes Secrets are base64-encoded (not encrypted) and cannot be safely committed.

§02

How it saves time or tokens

Without Sealed Secrets, teams either avoid GitOps for secrets (manual kubectl apply) or use complex external secret managers. Sealed Secrets adds encryption directly to the GitOps workflow. Encrypt once with kubeseal, commit the SealedSecret, and the controller handles decryption.

This eliminates the operational overhead of managing secrets separately from other Kubernetes configurations.

Additionally, the project's well-structured documentation and active community mean developers spend less time troubleshooting integration issues. When AI coding assistants generate code for this tool, they can reference established patterns from the documentation, producing correct implementations with fewer iterations and lower token costs.

§03

How to use

  1. Install the controller in your cluster:
helm repo add sealed-secrets https://bitnami-labs.github.io/sealed-secrets
helm install sealed-secrets sealed-secrets/sealed-secrets -n kube-system
  1. Install the kubeseal CLI:
brew install kubeseal
  1. Create and seal a secret:
kubectl create secret generic my-secret \
  --from-literal=api-key=super-secret-value \
  --dry-run=client -o yaml | \
  kubeseal --format yaml > sealed-secret.yaml
  1. Commit sealed-secret.yaml to Git. The controller decrypts it into a real Secret when applied.
kubectl apply -f sealed-secret.yaml
§04

Example

# sealed-secret.yaml (safe to commit)
apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
  name: my-secret
  namespace: default
spec:
  encryptedData:
    api-key: AgBy3i4OJSWK+PiTySYZZA9rO43cGDEq...
  template:
    metadata:
      name: my-secret
§05

Related on TokRepo

§06

Common pitfalls

  • Losing the controller's private key. If the controller's private key is lost, all existing SealedSecrets become undecryptable. Back up the key securely or use a key management service.
  • Not specifying the namespace when sealing. By default, SealedSecrets are namespace-scoped. A SealedSecret sealed for namespace A cannot be decrypted in namespace B.
  • Committing raw Secrets alongside SealedSecrets. The SealedSecret replaces the regular Secret. Never commit unencrypted Secret YAML to the same repository.
  • Failing to review community discussions and changelogs before upgrading. Breaking changes in major versions can disrupt existing workflows. Pin versions in production and test upgrades in staging first.

常见问题

How does Sealed Secrets encryption work?+

kubeseal fetches the controller's public key from the cluster and uses asymmetric encryption (RSA) to encrypt the secret data. Only the controller's private key (stored in the cluster) can decrypt it. This one-way encryption makes the SealedSecret safe to commit to Git.

Can I rotate Sealed Secrets keys?+

Yes. The controller supports key rotation. New keys are generated periodically, and old keys are retained for decrypting existing SealedSecrets. You can trigger re-encryption of existing secrets with the new key.

How does Sealed Secrets compare to External Secrets Operator?+

Sealed Secrets encrypts secrets and stores them in Git. External Secrets Operator fetches secrets from external providers (AWS Secrets Manager, Vault, GCP) at runtime. Sealed Secrets is simpler and self-contained. External Secrets Operator integrates with existing secret management infrastructure.

Does Sealed Secrets work with Helm?+

Yes. You can include SealedSecret YAML in Helm charts. The SealedSecret is applied like any other Kubernetes resource, and the controller decrypts it into a regular Secret. Template the SealedSecret in your Helm values.

Is Sealed Secrets suitable for production?+

Yes. Sealed Secrets is widely used in production GitOps workflows. It is maintained by Bitnami Labs, has regular releases, and supports key rotation, multi-namespace deployments, and backup procedures.

引用来源 (3)

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产