-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vault: document serviceAccountRef with an external Vault #1455
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -361,7 +361,9 @@ Kubernetes service account token can be provided in two ways: | |
- [Secretless Authentication with a Service Account](#secretless-authentication-with-a-service-account) (recommended), | ||
- [Authentication with a Static Service Account Token](#static-service-account-token). | ||
|
||
#### Secretless Authentication with a Service Account | ||
<a name="static-service-account-token"></a> | ||
|
||
#### Secretless Authentication with a Service Account (In-Cluster Vault) | ||
|
||
ℹ️ This feature is available in cert-manager >= v1.12.0. | ||
|
||
|
@@ -464,7 +466,47 @@ needs to talks to Vault. | |
Although it is not recommended, you can also use the same Vault role for all of | ||
your Issuers and ClusterIssuers by omitting the `audience` field and re-using | ||
the same service account. | ||
<a name="static-service-account-token"></a> | ||
|
||
#### Secretless Authentication with a Service Account (External Vault) | ||
|
||
If you are using a Vault instance external to your cluster, you will need to set | ||
the `audiences` to an audience accepted by your Kubernetes cluster. When using | ||
an external Vault instance, the short-lived token created by cert-manager to | ||
authenticate to Vault will be used by Vault for authenticating to Kubernetes. | ||
First, find what your cluster's issuer is: | ||
|
||
```sh | ||
kubectl get --raw /.well-known/openid-configuration | jq .issuer -r | ||
``` | ||
|
||
Then, set the `audiences` field to the issuer URL: | ||
|
||
```yaml | ||
apiVersion: cert-manager.io/v1 | ||
kind: Issuer | ||
metadata: | ||
name: vault-issuer | ||
namespace: sandbox | ||
spec: | ||
vault: | ||
path: pki_int/sign/example-dot-com | ||
server: https://vault.local | ||
auth: | ||
kubernetes: | ||
role: my-app-1 | ||
mountPath: /v1/auth/kubernetes | ||
serviceAccountRef: | ||
name: vault-issuer | ||
audiences: [https://kubernetes.default.svc.cluster.local] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't the audiences also include something like vault to tighten the integration? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The default "computed" audience (e.g., There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah yeah, perhaps I would add a sentence to say that the default behavior will also include There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
``` | ||
|
||
When using `audiences`, the JWT will still include the generated audience | ||
`vault://namespace/issuer-name` or `vault://cluster-issuer`. The generated | ||
audience is useful for restricting access to a Vault role to a certain issuer. | ||
|
||
When configuring the Kubernetes Vault auth method, omit the `token_reviewer_jwt` | ||
parameter so that Vault uses the token provided by cert-manager to authenticate | ||
with the Kubernetes API server when reviewing the token. | ||
|
||
#### Authentication with a Static Service Account Token | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maelvls I just realized we need to add a little footnote to say this feature is available starting cert-manager 1.15 (just like it says for the above paragraph line 366