Skip to content

Commit

Permalink
feat: vault-env -> secret-init, vault-secrets-webhook -> secrets-webh…
Browse files Browse the repository at this point in the history
…ook (#388)

* feat(go code) vault-env -> secret-init

Signed-off-by: Bence Csati <[email protected]>

* run: make generate

Signed-off-by: Bence Csati <[email protected]>

* feat(crs) vault-env -> secret-init, vault-secrets-webhook -> secrets-webhook

Signed-off-by: Bence Csati <[email protected]>

---------

Signed-off-by: Bence Csati <[email protected]>
  • Loading branch information
csatib02 authored Mar 20, 2024
1 parent b30fd4e commit e37243b
Show file tree
Hide file tree
Showing 38 changed files with 1,196 additions and 160 deletions.
495 changes: 447 additions & 48 deletions deploy/charts/vault-operator/crds/crd.yaml

Large diffs are not rendered by default.

495 changes: 447 additions & 48 deletions deploy/crd/bases/vault.banzaicloud.com_vaults.yaml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions deploy/dev/microk8s/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ spec:
roles:
# Allow every pod in the default namespace to use the secret kv store
- name: default
bound_service_account_names: ["vault-secrets-webhook", "vault", "default"]
bound_service_account_names: ["secrets-webhook", "vault", "default"]
bound_service_account_namespaces: ["vault-infra", "app"]
policies: ["allow_secrets", "allow_pki"]
ttl: 1h
Expand Down Expand Up @@ -129,7 +129,7 @@ spec:
generate_lease: true
ttl: 1m

vaultEnvsConfig:
secretInitsConfig:
- name: VAULT_LOG_LEVEL
value: debug
- name: VAULT_STORAGE_FILE
Expand Down
4 changes: 2 additions & 2 deletions deploy/dev/multi-dc/aws/cr-primary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ spec:
roles:
# Allow every pod in the default namespace to use the secret kv store
- name: default
bound_service_account_names: ["default", "vault-secrets-webhook"]
bound_service_account_names: ["default", "secrets-webhook"]
bound_service_account_namespaces: ["default", "vswh"]
policies: ["allow_secrets", "allow_pki"]
ttl: 1h
Expand Down Expand Up @@ -135,7 +135,7 @@ spec:
MYSQL_ROOT_PASSWORD: s3cr3t
MYSQL_PASSWORD: 3xtr3ms3cr3t

vaultEnvsConfig:
secretInitsConfig:
- name: VAULT_LOG_LEVEL
value: info

Expand Down
4 changes: 2 additions & 2 deletions deploy/dev/multi-dc/aws/cr-secondary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ spec:
roles:
# Allow every pod in the default namespace to use the secret kv store
- name: default
bound_service_account_names: ["default", "vault-secrets-webhook"]
bound_service_account_names: ["default", "secrets-webhook"]
bound_service_account_namespaces: ["default", "vswh"]
policies: allow_secrets
ttl: 1h
Expand All @@ -87,7 +87,7 @@ spec:
options:
version: 2

vaultEnvsConfig:
secretInitsConfig:
- name: VAULT_LOG_LEVEL
value: info

Expand Down
4 changes: 2 additions & 2 deletions deploy/dev/multi-dc/aws/cr-tertiary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ spec:
roles:
# Allow every pod in the default namespace to use the secret kv store
- name: default
bound_service_account_names: ["default", "vault-secrets-webhook"]
bound_service_account_names: ["default", "secrets-webhook"]
bound_service_account_namespaces: ["default", "vswh"]
policies: allow_secrets
ttl: 1h
Expand All @@ -84,7 +84,7 @@ spec:
options:
version: 2

vaultEnvsConfig:
secretInitsConfig:
- name: VAULT_LOG_LEVEL
value: info

Expand Down
4 changes: 2 additions & 2 deletions deploy/dev/multi-dc/test/cr-primary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ spec:
roles:
# Allow every pod in the default namespace to use the secret kv store
- name: default
bound_service_account_names: ["default", "vault-secrets-webhook"]
bound_service_account_names: ["default", "secrets-webhook"]
bound_service_account_namespaces: ["default", "vswh"]
policies: ["allow_secrets", "allow_pki"]
ttl: 1h
Expand Down Expand Up @@ -128,6 +128,6 @@ spec:
MYSQL_ROOT_PASSWORD: s3cr3t
MYSQL_PASSWORD: 3xtr3ms3cr3t

vaultEnvsConfig:
secretInitsConfig:
- name: VAULT_LOG_LEVEL
value: info
4 changes: 2 additions & 2 deletions deploy/dev/multi-dc/test/cr-secondary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ spec:
roles:
# Allow every pod in the default namespace to use the secret kv store
- name: default
bound_service_account_names: ["default", "vault-secrets-webhook"]
bound_service_account_names: ["default", "secrets-webhook"]
bound_service_account_namespaces: ["default", "vswh"]
policies: allow_secrets
ttl: 1h
Expand All @@ -80,7 +80,7 @@ spec:
options:
version: 2

vaultEnvsConfig:
secretInitsConfig:
- name: VAULT_LOG_LEVEL
value: info

Expand Down
4 changes: 2 additions & 2 deletions deploy/dev/multi-dc/test/cr-tertiary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ spec:
roles:
# Allow every pod in the default namespace to use the secret kv store
- name: default
bound_service_account_names: ["default", "vault-secrets-webhook"]
bound_service_account_names: ["default", "secrets-webhook"]
bound_service_account_namespaces: ["default", "vswh"]
policies: allow_secrets
ttl: 1h
Expand All @@ -80,7 +80,7 @@ spec:
options:
version: 2

vaultEnvsConfig:
secretInitsConfig:
- name: VAULT_LOG_LEVEL
value: info

Expand Down
4 changes: 2 additions & 2 deletions deploy/examples/cr-aws-server-side-encryption.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spec:
roles:
# Allow every pod in the default namespace to use the secret kv store
- name: default
bound_service_account_names: ["vault-secrets-webhook", "vault", "default"]
bound_service_account_names: ["secrets-webhook", "vault", "default"]
bound_service_account_namespaces: ["vault-infra", "app"]
policies: ["allow_secrets", "allow_pki"]
ttl: 1h
Expand Down Expand Up @@ -106,7 +106,7 @@ spec:
# s3SSE: AES256

# Inject environment variables to all the Vault pods
vaultEnvsConfig:
secretInitsConfig:
- name: SOME_ENV_VAR_NAME
value: SOME_ENV_VAR_VALUE

Expand Down
2 changes: 1 addition & 1 deletion deploy/examples/cr-cert-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ spec:
allowed_uri_sans: ["spiffe://*"]
ttl: 144h

vaultEnvsConfig:
secretInitsConfig:
- name: VAULT_LOG_LEVEL
value: debug

Expand Down
4 changes: 2 additions & 2 deletions deploy/examples/cr-containers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ spec:
roles:
# Allow every pod in the default namespace to use the secret kv store
- name: default
bound_service_account_names: ["default", "vault-secrets-webhook", "vault"]
bound_service_account_names: ["default", "secrets-webhook", "vault"]
bound_service_account_namespaces: ["default", "vswh"]
policies: ["allow_secrets", "allow_pki"]
ttl: 1h
Expand Down Expand Up @@ -249,7 +249,7 @@ spec:
MYSQL_ROOT_PASSWORD: s3cr3t
MYSQL_PASSWORD: 3xtr3ms3cr3t

vaultEnvsConfig:
secretInitsConfig:
- name: VAULT_LOG_LEVEL
value: debug
- name: VAULT_STORAGE_FILE
Expand Down
2 changes: 1 addition & 1 deletion deploy/examples/cr-customports.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ spec:
AWS_ACCESS_KEY_ID: secretId
AWS_SECRET_ACCESS_KEY: s3cr3t

vaultEnvsConfig:
secretInitsConfig:
- name: VAULT_LOG_LEVEL
value: debug
---
Expand Down
4 changes: 2 additions & 2 deletions deploy/examples/cr-disabled-root-token-storage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ spec:
roles:
# Allow every pod in the default namespace to use the secret kv store
- name: default
bound_service_account_names: ["default", "vault-secrets-webhook", "vault"]
bound_service_account_names: ["default", "secrets-webhook", "vault"]
bound_service_account_namespaces: ["default", "vswh"]
policies: ["allow_secrets", "allow_pki"]
ttl: 1h
Expand Down Expand Up @@ -213,7 +213,7 @@ spec:
MYSQL_ROOT_PASSWORD: s3cr3t
MYSQL_PASSWORD: 3xtr3ms3cr3t

vaultEnvsConfig:
secretInitsConfig:
- name: VAULT_LOG_LEVEL
value: debug
- name: VAULT_STORAGE_FILE
Expand Down
4 changes: 2 additions & 2 deletions deploy/examples/cr-hsm-nitrokey.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ spec:
roles:
# Allow every pod in the default namespace to use the secret kv store
- name: default
bound_service_account_names: ["default", "vault-secrets-webhook", "vault"]
bound_service_account_names: ["default", "secrets-webhook", "vault"]
bound_service_account_namespaces: ["default", "vswh"]
policies: ["allow_secrets"]
ttl: 1h
Expand All @@ -138,6 +138,6 @@ spec:
options:
version: 2

vaultEnvsConfig:
secretInitsConfig:
- name: VAULT_LOG_LEVEL
value: debug
4 changes: 2 additions & 2 deletions deploy/examples/cr-hsm-softhsm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ spec:
roles:
# Allow every pod in the default namespace to use the secret kv store
- name: default
bound_service_account_names: ["default", "vault-secrets-webhook", "vault"]
bound_service_account_names: ["default", "secrets-webhook", "vault"]
bound_service_account_namespaces: ["default", "vswh"]
policies: ["allow_secrets", "allow_pki"]
ttl: 1h
Expand Down Expand Up @@ -173,6 +173,6 @@ spec:
MYSQL_ROOT_PASSWORD: s3cr3t
MYSQL_PASSWORD: 3xtr3ms3cr3t

vaultEnvsConfig:
secretInitsConfig:
- name: VAULT_LOG_LEVEL
value: debug
4 changes: 2 additions & 2 deletions deploy/examples/cr-init-containers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ spec:
roles:
# Allow every pod in the default namespace to use the secret kv store
- name: default
bound_service_account_names: ["default", "vault-secrets-webhook", "vault"]
bound_service_account_names: ["default", "secrets-webhook", "vault"]
bound_service_account_namespaces: ["default", "vswh"]
policies: allow_secrets
ttl: 1h
Expand Down Expand Up @@ -190,7 +190,7 @@ spec:
MYSQL_ROOT_PASSWORD: s3cr3t
MYSQL_PASSWORD: 3xtr3ms3cr3t

vaultEnvsConfig:
secretInitsConfig:
- name: VAULT_LOG_LEVEL
value: debug
- name: VAULT_STORAGE_FILE
Expand Down
4 changes: 2 additions & 2 deletions deploy/examples/cr-istio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ spec:
roles:
# Allow every pod in the default namespace to use the secret kv store
- name: default
bound_service_account_names: ["vault-secrets-webhook", "vault", "default"]
bound_service_account_names: ["secrets-webhook", "vault", "default"]
bound_service_account_namespaces: ["vault-infra", "app"]
policies: ["allow_secrets", "allow_pki"]
ttl: 1h
Expand Down Expand Up @@ -185,7 +185,7 @@ spec:
MYSQL_ROOT_PASSWORD: s3cr3t
MYSQL_PASSWORD: 3xtr3ms3cr3t

vaultEnvsConfig:
secretInitsConfig:
- name: VAULT_LOG_LEVEL
value: debug
- name: VAULT_STORAGE_FILE
Expand Down
4 changes: 2 additions & 2 deletions deploy/examples/cr-k8s-startup-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ spec:
roles:
# Allow every pod in the default namespace to use the secret kv store
- name: default
bound_service_account_names: ["default", "vault-secrets-webhook", "vault"]
bound_service_account_names: ["default", "secrets-webhook", "vault"]
bound_service_account_namespaces: ["default", "vswh"]
policies: ["allow_secrets", "allow_pki"]
ttl: 1h
Expand Down Expand Up @@ -202,7 +202,7 @@ spec:
# - name: external-cert
# key: ca.key

vaultEnvsConfig:
secretInitsConfig:
- name: VAULT_LOG_LEVEL
value: debug
- name: VAULT_STORAGE_FILE
Expand Down
4 changes: 2 additions & 2 deletions deploy/examples/cr-mysql-ha.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
# NOTE: you will need a MySQL instance, grab one with:
# helm upgrade --install mysql stable/mysql --set mysqlRootPassword=your-root-password --set mysqlDatabase=vault --set mysqlUser=vault --set mysqlPassword=secret --set 'initializationFiles.app-db\.sql=CREATE DATABASE IF NOT EXISTS app;'

# This example is best used together with test/deploy/test-dynamic-env-vars.yaml to demonstrate the usage of dynamic credential renewal in vault-env daemon mode.
# This example is best used together with test/deploy/test-dynamic-env-vars.yaml to demonstrate the usage of dynamic credential renewal in secret-init daemon mode.

# A YAML representation of a final vault config file, this config represents
# a HA config with MySQL.
Expand Down Expand Up @@ -73,7 +73,7 @@ spec:
default_ttl: "2m"
max_ttl: "10m"

vaultEnvsConfig:
secretInitsConfig:
- name: MYSQL_VAULT_PASSWORD
valueFrom:
secretKeyRef:
Expand Down
4 changes: 2 additions & 2 deletions deploy/examples/cr-oidc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ spec:
roles:
# Allow every pod in the default namespace to use the secret kv store
- name: default
bound_service_account_names: ["default", "vault-secrets-webhook"]
bound_service_account_names: ["default", "secrets-webhook"]
bound_service_account_namespaces: ["default", "vswh"]
policies: allow_secrets
ttl: 1h
Expand Down Expand Up @@ -137,7 +137,7 @@ spec:
data:
MYSQL_ROOT_PASSWORD: s3cr3t

vaultEnvsConfig:
secretInitsConfig:
- name: VAULT_LOG_LEVEL
value: debug
---
Expand Down
4 changes: 2 additions & 2 deletions deploy/examples/cr-priority.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ spec:
roles:
# Allow every pod in the default namespace to use the secret kv store
- name: default
bound_service_account_names: ["default", "vault-secrets-webhook"]
bound_service_account_names: ["default", "secrets-webhook"]
bound_service_account_namespaces: ["default", "vswh"]
policies: allow_secrets
ttl: 1h
Expand Down Expand Up @@ -170,7 +170,7 @@ spec:
data:
MYSQL_ROOT_PASSWORD: s3cr3t

vaultEnvsConfig:
secretInitsConfig:
- name: VAULT_LOG_LEVEL
value: debug
---
Expand Down
4 changes: 2 additions & 2 deletions deploy/examples/cr-raft-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ spec:
roles:
# Allow every pod in the default namespace to use the secret kv store
- name: default
bound_service_account_names: ["default", "vault-secrets-webhook"]
bound_service_account_names: ["default", "secrets-webhook"]
bound_service_account_namespaces: ["default", "webhook"]
policies: allow_secrets
ttl: 1h
Expand Down Expand Up @@ -200,6 +200,6 @@ spec:
data:
MYSQL_ROOT_PASSWORD: s3cr3t

vaultEnvsConfig:
secretInitsConfig:
- name: VAULT_LOG_LEVEL
value: debug
4 changes: 2 additions & 2 deletions deploy/examples/cr-raft-ha-storage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ spec:
roles:
# Allow every pod in the default namespace to use the secret kv store
- name: default
bound_service_account_names: ["default", "vault-secrets-webhook", "vault"]
bound_service_account_names: ["default", "secrets-webhook", "vault"]
bound_service_account_namespaces: ["default", "vswh"]
policies: ["allow_secrets", "allow_pki"]
ttl: 1h
Expand All @@ -70,7 +70,7 @@ spec:
options:
version: 2

vaultEnvsConfig:
secretInitsConfig:
- name: VAULT_LOG_LEVEL
value: debug

Expand Down
4 changes: 2 additions & 2 deletions deploy/examples/cr-raft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ spec:
roles:
# Allow every pod in the default namespace to use the secret kv store
- name: default
bound_service_account_names: ["default", "vault-secrets-webhook"]
bound_service_account_names: ["default", "secrets-webhook"]
bound_service_account_namespaces: ["default", "vswh"]
policies: allow_secrets
ttl: 1h
Expand Down Expand Up @@ -206,6 +206,6 @@ spec:
data:
MYSQL_ROOT_PASSWORD: s3cr3t

vaultEnvsConfig:
secretInitsConfig:
- name: VAULT_LOG_LEVEL
value: debug
Loading

0 comments on commit e37243b

Please sign in to comment.