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:

This is only a test pki, for info how to generate a more secure pki please read the manual of HashiCorp Vault!

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

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

apiVersion: ""
kind: Vault
  name: test-pki
  path: "testpki/issue/testrole"
  type: "PKI"
    commonName: ""
    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:

$ kubectl get vault test-pki
NAME       AGE
test-pki   8d
$ kubectl get secret test-pki
NAME       TYPE      DATA      AGE
test-pki   Opaque    2         8d
$ kubectl get secret test-pki -o yaml
apiVersion: v1
  tls.crt: <certificate>
  tls.key: <key>
kind: Secret
  annotations: 2018-04-13T22:38Z 2018-04-14T00:31:42.889
  creationTimestamp: 2018-04-13T22:16:03Z
  name: test-pki
  namespace: default
  resourceVersion: "1791800"
  selfLink: /api/v1/namespaces/default/secrets/test-pki
  uid: 40eaddf8-3f68-11e8-8433-b2b7401505d0
type: Opaque

Supported Values in pkiConfiguration

  commonName: ""
  altNames: ""
  ipSans: ""
  ttl: "8h"

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