Skip to content
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

Add secret mount to operator #535

Merged
merged 9 commits into from
Jun 19, 2019
Merged

Conversation

Shinzu
Copy link
Contributor

@Shinzu Shinzu commented Apr 4, 2019

First initial commit for adding cloud secrets to non cloud environment.

It ties to address #198

@redbaron
Copy link
Contributor

redbaron commented Apr 4, 2019

Have you seen #481 ?

@Shinzu
Copy link
Contributor Author

Shinzu commented Apr 4, 2019

yes but i think this tackles an other problem

edit: well on the second look it tries to tackle the same problem but in a completely different way.
As mention in the #481 these secrets will not be updated since they are populated via environment variables, unless you 'restart' the pod. This PR populate the secret via Volume mount and this will update the secret in the pod when the secret itself is updated. Also you need only to define 1 environment variable like AWS_SHARED_CREDENTIALS_FILE or GOOGLE_APPLICATION_CREDENTIALS and the corresponding library will take care of reading the file with the credentials. In combination with a controller like kube-aws-iam-controller , that takes care of creating and rotating secrets, this PR provides a more viable way of providing AWS credentials to the pod.

@Shinzu Shinzu force-pushed the secret-mount branch 5 times, most recently from d94d6f0 to 52dee56 Compare April 10, 2019 13:34
docs/administrator.md Outdated Show resolved Hide resolved
docs/administrator.md Outdated Show resolved Hide resolved
@redbaron
Copy link
Contributor

We keep poorly reinventing pod spec, when is the time to stop? #479

@Shinzu
Copy link
Contributor Author

Shinzu commented Apr 11, 2019

@redbaron i'm with you, in the end this is just convenience function for user who don't want to create a whole pod spec

@erthalion
Copy link
Contributor

As we discussed in #479, most likely we would need to have both "modes" - full spec and not full spec. In this sense I believe it makes sense to have this feature for the second mode, what do you think?

@FxKu FxKu added this to the v1.2 milestone May 20, 2019
pkg/cluster/k8sres_test.go Outdated Show resolved Hide resolved
@Jan-M
Copy link
Member

Jan-M commented Jun 14, 2019

Looks good to me. @sdudoladov @FxKu

@FxKu
Copy link
Member

FxKu commented Jun 14, 2019

@Shinzu could you please rebase and resolve the conflicts?

@sdudoladov
Copy link
Member

@Shinzu can you please rebase and then we will merge this PR

@Shinzu Shinzu requested a review from RafiaSabih as a code owner June 18, 2019 14:52
@Shinzu
Copy link
Contributor Author

Shinzu commented Jun 18, 2019

rebase done

@sdudoladov
Copy link
Member

👍

@sdudoladov sdudoladov changed the title WIP add secret mount to operator Add secret mount to operator Jun 18, 2019
@FxKu
Copy link
Member

FxKu commented Jun 18, 2019

hm, for some reason the config parameters are in single quotes again?

@Shinzu
Copy link
Contributor Author

Shinzu commented Jun 18, 2019

@FxKu @sdudoladov re applied the lost changes

@FxKu
Copy link
Member

FxKu commented Jun 18, 2019

👍

1 similar comment
@sdudoladov
Copy link
Member

👍

@sdudoladov sdudoladov merged commit 93bfed3 into zalando:master Jun 19, 2019
@KarstenSiemer
Copy link

KarstenSiemer commented Oct 23, 2019

Hi!
Can somebody tell me how the secret has to look like exactly? There is no use to saying there is a secret with a json file in it you can attach but putting no information on how it has to look like.
The documentation of WAL-G is only pointing out env variables and spilo is equally silent about how to pass a json.
Thanks!

@Shinzu
Copy link
Contributor Author

Shinzu commented Oct 28, 2019

hello, this file just looks like a normal credential file for aws or gcp eg https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html

@Shinzu Shinzu deleted the secret-mount branch October 28, 2019 07:45
@KarstenSiemer
Copy link

i still do not completely see the full image for getting wal-e to work with baremetal clusters.

Via Custom Pod Environment Variables you can point different cloud SDK's (AWS, GCP etc.) to this mounted secret, e.g. to access cloud resources for uploading logs etc.

AWS, GCP etc.

So one mounts a file with the credentials, this is placed inside the pod but unused, unless i configure env vars to pick up that file.

But, when looking at the documentation of wal-e, only gcp has a variable ("GOOGLE_APPLICATION_CREDENTIALS") for that. AWS doesn't.
How does one pass the credentials file to the aws connector?

@whereismyjetpack
Copy link

The behavior of this PR is slightly different than the behavior of injecting these values from the configmap. Mainly, the secret object must live in the namespace where the postgresql object is, and not the operator..

Ideally, for our usecase, we'd specify cloud credentials in the postgres-operator namespace, and the operator would add them to the existing secret that gets created, or to a new cloud credentials secret object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants