Skip to navigation

Configure Webhook Certificates

View as MarkdownOpen in Claude

The admission webhook of the Karta Operator is served over TLS, so the API server needs a serving certificate that it trusts. The Helm chart provisions this certificate in one of two modes. You select the mode with the webhook.cert.provisionMode value.

Most installations need no action. The default mode creates and renews the certificate for you. Change the mode only if your environment requires you to supply the certificate, for example from a corporate CA.

The webhook exists only when the Karta Operator and the webhook are both enabled in the chart. These are the operator.enabled and webhook.enabled values, and both are true by default.

Prerequisites

  • The Karta Operator installed with the Helm chart, or ready to install. For more information, refer to Installation.
  • For the cert-manager option, cert-manager installed in the cluster.

The commands on this page use the chart in a clone of the repository, charts/karta. To use the published chart, replace charts/karta with oci://ghcr.io/dsx-ai-factory/workload-map/karta, and add --version <version>.

The names on this page, such as karta-operator-webhook-cert, are the names that the chart creates by default. If you set fullnameOverride in the chart values, the karta-operator prefix of these names changes to your override.

Use the Automatic Mode

The auto mode is the default:

webhook:
enabled: true
cert:
provisionMode: auto

In auto mode, the Karta Operator does the following:

  • It self-signs the serving certificate.
  • It writes the certificate to the karta-operator-webhook-cert Secret.
  • It patches the CA bundle onto the webhook configurations.
  • It rotates the certificate before it expires.

You do not need cert-manager, and you do not need to take any action. This mode is the recommended default.

Use the Manual Mode

To supply the certificate yourself, set the mode to manual:

webhook:
enabled: true
cert:
provisionMode: manual

In manual mode, the Karta Operator does not touch certificates. It only reads the serving certificate from the mounted Secret. The chart renders no cert-manager objects, so you can use any external provider. Two values connect the provider:

  • webhook.cert.annotations adds annotations to both webhook configurations. Use it to let a controller inject the CA bundle, for example the cainjector of cert-manager.
  • webhook.cert.caBundle is a base64-encoded CA bundle that the chart stamps directly onto both webhook configurations. Use it when no injector is available.

The Karta Operator mounts the Secret named karta-operator-webhook-cert. The Secret that you provide must use that name, and it must contain tls.crt and tls.key.

Required Subject Alternative Names

The API server reaches the webhook through its Service. The certificate must therefore be valid for both of the following names. Replace <namespace> with the release namespace:

karta-operator-webhook.<namespace>.svc
karta-operator-webhook.<namespace>.svc.cluster.local

Use cert-manager

Create an issuer and a Certificate that writes the serving Secret:

apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: karta-selfsigned
namespace: <namespace>
spec:
selfSigned: {}
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: karta-operator-webhook-cert
namespace: <namespace>
spec:
secretName: karta-operator-webhook-cert
dnsNames:
- karta-operator-webhook.<namespace>.svc
- karta-operator-webhook.<namespace>.svc.cluster.local
issuerRef:
kind: Issuer
name: karta-selfsigned

The selfSigned issuer in this example signs the certificate directly. To use a corporate CA or Vault instead, point issuerRef at your own Issuer or ClusterIssuer.

Then install the chart in manual mode, and let the cainjector patch the CA bundle:

helm upgrade -i karta charts/karta -n <namespace> \
--set webhook.cert.provisionMode=manual \
--set webhook.cert.annotations."cert-manager\.io/inject-ca-from"=<namespace>/karta-operator-webhook-cert

The annotation value is <namespace>/<certificate-name>. It points at the Certificate resource, not at the Secret.

Use a Static CA Bundle

If no injector is available, create the serving Secret yourself, and pass the CA bundle to the chart:

helm upgrade -i karta charts/karta -n <namespace> \
--set webhook.cert.provisionMode=manual \
--set webhook.cert.caBundle="$(base64 -w0 < ca.crt)"

The Secret named karta-operator-webhook-cert must exist and hold the serving tls.crt and tls.key. The caBundle value must be the base64-encoded CA that signed tls.crt.

The -w0 option is specific to GNU base64. On macOS, use base64 < ca.crt | tr -d '\n' instead.

Understand What Happens When the Webhook Is Unavailable

Both webhook configurations use failurePolicy: Fail. If the API server cannot reach the webhook, it rejects the creation or the update of a Karta definition. This makes the labeling and the validation authoritative, but it means that the Karta Operator must be running, and the serving certificate must be ready, before you create a definition. In auto mode, the Karta Operator provisions the certificate. In manual mode, the external Secret must exist.

Run the Karta Operator with more than one replica, so that the webhook keeps answering during rolling updates. Set replicaCount to a value above 1, and set leaderElection.enabled to true. The chart does not render with more than one replica unless leader election is enabled.

The webhook applies only to Karta definitions. It does not affect your workloads. The reconciler also stamps the same group, version, and kind labels on definitions that were created while the webhook was disabled.

Values Reference

ValueDefaultPurpose
webhook.enabledtrueEnables the admission webhook and all its resources.
webhook.cert.provisionModeautoauto (the Karta Operator self-signs and rotates) or manual (external certificates).
webhook.cert.annotations{}Manual mode. Annotations for the webhook configurations, for example cert-manager.io/inject-ca-from.
webhook.cert.caBundle""Manual mode. Base64-encoded CA bundle stamped onto the webhook configurations.

For all chart values, refer to Helm Chart Values.