-
Notifications
You must be signed in to change notification settings - Fork 13
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
Secrets Provider Configuration via annotations M1 #330
Comments
I'm wondering if we have to deal with Adding some more background: The Secrets Provider container is exposed to its Pod annotations via the Kubernetes Downward API as described in this example: For M1 Push-to-File, the
When the Pod is started up, the Kubernetes So the Secrets Provider will see a file at location:
I think the workflow that we're looking for is something like the following. We'll do this processing once at the beginning of time, and save the results in a structure to be used later by other parts of SP code:
It's assumed that checks for required values and input validation on values is done wherever the settings are consumed. Two more requirements that we can consider adding are:
|
Currently, Secrets Provider configuration is provided via environment variables. The goal of this issue is to make it possible to get this configuration from annotations.
Context
The Secrets Provider container is not directly aware of the annotations from the manifest. The annotations are passed down via
the downwards API. The format they take in file form is described as follows
The code for the formatting is available in the Kubernetes source. This might be useful for parsing the annotations.
Requirements
In order to support annotations as a mechanism for configuration we need to assume, as input, a file from the downward api containing the container's annotations. This files should be parsed and used to populate the same internal representations of configurations that were previously populated via environment variables.
Below is a mapping of internal configuration fields and source annotations.
Container config:
Kubernetes Secrets config:
The places in the code where this configuration is used are:
secrets-provider-for-k8s/pkg/secrets/k8s_secrets_storage/provide_conjur_secrets.go
Line 41 in 53271bd
secrets-provider-for-k8s/cmd/secrets-provider/main.go
Line 31 in 53271bd
Acceptance Criteria
Notes on testing
For the test cases we recommend writing unit tests. E2E tests are very expensive to validate every aspect of configuration via annotations. It's better for the bulk of the tests to be unit tests, and as a finish touch to add annotations to a single E2E smoke test.
You can use the downwards API to generate static fixtures for the unit tests. Alternatively, the code for formatting is available in the Kubernetes source. Additionally, the formatting logic is available in a public package so you could also dynamically generate your fixtures.
The text was updated successfully, but these errors were encountered: