GKE Secrets OR Google Secret manager

3.9k Views Asked by At

Does anyone know in which case choose Kubernetes secrets instead of google secret manager and the reverse ? Differences between the two ?

2

There are 2 best solutions below

0
On

With Kubernetes secret (K8S Secret), you use a built in feature of K8S. You load your secrets in config maps, and you mount them on the pods that require them.

PRO

If a day you want to deploy on AWS, Azure or on prem, still on K8S, the behavior will be the same, no update to perform in your code.

CONS

The secrets are only accessible by K8S cluster, impossible to reuse them with another GCP services

Note: With GKE, no problem the ETCD component is automatically encrypted with a key form KMS service to keep the secret encrypted at rest. But, it's not always the same for every K8S installation, especially on premise, where the secrets are kept in plain text. Be aware about this part of the security.


Secret Manager is a vault managed by Google. You have API to read and write them and the IAM service checks the authorization.

PRO

It's a Google Cloud service and you can access it from any GCP services (Compute Engine, Cloud Run, App Engine, Cloud Functions, GKE,....) as long as you are authorized for

CONS

It's Google Cloud specific product, you are locked in.

0
On

You can use them together via this sync service: https://external-secrets.io/