Skip to content
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

docs: add docs for certificates management #296

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions website/docs/install/certificates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Certificates management

The Kyverno Authz Server comes with a validation webhook and needs a valid certificate to let the api server call into it.

At deployment time you can either provide your own certificate or use [cert-manager](https://cert-manager.io) to create one for the Kyverno Authz Server.

## Bring your own

If you want to bring your own certificate, you can set `certificates.static` values when installing the helm chart.

```bash
# create certificate
openssl req -new -x509 \
-subj "/CN=kyverno-authz-server-validation.kyverno.svc" \
-addext "subjectAltName = DNS:kyverno-authz-server-validation.kyverno.svc" \
-nodes -newkey rsa:4096 -keyout tls.key -out tls.crt

# install chart with static certificate
helm install kyverno-authz-server \
--namespace kyverno --create-namespace \
--wait \
--repo https://kyverno.github.io/kyverno-envoy-plugin kyverno-authz-server \
--set-file certificates.static.crt=tls.crt \
--set-file certificates.static.key=tls.key
```

## Use cert-manager

If you don't want to manage the certificate yourself you can rely on [cert-manager](https://cert-manager.io) to create the certificate for you and inject it in the webhook configuration.

```bash
# install cert-manager
helm install cert-manager \
--namespace cert-manager --create-namespace \
--wait \
--repo https://charts.jetstack.io cert-manager \
--set crds.enabled=true

# create a certificate issuer
kubectl apply -f - <<EOF
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: selfsigned-issuer
spec:
selfSigned: {}
EOF

# install chart with managed certificate
helm upgrade --install kyverno-authz-server \
--namespace kyverno --create-namespace \
--wait \
--repo https://kyverno.github.io/kyverno-envoy-plugin kyverno-authz-server \
--set certificates.certManager.issuerRef.group=cert-manager.io \
--set certificates.certManager.issuerRef.kind=ClusterIssuer \
--set certificates.certManager.issuerRef.name=selfsigned-issuer
```
2 changes: 2 additions & 0 deletions website/docs/quick-start/authz-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ spec:
EOF
```

For more certificate management options, refer to [Certificates management](../install/certificates.md).

### Deploy the Kyverno Authz Server

Now we can deploy the Kyverno Authz Server.
Expand Down
2 changes: 2 additions & 0 deletions website/docs/tutorials/envoy-gateway/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ spec:
EOF
```

For more certificate management options, refer to [Certificates management](../../install/certificates.md).

### Deploy the Kyverno Authz Server

Now deploy the Kyverno Authz Server.
Expand Down
2 changes: 2 additions & 0 deletions website/docs/tutorials/istio/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ spec:
EOF
```

For more certificate management options, refer to [Certificates management](../../install/certificates.md).

### Deploy the Kyverno Authz Server

Now we can deploy the Kyverno Authz Server.
Expand Down
2 changes: 2 additions & 0 deletions website/mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ nav:
- quick-start/authz-server.md
- quick-start/sidecar-injector.md
- quick-start/next-steps.md
- Install:
- install/certificates.md
- Policies:
- policies/index.md
- policies/failure-policy.md
Expand Down
Loading