Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Ability to reference and make available a Kubernetes Secret in task container #8

Closed
donovanmuller opened this issue Jun 4, 2021 · 2 comments · Fixed by #15
Closed
Assignees
Labels
type:feature New feature or request that provides value to the stakeholders/end-users
Milestone

Comments

@donovanmuller
Copy link
Contributor

Some tasks might require credentials, tokens or other sensitive information, available as a Kubernetes Secret, that should be made available in the task's Kubernetes Job container.

Therefore, it would be great to able to reference the Secret(s) by name and making them available as:

  • Secret volume mounts
  • environment variables using valueFrom.secretKeyRef
@botchk botchk added the type:feature New feature or request that provides value to the stakeholders/end-users label Jun 8, 2021
@botchk
Copy link
Collaborator

botchk commented Jun 8, 2021

Thanks for the idea @donovanmuller. I guess making them available as environment variables should cover most of the use-cases that should arise.

Currently the env block of a task looks like this:

env:
  - name: HOST
    value: "$.data.deployment.deploymentURIsLocal[0]"

The configuration for secrets could look something like this:

env:
  - name: HOST
    value: "$.data.deployment.deploymentURIsLocal[0]"
    valueFrom: event
  - name: K8sSecret  # in case of a secret the name would serve no purpose
    value: "locust-secret"
    valueFrom: secret

Introduce a valueFrom property, that can be either event, behaving the same way as currently, resolve the value from the incoming keptn event. Or it can be secret, in that case lookup the secret, iterate over its key/value pairs and provide them as environment variables in the job.

If the need arises for secret volume mounts we could cover this at a later point.

@botchk botchk added this to the 0.1.2 milestone Jun 8, 2021
@donovanmuller
Copy link
Contributor Author

@yeahservice sounds good 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type:feature New feature or request that provides value to the stakeholders/end-users
Projects
None yet
2 participants