Skip to content
Installation

Installation

This guide installs kornercode on an existing Kubernetes cluster. To try it on a laptop instead, use the local development environment.

Requirements

RequirementNotes
KubernetesDeveloped and tested on Kubernetes 1.35. A default StorageClass is needed for the users’ home volumes.
Ingress controllerThe chart targets Traefik for the gateway (gateway.ingress.className: traefik, plus a ServersTransport when the gateway serves TLS itself). Other controllers work with the chart’s ingress values, provided they support WebSockets.
DNS and TLSThree hostnames pointing at the ingress, for example dashboard.example.com, dev.example.com and test.example.com, with a certificate covering them.
OIDC providerAny OpenID Connect provider with the authorization-code flow. The token must carry a groups claim (groups by default, gateway.oidc.groupsClaim) with plain group names (in Keycloak: a Group Membership mapper with “full group path” off). Keycloak is the one tested. The gateway starts and keeps serving signed-in users while the provider is unreachable.
cert-managerStrongly recommended. Without it the admission webhooks, mTLS and the client-certificate gate (with break-glass login) are unavailable. With mTLS, run it with enableCertificateOwnerRef: true so that a workspace’s certificate Secret is deleted with the workspace.
PrometheusOptional. Enables usage insights and the Statistics charts; it must scrape the kubelet (cAdvisor and /metrics).
Workspace imagesImages built from codercom/code-server, running as their non-root coder user (uid 1000) with everything per-user under /home/coder (see Image requirements). The local setup builds them from the kornercode-images repository.

1. Configure the OIDC client

Create a confidential client (for example kornercode-gateway) with:

  • redirect URI https://dashboard.example.com/auth/callback (include the port if the dashboard is served on a non-standard one),
  • post-logout redirect URI https://dashboard.example.com/,
  • the groups claim in the ID token.

Create the groups that will map to teams, and one for administrators.

2. Create the gateway secret

kubectl create namespace kornercode
kubectl -n kornercode create secret generic kornercode-gateway-secrets \
  --from-literal=OIDC_CLIENT_SECRET='<client secret>' \
  --from-literal=SESSION_SECRET="$(openssl rand -hex 32)"

SESSION_SECRET must be at least 32 bytes. Rotating it signs every user out; see session secret rotation.

3. Install kornercode

Charts and images are published in the project’s GitLab registries. One chart, kornercode, installs the operator and the gateway together.

helm upgrade --install kornercode \
  oci://registry.gitlab.com/kornercloud.dev/kornercode/charts/kornercode \
  --version <version> \
  --namespace kornercode \
  --set mtls.enabled=true \
  --set gateway.hosts.kornercode=dashboard.example.com \
  --set gateway.hosts.dev=dev.example.com \
  --set gateway.hosts.test=test.example.com \
  --set gateway.oidc.url=https://sso.example.com/realms/example \
  --set gateway.oidc.clientID=kornercode-gateway \
  --set gateway.adminGroups=platform-admins \
  --set gateway.ingress.tls.secretName=kornercode-tls \
  --set operator.metrics.serviceMonitor.enabled=true   # only with the Prometheus Operator

The chart installs the CRDs, the operator, its RBAC, the gateway and, when cert-manager is present, the webhook certificate and the internal CA used for mTLS. mtls.enabled is a single top-level value shared by both. To enable usage insights, add --set gateway.env.PROMETHEUS_URL=http://prometheus.monitoring.svc:9090.

Optional features, each off by default and described in the admin guide:

  • Platform restrictions (restrictions:): lockdown switches forced on every team. See Restrictions.
  • Client certificates (clientCertificates:): every connection to the three hosts needs the person’s company client certificate, whose CN must match the signed-in identity. It needs the company CA bundle and, with Traefik, gateway.ingress.tls.secretName. See Client certificates.
  • Break-glass login (breakGlass:): with client certificates on, a button that signs administrators listed in a mapping in with their certificate alone, for when the identity provider is down. See Break-glass login.

4. Define profiles, security profiles and teams

kornercode does nothing until an administrator defines what a workspace looks like and who may create one. Resources can be created from the dashboard (Profiles, Security and Teams pages) or as manifests:

  1. NetworkPolicies in the operator namespace, labeled code.kornercloud.dev/managed=true and code.kornercloud.dev/network-policy-id=<id>, selecting pods with netpol.code.kornercloud.dev/<id>: "true". The operator copies them to every team namespace.
  2. SecurityProfiles that reference those policy IDs and, optionally, a service account and security contexts.
  3. WorkspaceProfiles with the image, resources, storage size and lifetime defaults.
  4. Teams mapping an OIDC group to a namespace, the allowed profiles and a security profile.

hack/local-dev/workspace-profiles.yaml contains a complete, working example of all four. The fields are documented in the CRD reference.

5. Verify

kubectl -n kornercode get pods
kubectl -n kornercode logs deploy/kornercode-operator-kornercode-controller | grep "admission webhooks registered"
kubectl get teams,workspaceprofiles,securityprofiles

Sign in at https://dashboard.example.com with a user in one of the teams' groups and create a workspace.

Moving users from another code-server installation? Restore their home directories as volumes and label them for the operator to adopt; see Migrating existing home directories.

Upgrading

Read the upgrade notes in the changelog first. Some releases are flag days: the release that merged the operator and gateway charts into kornercode, for example, requires uninstalling the two old releases first.

The CRDs are templates of the chart, so helm upgrade updates them. A release that changes how workspace pods are built marks running workspaces as “restart required”; users apply the change when they choose (ADR 0008).

Uninstalling

kubectl delete workspaces --all -A    # let the operator clean up pods and services
helm uninstall kornercode -n kornercode

Home volumes are kept on purpose. Delete them from the Storage page beforehand, or with kubectl delete pvc afterwards.

The custom resource definitions are kept too, together with your profiles, teams and security profiles, so a reinstall picks them up. To remove them for good:

kubectl delete crd workspaces.code.kornercloud.dev teams.code.kornercloud.dev \
  workspaceprofiles.code.kornercloud.dev securityprofiles.code.kornercloud.dev

All Helm values and environment variables are listed in the configuration reference.