Welcome to vault-secrets-operator’s documentation!

vaultsecrets-operator installation

The contains details of how to install and uninstall vaultsecrets-operator

Requirements

vaultsecrets-operator runs on K8S cluster 1.16 and up. To install it you would need:

  1. Admin access to cluster

  2. kubectl which is configured to access your cluster and is in your execution path

  3. GNU or *NIX Make which is in your execution path

  4. Vault role and AWS IAM role which grants access to Vault

Install to K8S cluster

The vaultsecrets-operator docker image is located at DockerHub.

To install it to your K8S cluster:

  1. edit deploy/operator.yaml and add your environment variables.

  2. Install using make and kubectl:

cd deploy
make install

EnvVariables

Environment variables, which allow to configure operator:

Variable Name Required Notes Example
VAULT_ADDR Yes FQDN with port of your Vault installtion. Operator from K8S must be able to access it. https://vault.default.svc.cluster.local:8200
VAULT_SKIP_VERIFY No Operator will allow TLS connections to Vault, protected with self signed certificate 1
VAULT_ROLE_2_ASSUME Yes Role to assume on Vault vault-secret-operator-role
VAULT_SECRETS_PREFIX Yes Path in Vault, where your secrets are kept secret/k8s
MAX_CONCURRENT_RECONCILES Yes How many reconcile loops run concurrently 1

FAQ

Any questions realted to vault-secrets-operator:

VaultSecret CRD

Example:

apiVersion: xo.90poe.io/v1alpha1
kind: VaultSecret
metadata:
  name: example-vaultsecret
  labels:
    app: example-vaultsecret-app
    owner: DevOps
spec:
  name: default-v1-test
  reread_intervals: 300 # 10 minutes
  type: kubernetes.io/dockerconfigjson
  secrets_paths:
    .dockerconfigjson: shared/nexus_dockerconfigjson

Spec

You will have to amend spec section according to your requirements.

Spec section:

Settings Type Required Notes
name string Yes Name of Secret in K8S
secrets_paths map[string]string Yes List of Vault secrets you want to be added to K8S. See SecretsPaths for more details.
provided_secrets map[string]string No List of secrets you want to be added to K8S verbatim. Required in order to mix secrets from Vault with your own secrets from CRD.
reread_intervals int Yes Seconds how often to re-read secrets values from Vault
type v1.Secret K8S object Type string Yes Type of K8S secret, please see Kubernetes docs

SecretsPaths

This map contains keys and values. Keys would be used in Secrets as data keys. And values would be fetched from Vault on path, specified by values in this structure.

Full path, on which this operator is going to read secret from Vault is constructed as follows: VAULT_SECRETS_PREFIX / + value

NOTE: VAULT_SECRETS_PREFIX is environment variable.

Example:

spec:
  ....
  secrets_paths:
    SOME_DATA: shared/very_secure_password

In here, SOME_DATA will be put to K8S secret as data key and value for it would be fetched from $VAULT_SECRETS_PREFIX/shared/very_secure_password in Vault.

Operator is expecting special form for secret in Vault. You must have secret shared/very_secure_password hold key value or base64_value and your secret. If value is used for key in Vault, secret will be encoded with base64 before putting into K8S Secret object. If base64_value value is used (for binary or JSON objects), then oeprator expects that value is already encoded in Vault and will not perform additional encodind before putting to K8S Secret object.

Indices and tables