Secret Type - PKI

The PKI-Type is made to connect to the PKI - Secrets Engine of HashiCorp Vault. It generates certificates X.509 Certificates and refreshes them if they are near the expiration date.

How To

First generate a PKI in Vault and create a rule to issue new certificates:

$ vault secrets enable -path=testpki -description=testpki pki
$ vault secrets tune -max-lease-ttl=8760h testpki
$ vault write testpki/root/generate/internal \
      common_name=koudingspawn.de \
      ttl=500h
$ vault write testpki/roles/testrole \
      allowed_domains=*.koudingspawn.de \
      max_ttl=8760h

After this create the following Vault-Resource and apply it to Kubernetes:

apiVersion: "koudingspawn.de/v1"
kind: Vault
metadata:
  name: test-pki
spec:
  path: "testpki/issue/testrole"
  type: "PKI"
  pkiConfiguration:
    commonName: "vault.koudingspawn.de"
    ttl: "8h"

This issues a new certificate that is available in your Kubernetes secret resource. It's saved in the format that Ingress can use to read them as certificates. For more details on ingress configuration please see: https://koudingspawn.de/advanced-ingress/

Supported Values in pkiConfiguration

For more information about the described fields please see the API documentation of Vault.

Change Adjustment Callback

For more details please see Change Detection!

Last updated