Restoring Kubernetes’ ability to sign certificates

Note

Requires at least version 6.0

Since Tarook migrated to Hashicorp Vault for managing PKI and therefore clears the Kubernetes cluster root CA key from the control plane, Tarook clusters are not able to respond to certificate signing requests (CSRs) anymore since access to PKI keys ceased. [1]

While in the long term we want to integrate Vault via a Kubernetes custom signer [2] which would redirect CSRs in Kubernetes directly to Vault, for now we provide a workaround fix to restore the CSR functionality. The fix must be explicitly turned on by setting yk8s.kubernetes.controller_manager.enable_signing_requests to true.

Enabling the fix

Attention

This weakens the security of your deployment!

  1. Enable signing requests in the config

    Set yk8s.kubernetes.controller_manager.enable_signing_requests = true in the config

  2. Configure k8s_control_plane Vault policy

    Executing ‘tools/vault/init.sh’ will take care of that. This assumes you already have a Vault instance running and reachable from your Tarook shell environment.

    Note

    Requires a Vault root token

    ./managed-k8s/tools/vault/init.sh
    

    The Kubernetes cluster root CA key is made available through the k8s-pki/cluster-root-ca secret in the Vault kv2 store of the cluster. The script adds a Vault policy rule (among other things) that grants read-only access to it for the control plane nodes role.

  1. Create the Kubernetes cluster root CA and backup its key

    Executing ‘tools/vault/mkcluster-root.sh’ will take care of that.

    Note

    Requires a Vault root token

    ./managed-k8s/tools/vault/mkcluster-root.sh
    

    The script creates the Kubernetes cluster root CA and backs up its private key to k8s-pki/cluster-root-ca in the Vault kv2 store of the cluster [3].

  2. Build the cluster using the apply-all action

    This will copy and configure the Kubernetes cluster root CA key from Vault’s kv2 store on all control plane nodes.

  1. Optional: Check that certificate signing is functional again now

    See the Kubernetes documentation on how to do that.

Disabling the fix

  1. Set yk8s.kubernetes.controller_manager.enable_signing_requests = true in the config

  1. Nothing to care about, go ahead as normal