Skip to content
Configuration reference

Configuration reference

kornercode is deployed with one Helm chart, kornercode (config/helm). It installs the CustomResourceDefinitions, the controller Deployment, its RBAC, the admission webhook configuration, optionally the internal certificate authority used for mTLS, and the gateway (dashboard and reverse proxy). Values are grouped by component: mtls is shared and sits at the top level, operator settings live under operator: and gateway settings under gateway:. The gateway binary is configured entirely through environment variables; the chart sets them from Helm values, and variables the chart does not model can be added through gateway.env. Defaults below are quoted from the chart values file and the source code. “Empty” means an empty string, and “unset” means the key is not present in values.yaml but is read by a template when you provide it.

Chart name kornercode, chart version 0.0.0, appVersion 0.0.0.

helm upgrade --install kornercode config/helm \
  --namespace kornercode --create-namespace

Shared values

KeyDefaultDescription
mtls.enabledfalseEnables mTLS between the gateway and workspace pods, for the operator and the gateway at once. Renders the internal CA resources and the gateway certificate, and sets MTLS_ENABLED on both components (and MTLS_ISSUER_NAME on the operator, MTLS_CERT_DIR and GATEWAY_TLS_ENABLED on the gateway). See mTLS.
mtls.certManagerNamespacecert-managerNamespace of the internal CA Certificate (kornercode-internal-ca). Must be cert-manager’s cluster resource namespace, because a CA ClusterIssuer reads its Secret from there.
mtls.issuerNamekornercode-internal-ca-issuerWritten to MTLS_ISSUER_NAME when mtls.enabled is true: the ClusterIssuer that signs per-workspace certificates. The chart always names the issuer it creates kornercode-internal-ca-issuer; any other value must name an issuer you provide.
mtls.certDir/etc/kornercode/tlsMount path of the kornercode-gateway-mtls Secret and value of the gateway’s MTLS_CERT_DIR. Used only when mtls.enabled is true.
mtls.gatewayTLSEnabledtrueOnly takes effect when mtls.enabled is true. The gateway then serves HTTPS on 8443 with its mTLS certificate (GATEWAY_TLS_ENABLED); the probes, the Service’s https port and the Ingress backends use 8443, the Ingress gets the annotation traefik.ingress.kubernetes.io/backend-protocol: HTTPS, and the chart renders the Traefik ServersTransport kornercode-gateway-tls. Otherwise the gateway serves plain HTTP on 8080.

Restrictions (restrictions:)

A top-level block, without a component prefix. Each key forces one restriction on for every team; teams can add their own in Team.spec.restrictions. All default to false. See Restrictions.

KeyDefaultDescription
restrictions.blockAdminIDEAccessfalseAdmins can’t open the IDE of any workspace.
restrictions.disableTestEndpointfalseNo workspace has a test endpoint.
restrictions.disableFileDownloadsfalseAdds code-server --disable-file-downloads.
restrictions.disableFileUploadsfalseAdds code-server --disable-file-uploads.
restrictions.disableProxyfalseAdds code-server --disable-proxy.
restrictions.disableWorkspaceTrustfalseAdds code-server --disable-workspace-trust.
restrictions.disableGettingStartedOverridefalseAdds code-server --disable-getting-started-override.

An unknown key makes helm template and helm install fail. The chart renders the keys set to true as the comma-separated PLATFORM_RESTRICTIONS environment variable on the operator (in the kornercode-operator-controller-default-env ConfigMap, whose checksum annotation rolls the operator when it changes) and on the gateway container. Either binary exits at start-up on an unknown name. Setting PLATFORM_RESTRICTIONS through gateway.env also fails the render, since it would override this value.

Client certificate values (clientCertificates:)

A top-level block, without a component prefix. It turns on the client-certificate gate: every request to the dashboard, dev and test hosts needs a company client certificate whose CN matches the signed-in person. Off by default. Procedures are in the admin guide. When enabled, the chart renders a cert-manager Certificate kornercode-ingress-client for the ingress client certificate (from kornercode-internal-ca-issuer, so the internal CA is rendered even with mtls.enabled: false), the Service kornercode-gateway-client-cert on port 8444, and the NetworkPolicy kornercode-gateway-client-cert; the main Ingress routes all three hosts to that Service. For headerDialect: traefik it also renders the ServersTransport kornercode-gateway-client-cert, the TLSOption kornercode-client-cert and the Middlewares kornercode-client-cert-strip and kornercode-client-cert-pass, attached to the main Ingress. The render fails, naming the value, when a required value is missing or invalid.

KeyDefaultDescription
clientCertificates.enabledfalseSets CLIENT_CERT_ENABLED. Turns the gate on. When off, none of the objects above exist and the gateway behaves as without the feature.
clientCertificates.companyCA.existingSecretemptyRequired. Secret in the release namespace with the key ca.crt (company roots and intermediates). Mounted for CLIENT_CERT_COMPANY_CA_FILE; the Traefik TLSOption also uses it. Changing its contents does not restart the gateway: restart it after a rotation.
clientCertificates.headerDialecttraefikSets CLIENT_CERT_HEADER_DIALECT. How the ingress passes the client certificate: traefik (X-Forwarded-Tls-Client-Cert), nginx (Ssl-Client-Escaped-Cert, URL-encoded PEM) or envoy-xfcc (X-Forwarded-Client-Cert). The Traefik objects are rendered only for traefik, which also requires gateway.ingress.tls.enabled and gateway.ingress.tls.secretName, because the TLSOption’s strict SNI ignores the default certificate. For the other dialects, configure the ingress controller yourself (see the admin guide).
clientCertificates.revocation.onUnavailabledenySets CLIENT_CERT_CRL_ON_UNAVAILABLE. deny or allow: what to do when revocation status cannot be determined, for every user and request, break-glass included. With deny, a CRL outage that outlasts the cached lists locks everyone out, administrators included. With allow, the request goes through and is audited as revocation: unchecked. Integrity failures always deny.
clientCertificates.revocation.timeout10sSets CLIENT_CERT_CRL_TIMEOUT. Per-fetch timeout for a CRL.
clientCertificates.revocation.minRefresh5mSets CLIENT_CERT_CRL_MIN_REFRESH. Minimum time between fetches of the same CRL.
clientCertificates.revocation.allowedHosts[]Sets CLIENT_CERT_CRL_ALLOWED_HOSTS (comma-joined). CRL hosts the gateway may contact; empty means no constraint.
clientCertificates.networkPolicy.enabledtrueRenders a NetworkPolicy that admits only the ingress namespace to port 8444. The other gateway ports stay open as before.
clientCertificates.networkPolicy.ingressNamespacetraefikNamespace of the ingress controller pods.

Variables the chart does not expose as values:

VariableDefaultDescription
CLIENT_CERT_ADDR:8444Listen address of the client-certificate listener, the only listener that serves the dashboard, dev and test hosts when the gate is on. The chart sets :8444.
CLIENT_CERT_TLS_DIR/etc/kornercode/tlsDirectory with the gateway serving certificate and the internal CA (tls.crt, tls.key, ca.crt). The chart sets it to mtls.certDir.
CLIENT_CERT_INGRESS_IDENTITYkornercode-ingressDNS SAN the ingress client certificate must carry.
CLIENT_CERT_COMPANY_CA_FILEnoneRequired with the gate on. Path of the company CA bundle. The chart mounts the Secret and sets this.

Without the chart, CLIENT_CERT_ENABLED must be exactly true; a missing required variable or an invalid value stops the gateway at start-up.

Break-glass values (breakGlass:)

A top-level block. A non-empty mapping adds the break-glass button, an administrator sign-in with the client certificate alone that never contacts the identity provider. It requires clientCertificates.enabled: a mapping without the gate fails the render. Procedures are in the admin guide.

KeyDefaultDescription
breakGlass.mapping[]Mounted from the ConfigMap kornercode-break-glass-mapping for BREAK_GLASS_MAPPING_FILE. Empty means no break-glass. Each entry has cn, sub, username (required), email and groups (optional). cn and sub must be unique. cn, sub, username and email must be quoted strings; the render refuses numbers, so use --set-string on the command line. Changing the mapping restarts the gateway through a checksum annotation.
breakGlass.sessionMaxLifetimeSeconds28800Sets BREAK_GLASS_SESSION_MAX_LIFETIME_SECONDS. Maximum lifetime of a break-glass session, on every host. Must be a positive whole number.

Without the chart, BREAK_GLASS_MAPPING_FILE is the path of the mapping JSON; setting it while CLIENT_CERT_ENABLED is not true stops the gateway at start-up.

Image pull secrets (imagePullSecrets)

A top-level list, empty by default. Each entry names a Secret of type kubernetes.io/dockerconfigjson in the release namespace; the operator and gateway pods pull their images with them, for a private registry or mirror. Workspace pods do not use them.

imagePullSecrets:
  - name: registry-pull

Operator values (operator:)

KeyDefaultDescription
operator.image.repositoryregistry.gitlab.com/kornercloud.dev/kornercodeImage prefix. The full reference is <repository>/<controller>:<tag>, for example registry.gitlab.com/kornercloud.dev/kornercode/kornercode-controller:v0.1.0.
operator.image.tag""Image tag. When empty, v<appVersion> from Chart.yaml: the images released with the chart.
operator.image.pullPolicyIfNotPresentContainer image pull policy.
operator.controllersone entry, kornercode-controllerOne Deployment, metrics Service and webhook Service is rendered per entry. The entry key is part of the resource names and of the image name. The webhook configurations reference <fullname>-kornercode-controller-webhook-svc, so keep the key kornercode-controller.
operator.controllers.kornercode-controller.replicaCount1Deployment replicas (1 when unset). The chart enables leader election, so extra replicas stand by.
operator.controllers.kornercode-controller.args[]Extra container arguments, appended after the chart-managed --metrics-bind-address=:8080 and --metrics-secure flags. See Operator flags.
operator.controllers.kornercode-controller.resourcesrequests cpu: 50m, memory: 64Mi; limits cpu: 500m, memory: 256MiContainer resource requests and limits.
operator.controllers.kornercode-controller.tolerations[]Pod tolerations.
operator.controllers.kornercode-controller.nodeSelector{}Pod node selector.
operator.controllers.kornercode-controller.affinity{}Pod affinity.
operator.controllers.kornercode-controller.envFromunsetAdditional envFrom sources, appended after the chart’s ConfigMap.
operator.controllers.kornercode-controller.volumeMountsunsetAdditional container volume mounts.
operator.controllers.kornercode-controller.volumesunsetAdditional pod volumes.
operator.global.logLevelinfoWritten to LOG_LEVEL in the <fullname>-controller-default-env ConfigMap. The operator binary does not read LOG_LEVEL; use --zap-log-level in args to change verbosity.
operator.global.clusterNameemptyWritten to CLUSTER_NAME, the default for --cluster-name. Used as the cluster label on workspace resource metrics.
operator.global.webhookCertificatesPath/etc/ssl/certs/webhookWritten to WEBHOOK_CERTIFICATES_PATH, the default for --webhook-cert-path. The webhook certificate Secret is always mounted at /etc/ssl/certs/webhook; a different value requires a matching mount through volumes and volumeMounts.
operator.workspaceRBAC.enabledtrueRenders a read-only Role and a RoleBinding for the workspace runner ServiceAccount in the release namespace (pods, logs, services, PVCs, events, and the code.kornercloud.dev workspaces, workspace profiles and teams).
operator.workspaceRBAC.devServiceAccountNameworkspace-runnerName of that Role, RoleBinding and bound ServiceAccount. The operator creates workspace ServiceAccounts under the fixed name workspace-runner.
operator.workspaceRBAC.adminServiceAccountNameworkspace-adminNot used by any template.
operator.metrics.securefalsePassed as --metrics-secure. When true, /metrics is served over HTTPS behind Kubernetes authentication and authorization. See Prometheus.
operator.metrics.serviceMonitor.enabledfalseRenders a ServiceMonitor (monitoring.coreos.com/v1) per controller that scrapes the metrics port at /metrics over HTTP. Requires the Prometheus Operator CRDs.
operator.metrics.serviceMonitor.interval30sScrape interval (30s when empty).
operator.metrics.serviceMonitor.scrapeTimeoutunsetScrape timeout; omitted when unset.
operator.metrics.serviceMonitor.metricRelabelingsunsetEndpoint metricRelabelings; omitted when unset.
operator.metrics.serviceMonitor.labelsunsetLabels added to the ServiceMonitor, for example to match a Prometheus serviceMonitorSelector.
operator.nameOverrideunsetReplaces the chart name when computing the full name.
operator.fullnameOverrideunsetReplaces the full name. By default the operator’s full name is kornercode-operator (the release name kornercode plus the suffix -operator).

Fixed behavior that is not exposed as values:

  • Container ports are 8080 (metrics), 9443 (webhook) and 8081 (health). Liveness uses /healthz and readiness uses /readyz, both on port 8081.
  • The pod also receives NAMESPACE and POD_NAME from the downward API and all keys of the <fullname>-controller-default-env ConfigMap through envFrom.
  • The ServiceAccount is always kornercode-operator. The cluster-scoped ClusterRole kornercode-manager-role and ClusterRoleBinding kornercode-manager-role-binding have fixed names, as do the mTLS ClusterIssuers, so install one release of the chart per cluster.
  • The CRDs are rendered from templates/crds/. They are installed and upgraded with the release and annotated helm.sh/resource-policy: keep, so helm uninstall leaves them, and every Workspace, Team, WorkspaceProfile and SecurityProfile, in place.
  • The local environment installs the chart with hack/local-dev/values.yaml, which sets operator.global.clusterName: "mycluster", operator.image.pullPolicy: Never and gateway.image.pullPolicy: Never (images are loaded into Kind) and mtls.enabled: true.

Operator flags

The controller binary is operator/cmd/controllers/kornercode. Flags use Go flag syntax. When a flag is repeated, the last occurrence wins, so flags passed through controllers.kornercode-controller.args override the chart-managed ones.

FlagDefaultDescription
--metrics-bind-address0Metrics listen address. 0 disables the metrics server. The chart sets :8080.
--metrics-securetrueServe metrics over HTTPS with Kubernetes authentication and authorization (TokenReview and SubjectAccessReview). --metrics-secure=false serves plain HTTP. The chart sets this from metrics.secure.
--metrics-cert-pathemptyDirectory that contains the metrics server certificate. When empty and metrics are secure, a self-signed certificate is generated at startup.
--metrics-cert-nametls.crtMetrics server certificate file name.
--metrics-cert-keytls.keyMetrics server key file name.
--health-probe-bind-address:8081Listen address for /healthz and /readyz.
--leader-electfalseEnable leader election (lease ID 11122337.code.kornercloud.dev). The chart always passes it, so only one replica reconciles, also during a rolling update. The leader releases the lease when it stops.
--webhook-cert-pathvalue of WEBHOOK_CERTIFICATES_PATH, empty if unsetDirectory that contains the webhook serving certificate. When empty, the controller-runtime default <temp dir>/k8s-webhook-server/serving-certs is used.
--webhook-cert-nametls.crtWebhook certificate file name.
--webhook-cert-keytls.keyWebhook key file name.
--enable-http2falseEnable HTTP/2 on the metrics and webhook servers. When false, both servers negotiate HTTP/1.1 only.
--cluster-namevalue of CLUSTER_NAME, empty if unsetValue of the cluster label on workspace resource metrics.
--namespaceemptyAccepted but not used.
--kubeconfigemptyPath to a kubeconfig file. Only required when running outside a cluster.
--zap-develtrueDevelopment logging: console encoder, debug level, stack traces from warn. --zap-devel=false selects the JSON encoder, info level and stack traces from error.
--zap-encoderderived from --zap-develLog encoding: json or console.
--zap-log-levelderived from --zap-develLog level: debug, info, error, panic, or an integer greater than 0 for increasing debug verbosity.
--zap-stacktrace-levelderived from --zap-develLevel at and above which stack traces are captured: info, error or panic.
--zap-time-encodingrfc3339Time encoding: epoch, millis, nano, iso8601, rfc3339 or rfc3339nano.

Operator environment variables

The chart sets these through the <fullname>-controller-default-env ConfigMap. Defaults are those of the binary when the variable is absent.

VariableRequiredDefaultDescription
CLUSTER_NAMENoemptyDefault for --cluster-name. Chart: operator.global.clusterName.
WEBHOOK_CERTIFICATES_PATHNoemptyDefault for --webhook-cert-path. Chart: operator.global.webhookCertificatesPath.
OPERATOR_NAMESPACENokornercodeNamespace the operator treats as its own. NetworkPolicies labeled code.kornercloud.dev/managed: "true" in this namespace are cloned into every Team namespace; a Team whose namespace equals it skips namespace creation and cloning. Chart: the release namespace.
MTLS_ENABLEDNofalseParsed with Go strconv.ParseBool; an unparsable value means false. Enables per-workspace certificates, the Envoy sidecar and the mTLS Service ports. Chart: mtls.enabled.
MTLS_ISSUER_NAMENokornercode-internal-ca-issuerClusterIssuer used for per-workspace certificates. Chart: mtls.issuerName, set only when mtls.enabled is true.
LOG_LEVELNononeSet by the chart from operator.global.logLevel. Not read by the binary.
NAMESPACE, POD_NAMENononeSet by the chart from the downward API. Not read by the binary.

Gateway values (gateway:)

Install the chart in the namespace that holds the gateway Secret.

KeyDefaultDescription
gateway.replicaCount1Deployment replicas.
gateway.image.repositoryregistry.gitlab.com/kornercloud.dev/kornercode/kornercode-gatewayImage repository. The full reference is <repository>:<tag>.
gateway.image.tag""Image tag. When empty, v<appVersion> from Chart.yaml: the image released with the chart.
gateway.image.pullPolicyIfNotPresentContainer image pull policy.
gateway.resourcesrequests cpu: 50m, memory: 64Mi; limits cpu: 500m, memory: 256MiContainer resource requests and limits.
gateway.hosts.kornercodeemptySets KORNERCODE_HOST. Required. Dashboard host as browsers see it; may include a port, for example dashboard.kornercode.local:8443. The Ingress uses it without the port.
gateway.hosts.devemptySets DEV_HOST. Required. Host that proxies to workspace code-server instances.
gateway.hosts.testemptySets TEST_HOST. Required. Host that proxies to the application on each workspace’s test port.
gateway.oidc.urlemptySets OIDC_URL. Required.
gateway.oidc.clientIDkornercode-gatewaySets OIDC_CLIENT_ID.
gateway.oidc.existingSecretkornercode-gateway-secretsSecret from which OIDC_CLIENT_SECRET and SESSION_SECRET are read. The key names are fixed.
gateway.oidc.identityClaimpreferred_usernameSets OIDC_IDENTITY_CLAIM. ID token claim compared with the client certificate’s CN (case-insensitive) when clientCertificates.enabled; unused otherwise.
gateway.oidc.groupsClaimgroupsSets OIDC_GROUPS_CLAIM. ID token claim holding the user’s groups, for teams and admin rights.
gateway.adminGroupsemptySets ADMIN_GROUPS. Empty disables admin access.
gateway.security.sessionDomainemptySets SESSION_DOMAIN. Empty issues host-only session cookies.
gateway.security.sessionMaxAgeSeconds28800Sets SESSION_MAX_AGE_SECONDS.
gateway.security.sessionMaxLifetimeSeconds86400Sets SESSION_MAX_LIFETIME_SECONDS.
gateway.ingress.enabledtrueRenders an Ingress named kornercode-gateway with one rule per host.
gateway.ingress.classNametraefikingressClassName of the Ingress.
gateway.ingress.annotations{}Ingress annotations, merged with the backend-protocol annotation added when the gateway serves TLS or the client-certificate gate is on. With the gate and headerDialect: traefik, the chart also sets the TLS option and middleware annotations; middlewares listed here are appended after the chart’s.
gateway.ingress.tls.enabledtrueAdds a TLS section that lists the three hosts.
gateway.ingress.tls.secretNameemptyTLS Secret for the Ingress. When empty, secretName is omitted and the ingress controller’s default certificate is used. Required with clientCertificates.enabled and headerDialect: traefik.
gateway.env{}Map of additional environment variables (NAME: value), appended after the chart-managed variables. Use it for variables the chart does not model, such as PROMETHEUS_URL and KORNERCODE_DISPLAY_NAME. PLATFORM_RESTRICTIONS is refused here (the render fails); set the restrictions: block instead.
gateway.hostAliases[]Pod hostAliases. Use it when the OIDC hostname must resolve to a different address inside the pod than in the browser.
gateway.service.port8080Port of the Service’s http port (target port 8080). The Ingress uses it as the backend port unless the gateway serves TLS.

Fixed behavior that is not exposed as values:

  • The Deployment, Service, ServiceAccount, Ingress, ClusterRole and ClusterRoleBinding are all named kornercode-gateway. The gateway authenticates to the Kubernetes API as the kornercode-gateway ServiceAccount, so install one release of the chart per cluster.
  • The Service always exposes the http port. Liveness and readiness probes call /healthz, which returns 200 for any Host header.

Example gateway values for a local Kind cluster (from hack/local-dev/values.yaml):

mtls:
  enabled: true

gateway:
  hosts:
    kornercode: dashboard.kornercode.local:8443
    dev: dev.kornercode.local
    test: test.kornercode.local

  oidc:
    url: "http://keycloak.kornercode.local:8080/realms/kornercode"

  adminGroups: "admins"

  ingress:
    className: traefik
    tls:
      secretName: ""

  hostAliases: []

The local bootstrap script fills gateway.hostAliases at install time with the Keycloak Service ClusterIP (--set gateway.hostAliases[0].ip=..., --set gateway.hostAliases[0].hostnames[0]=keycloak.kornercode.local), so that the gateway pod and the browser reach Keycloak under the same name.

Gateway environment variables

The gateway reads its configuration from the environment at startup. A required variable that is missing or empty stops the process. For optional variables, an empty value is treated the same as an unset one.

VariableRequiredDefaultDescription
OIDC_URLYesnoneOIDC provider URL, used both as the issuer for ID token verification and as the discovery base. It must be reachable from the gateway pod and must equal the iss claim of issued tokens. Discovery runs in the background and is retried until it succeeds; the gateway starts and serves existing sessions meanwhile. Chart: gateway.oidc.url.
OIDC_CLIENT_IDYesnoneOIDC client ID, also the expected ID token audience. Chart: gateway.oidc.clientID.
OIDC_CLIENT_SECRETYesnoneOIDC client secret. Chart: read from the gateway.oidc.existingSecret Secret.
SESSION_SECRETYesnoneKey from which the session cookie authentication and encryption keys are derived (HKDF-SHA256). Must be at least 32 bytes; the value is used as-is. A shorter value stops the gateway. Chart: read from the gateway.oidc.existingSecret Secret.
SESSION_DOMAINNoemptyDomain attribute of the session cookie. Empty issues host-only cookies, and the dev and test hosts obtain their own sessions from the dashboard. A parent-domain value (for example .kornercode.local) sends the session cookie to every sibling subdomain and is not recommended. Chart: gateway.security.sessionDomain.
SESSION_MAX_AGE_SECONDSNo28800How long a session stays valid without activity, in seconds; active sessions are renewed. A non-numeric, zero or negative value falls back to 28800. Chart: gateway.security.sessionMaxAgeSeconds.
SESSION_MAX_LIFETIME_SECONDSNo86400Maximum lifetime of a login in seconds, renewals included. After it the user signs in again, which also picks up group changes from the IdP. A non-numeric, zero or negative value falls back to 86400. Chart: gateway.security.sessionMaxLifetimeSeconds.
ADMIN_GROUPSNoemptyComma-separated group names. Users whose ID token groups claim (OIDC_GROUPS_CLAIM) contains one of them are administrators. Surrounding whitespace is ignored. Empty disables admin access. Chart: gateway.adminGroups.
OIDC_IDENTITY_CLAIMNopreferred_usernameID token claim compared with the client certificate’s CN at sign-in when the client-certificate gate is on. Chart: gateway.oidc.identityClaim.
OIDC_GROUPS_CLAIMNogroupsID token claim holding the user’s groups: a list of strings or a single string. Chart: gateway.oidc.groupsClaim.
KORNERCODE_HOSTYesnoneDashboard host as browsers see it, optionally with a port (for example dashboard.kornercode.local:8443). The full value, port included, builds the OIDC redirect URL https://<KORNERCODE_HOST>/auth/callback and the login URL https://<KORNERCODE_HOST>/auth/login that the dev and test hosts redirect to. The host without its port is used for routing and Origin checks. Chart: gateway.hosts.kornercode.
DEV_HOSTYesnoneHost on which authenticated requests are proxied to the user’s code-server pod. Any port is stripped. Chart: gateway.hosts.dev.
TEST_HOSTYesnoneHost on which authenticated requests are proxied to the user’s application on the workspace test port. Any port is stripped. Chart: gateway.hosts.test.
PORTNo8080Listen port. With gateway TLS enabled, HTTPS listens on this port, or on 8443 when the value is 8080, and a plain HTTP listener stays on 8080. With the client-certificate gate on, these listeners answer only /healthz (and 404 otherwise); the hosts are served on CLIENT_CERT_ADDR. Not set by the chart.
METRICS_PORTNo9090Port of a separate listener that serves the gateway’s own Prometheus metrics at /metrics. Not set or exposed by the chart.
KORNERCODE_DISPLAY_NAMENoKornercodeProduct name shown on the login page (HTML-escaped). Set it through gateway.env.
PROMETHEUS_URLNoemptyBase URL of a Prometheus server (scheme, host and port), for example http://prometheus.monitoring.svc:9090. Enables usage data and the Statistics charts. A value without a host stops the gateway at startup. Set it through env. See Prometheus.
MTLS_ENABLEDNofalsetrue (exact string) enables mTLS to workspace pods. The gateway loads tls.crt, tls.key and ca.crt from MTLS_CERT_DIR at startup, stops if they cannot be loaded, and reloads them every 5 minutes. Code-server traffic uses mTLS; test-port traffic uses TLS with server verification. Chart: mtls.enabled.
MTLS_CERT_DIRNo/etc/kornercode/tlsDirectory containing tls.crt, tls.key and ca.crt. Chart: mtls.certDir, set only when mtls.enabled is true.
GATEWAY_TLS_ENABLEDNofalsetrue (exact string) serves HTTPS with the certificate from MTLS_CERT_DIR. Ignored unless MTLS_ENABLED is also true. Chart: mtls.gatewayTLSEnabled, set only when mtls.enabled is true.

The client-certificate and break-glass variables (CLIENT_CERT_*, BREAK_GLASS_*) are listed with their values in Client certificate values and Break-glass values.

The Kubernetes client uses the in-cluster ServiceAccount configuration, or the standard KUBECONFIG lookup when running outside a cluster.

Secrets

The gateway requires one Secret, created before the chart is installed, in the release namespace. Its name defaults to kornercode-gateway-secrets (gateway.oidc.existingSecret). The chart reads two fixed keys from it:

KeyDescription
OIDC_CLIENT_SECRETClient secret of the gateway’s OIDC client.
SESSION_SECRETSession key, at least 32 bytes. Generate it, for example, with openssl rand -hex 32 (64 characters).
kubectl create secret generic kornercode-gateway-secrets \
  --namespace kornercode \
  --from-literal=OIDC_CLIENT_SECRET='<oidc-client-secret>' \
  --from-literal=SESSION_SECRET='<session-secret>'

Both values are injected as environment variables, so a change takes effect only after the gateway pods restart (kubectl -n kornercode rollout restart deployment kornercode-gateway). Changing SESSION_SECRET invalidates all existing sessions; see SESSION_SECRET rotation.

The following Secrets are issued by cert-manager and must not be created by hand:

  • <fullname>-webhook-cert in the operator namespace: admission webhook serving certificate.
  • kornercode-internal-ca in mtls.certManagerNamespace: internal CA (only with mtls.enabled).
  • kornercode-gateway-mtls in the gateway namespace: gateway client and server certificate (only with mtls.enabled).
  • workspace-<workspace>-tls in each workspace namespace: workspace certificate requested by the operator (only with mtls.enabled).

Optional integrations

cert-manager

The chart always renders, for the operator, a self-signed Issuer (<fullname>-selfsigned-issuer), a Certificate for the webhook serving certificate (<fullname>-webhook-cert, RSA 2048, duration: 2160h, renewBefore: 360h), and the ValidatingWebhookConfiguration and MutatingWebhookConfiguration, annotated with cert-manager.io/inject-ca-from so that cert-manager’s CA injector fills in their CA bundle. Installing the chart therefore requires the cert-manager CRDs. The certificate Secret is mounted with optional: true, so the pod starts before the certificate is issued.

At startup the operator queries API discovery for cert-manager.io/v1:

  • If the group version is served and includes the Certificate kind, the admission webhooks are registered.
  • If discovery answers NotFound, or the Certificate kind is absent, the operator logs cert-manager not detected; running without admission webhooks and runs without them.
  • Any other discovery error is retried, up to 5 attempts 2 seconds apart. If all attempts fail, the operator exits with an error and is restarted, rather than running without webhooks.

The webhooks are a mutating webhook for Workspace (mworkspace.code.kornercloud.dev) and validating webhooks for Workspace, Team, WorkspaceProfile and SecurityProfile, all on CREATE and UPDATE with failurePolicy: Fail. While the webhook endpoint is unreachable, the API server rejects create and update requests for these resources.

cert-manager is also required for mTLS.

Prometheus

Operator metrics. The chart passes --metrics-bind-address=:8080 and exposes the endpoint through the Service <fullname>-kornercode-controller-metrics (port metrics, 8080). Set operator.metrics.serviceMonitor.enabled: true to create a ServiceMonitor for it. Prometheus must be configured to select ServiceMonitors in the operator namespace; use operator.metrics.serviceMonitor.labels to match its serviceMonitorSelector. Besides the controller-runtime metrics, the operator exports a workspace phase gauge (code_kornercloud_dev_workspace_phase) labeled with cluster from operator.global.clusterName.

With operator.metrics.secure: true, the endpoint serves HTTPS and checks every request with TokenReview and SubjectAccessReview. The chart’s ServiceMonitor scrapes plain HTTP without TLS or bearer token settings, and the chart does not grant the operator create on tokenreviews (authentication.k8s.io) and subjectaccessreviews (authorization.k8s.io). Secure metrics therefore need that additional RBAC, get on the non-resource URL /metrics for the scraping identity, and a scrape configuration of your own.

Gateway integration. Setting PROMETHEUS_URL (through the gateway.env value) enables:

  • Live CPU, memory and storage usage for workspaces in the user and admin views.
  • The Statistics charts in the admin dashboard (resource utilization and operator health).
  • An admin-only PromQL proxy at /api/v1/admin/metrics.

Without it, /api/v1/me reports prometheusEnabled: false, the Statistics view shows “Prometheus not connected”, and usage views show resource reservations only. The gateway queries these series:

SeriesSource
container_cpu_usage_seconds_total, container_memory_working_set_byteskubelet cAdvisor
kubelet_volume_stats_used_byteskubelet; storage usage is unavailable when the storage driver reports no volume stats
controller_runtime_reconcile_total, controller_runtime_reconcile_errors_total, controller_runtime_reconcile_time_seconds_bucket, code_kornercloud_dev_workspace_phaseoperator metrics endpoint (operator ServiceMonitor)

The gateway also serves its own metrics (gateway_audit_events_total, gateway_session_store_errors_total, gateway_admin_handler_audited_total) at /metrics on METRICS_PORT (9090). The chart does not expose this port or create a ServiceMonitor for it.

For local development, hack/local-dev/values-prometheus.yaml installs a minimal kube-prometheus-stack (Prometheus Operator, kube-state-metrics and the kubelet cAdvisor and kubelet ServiceMonitors; no Grafana, Alertmanager or node exporter) that selects ServiceMonitors in all namespaces. The bootstrap script then sets:

--set "operator.metrics.serviceMonitor.enabled=true"
--set "gateway.env.PROMETHEUS_URL=http://prometheus-stack-kube-prom-prometheus.monitoring.svc.cluster.local:9090"

mTLS

mTLS encrypts and mutually authenticates traffic between the gateway and workspace pods. It is one switch for the operator and the gateway:

mtls:
  enabled: true
  gatewayTLSEnabled: true

With mtls.enabled: true, the chart creates, for the operator:

  • ClusterIssuer kornercode-selfsigned-bootstrap (self-signed), used only to sign the CA.
  • Certificate kornercode-internal-ca in mtls.certManagerNamespace: CA certificate, ECDSA P-256, duration: 87600h, renewBefore: 720h, stored in the Secret kornercode-internal-ca.
  • ClusterIssuer kornercode-internal-ca-issuer, a CA issuer backed by that Secret.

The operator then requests a certificate per workspace from MTLS_ISSUER_NAME and adds an Envoy sidecar (envoyproxy/envoy:v1.32.4) that terminates mTLS in front of code-server. The workspace Service then exposes its codeserver port as 8443 (Envoy) instead of 8080, and code-server binds to 127.0.0.1:8080 so that it is reachable only through Envoy; the gateway and operator therefore share the single mtls.enabled value. Workspace certificate lifetimes (720h, renewed 48h before expiry), internal ports and the Envoy image are compiled-in constants.

With mtls.enabled: true, the chart also creates, for the gateway, the Certificate kornercode-gateway-mtls (ECDSA P-256, duration: 2160h, renewBefore: 360h, server and client auth, DNS names kornercode-gateway, kornercode-gateway.<namespace>, kornercode-gateway.<namespace>.svc and kornercode-gateway.<namespace>.svc.cluster.local) signed by the ClusterIssuer kornercode-internal-ca-issuer, and mounts it at mtls.certDir. When mtls.gatewayTLSEnabled is also true, the gateway serves HTTPS on 8443 with that certificate, and the chart creates a Traefik ServersTransport (kornercode-gateway-tls, insecureSkipVerify: true) referenced from the Service, because Traefik does not trust the internal CA. The plain HTTP port 8080 stays available for in-cluster callers.

See Mutual TLS for the design and troubleshooting.