Restructures the Install section into the five-phase deployment spine, so the reading order matches the order a deployment actually happens: **plan, prepare, install, validate, operate.** Today the first thing a reader sees is a shell command, and architecture and sizing sit downstream in Administration, after the point where they would have been useful. Resolves [DOCS-869](https://linear.app/codercom/issue/DOCS-869). Part of [DOCS-685](https://linear.app/codercom/issue/DOCS-685) and [DOCS-738](https://linear.app/codercom/issue/DOCS-738). > [!IMPORTANT] > **Stacked on [#28960](https://github.com/coder/coder/pull/28960)** (DOCS-871, terminology). Base is that branch, not `main`. Retarget to `main` after it merges. > > **Paired with coder/coder.com [#1077](https://github.com/coder/coder.com/pull/1077)**, which must merge **first**. Without it, every inbound link to a moved page 404s in the gap. ## Deliberately mechanical No prose changes. The only edits inside moved pages are relative link and image path repairs, so the diff reads as renames. That is the point: this is the highest link-breakage change in the project, and it should be reviewable as such. The prose work is [DOCS-868](https://linear.app/codercom/issue/DOCS-868) (phase overview, architecture rewrite, sizing split, actor table) and [DOCS-872](https://linear.app/codercom/issue/DOCS-872) (new pages). ## The new spine ```text Install and deploy Coder /install ├── Coder CLI [unchanged, retired by DOCS-870] ├── 1. Plan your deployment │ ├── Architecture and components [from admin/infrastructure] │ └── Coder Validated Architecture [from admin/infrastructure] │ └── 1k / 2k / 3k / 10k users ├── 2. Prepare prerequisites │ ├── Licensing [from admin/licensing] │ ├── Air-gapped deployments [from install/airgap] │ └── Mirror images and registries [from install/registry-mirror-artifactory] ├── 3. Install the control plane │ ├── Docker / Kubernetes / Rancher / OpenShift │ ├── Cloud marketplace and VM images │ └── Unofficial install methods ├── 4. Validate your deployment │ └── Scale testing [from admin/infrastructure] │ ├── Scale test utility │ └── Scaling best practices └── 5. Operate and maintain ├── External provisioners [from admin/provisioners] ├── Upgrading (+ best practices, ESR guides) └── Uninstall ``` Leaving Install: release channels become `reference/releases`, feature stages become `reference/feature-stages`. `docs/admin/infrastructure/` is gone entirely, which is what DOCS-738 recommended. ## Numbers - 31 pages moved, all as `git mv` renames. - 1 page deleted: `admin/infrastructure/index.md`, whose content was a one-line section blurb. - 5 new placeholder index pages, one per phase, each a sentence of orientation plus `<children></children>`. The nav schema requires a path on every entry, so a phase cannot exist without one. - 265 relative links and asset paths repaired across 57 files. - `docs/manifest.json` restructured. Entry count goes 460 to 464: plus 5 stubs, minus the deleted Infrastructure entry. ## Reviewer attention, please **The redirects PR repairs 19 existing redirects, not just adds new ones.** This was the surprise. `redirects.json` already had entries whose *destinations* pointed at pages this PR moves, so they would have started redirecting to 404s. Examples: `/docs/architecture/architecture`, `/docs/admin/architectures`, `/docs/scaling/scale-testing`, `/docs/licensing`, `/docs/enterprise`, `/docs/install/offline`, `/docs/platforms`, `/docs/install/1-click`, `/docs/admin/upgrade`, `/docs/install/cloud/ec2`, and both `feature-stages` aliases. All 19 are fixed in the paired PR. **This PR touches `scripts/`, so it is not docs-only.** Two release tools write to paths that moved and would have broken silently at release time: - `scripts/update-release-calendar.sh`: `DOCS_FILE` now points at `docs/reference/releases.md`. - `scripts/releaser/docs.go`: `releasesFile`, and also `kubernetesFile` and `rancherFile`, which pointed at `docs/install/kubernetes.md` and `docs/install/rancher.md`. <details> <summary>Deliberate scope decisions</summary> - **Self-managed vs cloud grouping is flattened.** The reconciled IA nested platform pages under a "Self-managed platforms" parent. That would need two more placeholder index pages for groups with no content yet, so the platform pages sit directly under Phase 3 and the grouping lands with the DOCS-868 prose. - **Release-notes URLs left alone.** `scripts/releaser/release.go` and `scripts/release/generate_release_notes.sh` embed `https://coder.com/docs/install/releases` and `/docs/install/upgrade` in release-note templates. The redirects cover them, and changing the strings would require updating Go test fixtures in `scripts/release/main_internal_test.go`. Better as its own change. - **In-product doc links left alone.** Several `site/src` pages link to `coder.com/docs/admin/provisioners` and similar. Those are absolute URLs, so the redirects cover them. Updating them is a frontend change that would pull frontend review into a docs restructure. - **`admin/security/audit-logs.md` line 237** is hand-written prose below the generated table, and its `../licensing/index.md` link had to move with the licensing page. Verified `make gen` does not revert it. - **`reference/feature-stages.md`** has generated blocks whose relative links changed depth with the move. The generator named in its own marker comment (`scripts/release/docs_update_feature_stages.sh`) no longer exists in the repo, so those links were repaired by hand and the file is effectively hand-maintained. Worth its own issue. - **`install/cli.md` keeps its nav slot** here. DOCS-870 retires it. </details> ## Verification | Check | Result | |---|---| | Broken relative link scan | 0 in `install/`, `admin/`, `reference/`. 21 remain, all pre-existing illustrative examples in `docs/.style/style-guide/**` and one malformed URL in `docs/README.md` | | `make gen` | clean, manifest not clobbered, phase structure intact | | `make lint/markdown` | pass, 508 files, 0 errors | | `make lint/emdash` | pass | | `make lint/docs-html` | pass | | `make lint/prose` | pass, 1 intentional demo error, no new findings | | `make pre-commit` | pass, including `lint/go`, `lint/ts`, `lint/shellcheck`, and a slim build | | Manifest audit | every path resolves to a file on disk; entry-by-entry diff shows only the expected moves | Generated with Coder Agents on behalf of @nickvigilante. <details> <summary>CI note: doc-check failure is infrastructure, not this PR</summary> `Analyze PR for Documentation Updates Needed` fails before it reviews anything: the Coder account behind `agents-chat-action` returns `User is not active (status = "suspended")`. It isn't a required check. `check-docs` (linkspector) and every other check pass on `58ed9e3e4b`. _CI note added by Coder Agents on behalf of @nickvigilante._ </details>
12 KiB
title
| title |
|---|
| OpenShift |
Requirements
- OpenShift cluster running K8s 1.19+ (OpenShift 4.7+)
- Helm 3.5+ installed
- OpenShift CLI (
oc) installed - Coder CLI installed
Install Coder with OpenShift
1. Authenticate to OpenShift and create a Coder project
Run the following command to login to your OpenShift cluster:
oc login --token=w4r...04s --server=<cluster-url>
Next, you will run the below command to create a project for Coder:
oc new-project coder
2. Configure SecurityContext values
Depending upon your configured Security Context Constraints (SCC), you'll need
to modify some or all of the following securityContext values from the default
values:
The below values are modified from Coder defaults and allow the Coder deployment
to run under the SCC restricted-v2.
Note
readOnlyRootFilesystem: trueis not technically required underrestricted-v2, but is often mandated in OpenShift environments.
coder:
securityContext:
runAsNonRoot: true # Unchanged from default
runAsUser: <project-specific UID> # Default: 1000, replace this with the correct UID for your project.
runAsGroup: <project-specific GID> # Default: 1000, replace this with the correct GID for your project.
readOnlyRootFilesystem: true # Default: false, this is often required in OpenShift environments.
seccompProfile: RuntimeDefault # Unchanged from default
-
For
runAsUser/runAsGroup, you can retrieve the correct values for project UID and project GID with the following command:oc get project coder -o json | jq -r '.metadata.annotations' { "openshift.io/sa.scc.supplemental-groups": "1000680000/10000", "openshift.io/sa.scc.uid-range": "1000680000/10000" }Alternatively, you can set these values to
nullto allow OpenShift to automatically select the correct value for the project. -
For
readOnlyRootFilesystem, consult the SCC under which Coder needs to run. In the below example, therestricted-v2SCC does not require a read-only root filesystem, whilerestricted-customdoes:oc get scc -o wide NAME PRIV CAPS SELINUX RUNASUSER FSGROUP SUPGROUP PRIORITY READONLYROOTFS VOLUMES restricted-custom false ["NET_BIND_SERVICE"] MustRunAs MustRunAsRange MustRunAs RunAsAny <no value> true ["configMap","downwardAPI","emptyDir","ephemeral","persistentVolumeClaim","projected","secret"] restricted-v2 false ["NET_BIND_SERVICE"] MustRunAs MustRunAsRange MustRunAs RunAsAny <no value> false ["configMap","downwardAPI","emptyDir","ephemeral","persistentVolumeClaim","projected","secret"]If you are unsure, we recommend setting
readOnlyRootFilesystemtotruein an OpenShift environment. -
For
seccompProfile: in some environments, you may need to set this tonullto allow OpenShift to pick its preferred value.
3. Configure the Coder service, connection URLs, and cache values
To establish a connection to PostgreSQL, set the CODER_PG_CONNECTION_URL
value. See our Helm documentation on configuring the
PostgreSQL connection URL as a secret. Additionally, if accessing Coder over a
hostname, set the CODER_ACCESS_URL value.
By default, Coder creates the cache directory in /home/coder/.cache. Given the
OpenShift-provided UID and readOnlyRootFS security context constraint, the
Coder container does not have permission to write to this directory.
To fix this, you can mount a temporary volume in the pod and set the
CODER_CACHE_DIRECTORY environment variable to that location. In the below
example, we mount this under /tmp and set the cache location to /tmp/coder.
This enables Coder to run with readOnlyRootFilesystem: true.
Note
Depending on the number of templates and provisioners you use, you may need to increase the size of the volume, as the
coderpod will be automatically restarted when this volume fills up.
Additionally, create the Coder service as a ClusterIP. In the next step, you
will create an OpenShift route that points to the service HTTP target port.
coder:
service:
type: ClusterIP
env:
- name: CODER_CACHE_DIRECTORY
value: /tmp/coder
- name: CODER_PG_CONNECTION_URL
valueFrom:
secretKeyRef:
key: url
name: coder-db-url
- name: CODER_ACCESS_URL
value: "https://coder-example.apps.openshiftapps.com"
securityContext:
runAsNonRoot: true
runAsUser: <project-specific UID>
runAsGroup: <project-specific GID>
readOnlyRootFilesystem: true
volumes:
- name: "cache"
emptyDir:
sizeLimit: 1Gi
volumeMounts:
- name: "cache"
mountPath: "/tmp"
readOnly: false
Note
OpenShift provides a Developer Catalog offering you can use to install PostgreSQL into your cluster.
4. Create the OpenShift route
Below is the YAML spec for creating an OpenShift route that sends traffic to the HTTP port of the Coder service:
kind: Route
apiVersion: route.openshift.io/v1
metadata:
namespace: coder
spec:
host: https://coder-example.apps.openshiftapps.com
to:
kind: Service
name: coder
tls:
# if set to edge, OpenShift will terminate TLS prior to the traffic reaching
# the service.
termination: edge
# if set to Redirect, insecure client connections are redirected to the secure
# port
insecureEdgeTerminationPolicy: Redirect
port:
targetPort: http
Once complete, you can create this route in OpenShift via:
oc apply -f route.yaml
5. Install Coder
You can now install Coder using the values you've set from the above steps. To
do so, run the series of helm commands below:
helm repo add coder-v2 https://helm.coder.com/v2
helm repo update
helm install coder coder-v2/coder \
--namespace coder \
--values values.yaml
Note
If the Helm installation fails with a Kubernetes RBAC error, check the permissions of your OpenShift user using the
oc auth can-icommand.The below permissions are the minimum required:
oc auth can-i --list Resources Non-Resource URLs Resource Names Verbs selfsubjectaccessreviews.authorization.k8s.io [] [] [create] selfsubjectrulesreviews.authorization.k8s.io [] [] [create] * [] [] [get list watch create update patch delete deletecollection] *.apps [] [] [get list watch create update patch delete deletecollection] *.rbac.authorization.k8s.io [] [] [get list watch create update patch delete deletecollection] [/.well-known/*] [] [get] [/.well-known] [] [get] [/api/*] [] [get] [/api] [] [get] [/apis/*] [] [get] [/apis] [] [get] [/healthz] [] [get] [/healthz] [] [get] [/livez] [] [get] [/livez] [] [get] [/openapi/*] [] [get] [/openapi] [] [get] [/readyz] [] [get] [/readyz] [] [get] [/version/] [] [get] [/version/] [] [get] [/version] [] [get] [/version] [] [get] securitycontextconstraints.security.openshift.io [] [restricted-v2] [use]
6. Create an OpenShift-compatible image
While the deployment is spinning up, we will need to create some images that are compatible with OpenShift. These images can then be run without modifying the Security Context Constraints (SCCs) in OpenShift.
-
Determine the UID range for the project:
oc get project coder -o json | jq -r '.metadata.annotations' { "openshift.io/description": "", "openshift.io/display-name": "coder", "openshift.io/requester": "kube:admin", "openshift.io/sa.scc.mcs": "s0:c26,c15", "openshift.io/sa.scc.supplemental-groups": "1000680000/10000", "openshift.io/sa.scc.uid-range": "1000680000/10000" }Note the
uid-rangeandsupplemental-groups. In this case, the projectcoderhas been allocated 10,000 UIDs and GIDs, both starting at1000680000.In this example, we will pick both UID and GID
1000680000. -
Create a
BuildConfigreferencing the source image you want to customize. This will automatically kick off aBuildthat will remain pending until step 3.For more information, please consult the OpenShift Documentation.
oc create -f - <<EOF kind: BuildConfig apiVersion: build.openshift.io/v1 metadata: name: enterprise-base namespace: coder spec: output: to: kind: ImageStreamTag name: 'enterprise-base:latest' strategy: type: Docker dockerStrategy: imageOptimizationPolicy: SkipLayers source: type: Dockerfile dockerfile: | # Specify the source image. FROM docker.io/codercom/example-base:ubuntu # Switch to root USER root # As root: # 1) Remove the original coder user with UID 1000 # 2) Add a coder group with an allowed UID # 3) Add a coder user as a member of the above group # 4) Fix ownership on the user's home directory RUN userdel coder && \ groupadd coder -g 1000680000 && \ useradd -l -u 1000680000 coder -g 1000680000 && \ chown -R coder:coder /home/coder # Go back to the user 'coder' USER coder triggers: - type: ConfigChange runPolicy: Serial EOF -
Create an
ImageStreamas a target for the previous step:oc create imagestream enterprise-baseThe
Buildcreated in the previous step should now begin. Once completed, you should see output similar to the following:oc get imagestreamtag NAME IMAGE REFERENCE UPDATED enterprise-base:latest image-registry.openshift-image-registry.svc:5000/coder/enterprise-base@sha256:1dbbe4ee11be9218e1e4741264135a4f57501fe592d94d20db6bfe11692accd1 55 minutes ago
7. Create an OpenShift-compatible template
Start from the default "Kubernetes" template:
echo kubernetes | coderv2 templates init ./openshift-k8s
cd ./openshift-k8s
Edit main.tf and update the following fields of the Kubernetes pod resource:
spec.security_context: remove this field.spec.container.image: update this field to the newly built image hosted on the OpenShift image registry from the previous step.spec.container.security_context: remove this field.
Finally, create the template:
coder template push kubernetes -d .
This template should be ready to use straight away.