Skip to content

Feature Request: Generate Secret if it does not exist #90

@victorgetz

Description

@victorgetz

First of all thanks for your amazing work.

Description:

What i would propose is a feature which can automatically create the a secret if it does not exist.
With a identifier (for example generate@...) the webhook will now that it should take a look if the secret exists.
If it exists just take it. If not autogenerate a password/certificate.

What problem does it solve
Inside my helm chart i would like to be able to define everything for my service. At the moment we need somehow to create the secret upfront. In our case we create it upfront with terraform.

I need 2 steps to use my secret with two different technologies inside two different repositories.

Lets demonstrate it based on prometheus helm chart and admin credentials.

Example (Current):

Terraform

resource "random_password" "grafana_admin_pw" {
  length  = 32
  special = true
}

resource "vault_generic_secret" "grafana_admin_credentials" {
  path         = "kvEngine/prod/grafana"
  disable_read = false
  data_json = jsonencode({
    admin_password       = random_password.grafana_admin_pw.result
  })
}

Helm Chart

grafana:
  adminPassword: "vault:/kvEngine/prod/grafana#admin_password"

Example (Solution):

Helm Chart

grafana:
  adminPassword: "generate@vault:/kvEngine/prod/grafana#admin_password"

There is a topic about Write a value into Vault
but this one does not work with KV Engine and is really complicated.

Metadata

Metadata

Assignees

Labels

kind/featureCategorizes issue or PR as related to a new feature.lifecycle/keepDenotes an issue or PR that should be preserved from going stale.priority/backlogIssue that needs to be added and addressed in the backlog.

Type

No type
No fields configured for issues without a type.

Projects

Status
Next up

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions