This repository has been archived by the owner on Jul 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #149 from external-secrets/docs/vault
feat(docs): add basic docs for vault
- Loading branch information
Showing
9 changed files
with
530 additions
and
20 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1,46 @@ | ||
![HCP Vault](./pictures/diagrams-provider-vault.png) | ||
|
||
!!! bug "Not implemented" | ||
This is currently **not yet** implemented. Feel free | ||
to contribute. Please see [issue#21](https://github.com/external-secrets/external-secrets/issues/21) | ||
for futher information. | ||
## Hashicorp Vault | ||
|
||
External Secrets Operator integrates with [HashiCorp Vault](https://www.vaultproject.io/) for secret | ||
management. Vault itself implements lots of different secret engines, as of now we only support the | ||
[KV Secrets Engine](https://www.vaultproject.io/docs/secrets/kv). | ||
|
||
### Authentication | ||
|
||
We support three different modes for authentication: | ||
[token-based](https://www.vaultproject.io/docs/auth/token), | ||
[appRole](https://www.vaultproject.io/docs/auth/approle) and | ||
[kubernetes-native](https://www.vaultproject.io/docs/auth/kubernetes), each one comes with it's own | ||
trade-offs. Depending on the authentication method you need to adapt your environment. | ||
|
||
#### Token-based authentication | ||
|
||
A static token is stored in a `Kind=Secret` and is used to authenticate with vault. | ||
|
||
```yaml | ||
{% include 'vault-token-store.yaml' %} | ||
``` | ||
|
||
#### AppRole authentication example | ||
|
||
[AppRole authentication](https://www.vaultproject.io/docs/auth/approle) reads the secret id from a | ||
`Kind=Secret` and uses the specified `roleId` to aquire a temporary token to fetch secrets. | ||
|
||
```yaml | ||
{% include 'vault-approle-store.yaml' %} | ||
``` | ||
|
||
#### Kubernetes authentication | ||
|
||
[Kubernetes-native authentication](https://www.vaultproject.io/docs/auth/kubernetes) has three | ||
options of optaining credentials for vault: | ||
|
||
1. by using a service account jwt referenced in `serviceAccountRef` | ||
2. by using the jwt from a `Kind=Secret` referenced by the `secretRef` | ||
3. by using transient credentials from the mounted service account token within the | ||
external-secrets operator | ||
|
||
```yaml | ||
{% include 'vault-kubernetes-store.yaml' %} | ||
``` |
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,24 @@ | ||
apiVerson: external-secrets.io/v1alpha1 | ||
kind: SecretStore | ||
metadata: | ||
name: vault-backend | ||
namespace: example | ||
spec: | ||
provider: | ||
vault: | ||
server: "https://vault.acme.org" | ||
path: "secret" | ||
version: "v2" | ||
auth: | ||
# VaultAppRole authenticates with Vault using the | ||
# App Role auth mechanism | ||
# https://www.vaultproject.io/docs/auth/approle | ||
appRole: | ||
# Path where the App Role authentication backend is mounted | ||
path: "approle" | ||
# RoleID configured in the App Role authentication backend | ||
roleId: "db02de05-fa39-4855-059b-67221c5c2f63" | ||
secretRef: | ||
name: "my-secret" | ||
namespace: "secret-admin" | ||
key: "vault-token" |
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,31 @@ | ||
apiVerson: external-secrets.io/v1alpha1 | ||
kind: SecretStore | ||
metadata: | ||
name: vault-backend | ||
namespace: example | ||
spec: | ||
provider: | ||
vault: | ||
server: "https://vault.acme.org" | ||
path: "secret" | ||
version: "v2" | ||
auth: | ||
# Authenticate against Vault using a Kubernetes ServiceAccount | ||
# token stored in a Secret. | ||
# https://www.vaultproject.io/docs/auth/kubernetes | ||
kubernetes: | ||
# Path where the Kubernetes authentication backend is mounted in Vault | ||
mountPath: "kubernetes" | ||
# A required field containing the Vault Role to assume. | ||
role: "demo" | ||
# Optional service account field containing the name | ||
# of a kubernetes ServiceAccount | ||
serviceAccountRef: | ||
name: "my-sa" | ||
namespace: "secret-admin" | ||
# Optional secret field containing a Kubernetes ServiceAccount JWT | ||
# used for authenticating with Vault | ||
secretRef: | ||
name: "my-secret" | ||
namespace: "secret-admin" | ||
key: "vault" |
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,18 @@ | ||
apiVerson: external-secrets.io/v1alpha1 | ||
kind: SecretStore | ||
metadata: | ||
name: vault-backend | ||
namespace: example | ||
spec: | ||
provider: | ||
vault: | ||
server: "https://vault.acme.org" | ||
path: "secret" | ||
version: "v2" | ||
auth: | ||
# points to a secret that contains a vault token | ||
# https://www.vaultproject.io/docs/auth/token | ||
tokenSecretRef: | ||
name: "my-secret" | ||
namespace: "secret-admin" | ||
key: "vault-token" |
Oops, something went wrong.