-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
capi docs: add intermediate ca how-to
We're adding a guide that shows how intermediate CAs can be generated using HashiCorp Vault and passed to CAPI using management cluster secrets.
- Loading branch information
1 parent
c24d820
commit da0cc23
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# How to use intermediate CAs with Vault | ||
|
||
By default, the ClusterAPI provider will generate self-signed CA certificates | ||
for the workload clusters. | ||
|
||
Follow this guide to prepare an intermediate Certificate Authority (CA) using | ||
HashiCorp Vault and then configure ClusterAPI to use the generated certificates. | ||
|
||
## Preparing Vault | ||
|
||
For the purpose of this guide, we are going to install HashiCorp Vault using | ||
snap and start a Vault server in development mode. | ||
|
||
```bash | ||
sudo snap install vault | ||
vault server -dev & | ||
``` | ||
|
||
Specify the vault address through an environment variable: | ||
|
||
```bash | ||
export VAULT_ADDR=http://localhost:8200 | ||
``` | ||
|
||
Enable the PKI secrets engine and set the maximum lease time to 10 years | ||
(87600 hours): | ||
|
||
```bash | ||
vault secrets enable pki | ||
vault secrets tune -max-lease-ttl=87600h pki | ||
``` | ||
|
||
## Generating the CA certificates | ||
|
||
Generate the root CA certificate: | ||
|
||
```bash | ||
vault write -format=json pki/root/generate/internal \ | ||
common_name=vault \ | ||
ttl=87600h \ | ||
> root_ca.json | ||
``` | ||
|
||
Generate the intermediate CA certificate. We need the resulting Certificate | ||
Signing Request (CSR) and private key, so for convenience we'll use JSON | ||
formatting. |