Code Monkey home page Code Monkey logo

Comments (1)

tewfik-ghariani avatar tewfik-ghariani commented on June 16, 2024

Hi,

It is possible to manually renew the certificates by generating a new public-cert/private-key pair via openssl, then apply it as a secret in K8s and finally label it with the sealedsecrets.bitnami.com/sealed-secrets-key=active label so that it gets picked up by the controller upon re-deployment.

After that, the "v1/cert.pem" endpoint exposed by the controller will point to the most recent certificate and kubeseal can consume it to seal new secrets


  1. Generate a new certificate
  SECRET_NAME="sealed-secrets-pub-key-$(date +'%s')"
  SEAL_PUB="${SECRET_NAME}-cert.pem"
  SEAL_PRIV="${SECRET_NAME}-priv.key"

  openssl req -x509 -nodes                               \
                    -days 3650                           \
                    -newkey rsa:4096                     \
                    -keyout "$SEAL_PRIV"                 \
                    -out "$SEAL_PUB"                     \
                    -subj "/CN=Sealed Secrets Controller/O=Team"
  1. Create a TLS secret in k8s with the content of the certificate
kubectl create secret tls $SECRET_NAME --cert=$SEAL_PUB --key=$SEAL_PRIV
  1. Label it appropriately
kubectl label secret $SECRET_NAME "sealedsecrets.bitnami.com/sealed-secrets-key=active" --overwrite

Finally, you can confirm that the new secret was picked up by the controller after re-deploying it

 $ k logs sealed-secrets-ctr-any-infra-example-nhn2h | head -n30
controller version: 0.22.0
2023/07/18 22:51:34 Starting sealed-secrets controller version: 0.22.0
Searching for existing private keys
----- sealed-secrets-pub-keys8flw
----- sealed-secrets-pub-keygqqk7
----- sealed-secrets-pub-keykhpr2
----- sealed-secrets-pub-key-1689639195

from sealed-secrets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.