-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate from Kubernetes External Secrets to ~External Secrets Operator~ CSI Driver #24869
Comments
/sig testing |
Any thoughts on SealedSecret as an alternative? Seems more gitops friendly |
I can see that https://github.com/bitnami-labs/sealed-secrets is similar to KES(Kubernetes external secret) in terms of generating kubernetes secrets from a more secure custom resources, which is not the only purpose of KES. The original purpose of KES was introduced to solve the problem:
As KES syncs secrets from major secret manager providers into kubernetes cluster, so the recovery of kubernetes secret is as simple as re-applying
In short, SealedSecret is probably not the best replacement for KES |
My think was that external secret is really only marginally different than
a developer doing `kubectl apply`. Now they are just doing `gcloud secret
create` - same opaqueness as apply it seems? With sealed secret the entire
state lives in git
…On Tue, Feb 22, 2022, 7:23 AM Chao Dai ***@***.***> wrote:
Any thoughts on SealedSecret as an alternative? Seems more gitops friendly
I can see that https://github.com/bitnami-labs/sealed-secrets is similar
to KES(Kubernetes external secret) in terms of generating kubernetes
secrets from a more secure custom resources, which is not the only purpose
of KES.
The original purpose of KES was introduced to solve the problem:
- Kubernetes secrets were manually applied to the cluster by kubectl
apply from dev machine(s)
- The secret might get lost if someone accidentally update/delete the
value of the secret, or even the cluster was accidentally deleted
As KES syncs secrets from major secret manager providers into kubernetes
cluster, so the recovery of kubernetes secret is as simple as re-applying
ExternalSecret CR into the kubectl cluster, for example
https://github.com/kubernetes/test-infra/blob/d075174d2b9bcbe5aac9391ff306426963d2a37d/config/prow/cluster/kubernetes_external_secrets.yaml#L4
In short, SealedSecret is probably not the best replacement for KES
—
Reply to this email directly, view it on GitHub
<#24869 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEYGXMCW37B2TE5SY53SFDU4OS7TANCNFSM5L4SVMCQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
|
Agree with you that both need a manual operation of either
|
I feel like you could say the same about SealedSecret though...
Except for "cluster deleted" I guess you would need to keep the sealed secret keys (to decrypt if cluster is deleted) somewhere, so at some point you need to bootstrap... Anyhow I have no strong agenda either way, just wanted to throw the idea out there |
Thank you @howardjohn , this is really great discussion! I think I have misunderstood SealSecret to certain extent, now that with your explanation it's a bit more clear now. So SealedSecret:
This sounds pretty good, and I can see that other than the cluster being deleted scenario this is also pretty reliable. One thing not super clear from the documentation, is that when a user runs |
@chaodaiG I think you can fetch the pubkey once and store in git. Then a dev experience to add a secret or update would be But one concern would be that it said the key expires are 30d... so that may not work. I do not have much practical experience with sealed secrets so not 100% sure |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
https://kubernetes.slack.com/archives/C09QZ4DQB/p1654433983124889 is one of the reasons why this should be prioritized. TLDR: syncing build clusters tokens into prow is now a crucial piece in prow working with build cluster, KES flakiness would break this and cause prow stop working with the build cluster /remove-lifecycle stale |
Prow now authenticates with build clusters with tokens that are valid for 2 days. The token is refreshed by a prow job https://prow.k8s.io/?type=periodic&job=ci-test-infra-gencred-refresh-kubeconfig and stores in GCP secret manager, KES is responsible for syncing the secrets into prow. Have observed KES being flaky at time to time, generally more than 10 days after the KES pods started running. See kubernetes#24869 (comment) This is a temporary solution aim to mitigate the issue of long running KES pods
Prow now authenticates with build clusters with tokens that are valid for 2 days. The token is refreshed by a prow job https://prow.k8s.io/?type=periodic&job=ci-test-infra-gencred-refresh-kubeconfig and stores in GCP secret manager, KES is responsible for syncing the secrets into prow. Have observed KES being flaky at time to time, generally more than 10 days after the KES pods started running. See kubernetes#24869 (comment) This is a temporary solution aim to mitigate the issue of long running KES pods
Prow now authenticates with build clusters with tokens that are valid for 2 days. The token is refreshed by a prow job https://prow.k8s.io/?type=periodic&job=ci-test-infra-gencred-refresh-kubeconfig and stores in GCP secret manager, KES is responsible for syncing the secrets into prow. Have observed KES being flaky at time to time, generally more than 10 days after the KES pods started running. See kubernetes#24869 (comment) This is a temporary solution aim to mitigate the issue of long running KES pods
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
Build cluster token failed to sync issue happened again https://kubernetes.slack.com/archives/C7J9RP96G/p1667877096344719, this is not good. /assign |
uh-oh. thanks @chaodaiG |
I don't want to derail / delay efforts going on in #27932, but has something like https://secrets-store-csi-driver.sigs.k8s.io/ been considered? We could use that with the GCP provider today and there's support for AWS, Azure, and Vault providers if we need to change. Using the CSI driver + Google Secrets Manager (provider) would allow us to leverage Workload Identity for IAM secret access. I believe we'd also have better insight into access / auditing. I know GCP costs are a concern, the pricing page indicates that it would be $0.06 per secret/per location and $0.03 per 10,000 access operations (and $0.05 per rotation). I don't think the costs would be astronomical, but it would be worth doing a closer inspection if we decided to pivot towards this solution. I'm happy to demo / help move forward if we want to go that direction, however I understand the urgency and value the progress already made. Edit: It looks like External Secrets Operator also allows us to use Secret Manager + WID if we'd like: https://external-secrets.io/v0.6.1/provider/google-secrets-manager/. I think it would come down to the easier to maintain, and more active (future-proof-ish?), solution. |
hi @jimangel , it's not a derail at all. iirc csi driver for GCP was in its super early release cycle when we decided to adopt Kubernetes External Secret. The proposal of transition from Kubernetes External Secret to External Secret Operator was pretty much a lazy action based on the recommendation from Kubernetes External Secret. In terms of the cost, we don't have that many secrets and lots of access operations so I wouldn't be too worried about it. I would be glad to take another look at that csi driver for GCP since it's ready now, will do a quick evaluation by myself in terms of operational and maintenance perspective, and will get your thoughts if there is any question come up. |
Had an extensive and wonderful offline discussion with @jimangel , and here is what we agreed on:
With all those being said, I'm convinced that CSI driver is better suited for our use case. Kudos to @jimangel , thank you so much for the discussion, I felt I have learned a lot! @BenTheElder @spiffxp @dims @ameukam @cjwagner , WDYT? |
Awesome write up @chaodaiG! Agreed, it was fun chatting.
There are alternatives for authentication outlined here: https://github.com/GoogleCloudPlatform/secrets-store-csi-driver-provider-gcp/blob/main/docs/authentication.md but the general consensus is to use WI if at all possible. |
Sounds like a nice improvement to me! |
@jimangel So if the secret is mounted as a volume in the pod, how this is isolated from the other pods running in the same node ? |
I believe the threat model is the same as before (or more secure). Access today is segmented by namespace (k8s "built-in" secrets). With the CSI driver, access is only permitted when all conditions are met:
NOTE: Any workload/job/pod in a shared k8s namespace could use the same service account to access the permitted secret(s)/ As far as what access pods on the same node have (isolation)... If any pod/actor can mount/escape a pod to access node-level storage layers; you are as screwed as you'd be if you were using Kubernetes "built-in" secrets. 😅 Let me know if I misunderstood what you're asking @ameukam! Edit: There are a couple "security considerations" called out in the repo itself. |
Hey all! Checking in here, what would be the next steps @chaodaiG? Should we try a small-scale demo or is there somewhere to test? |
@cjwagner could you please take a look |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
This comment was marked as off-topic.
This comment was marked as off-topic.
This is open for contribution if anyone's willing to do so. (We do keep seeing infrequent errors or flakes that require KES to be restarted, so while it's not urgent it'd be helpful!). |
@michelle192837 Assuming this need to be deployed on a Google-owned GKE cluster, one action would be to create a SA with workload identity so we can use it to retrieve the secrets from the secret manager. I think it only can be done by EngProd. |
We're phasing out the google-owned GKE clusters in the immediate future, I don't think we should bother tracking this in the meantime anymore? |
What would you like to be added:
Why is this needed:
As announced at external-secrets/kubernetes-external-secrets#864, Kubernetes External Secret is under maintenance mode right now, the new recommendation is to migrate over to External Secrets Operator.
There hasn't been any plan of turning down Kubernetes External Secret, so we might be fine for a while, until it's either incompatible with upcoming kubernetes versions, or newer features/bug fixes are only available from External Secrets Operator.
The text was updated successfully, but these errors were encountered: