Skip to content

Commit f2a40eb

Browse files
committed
Begin Openshift docs
Document openshift image tweaks required. Omit docs on how to use openshift registry
1 parent c84ee2e commit f2a40eb

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

manifest.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,14 @@
142142
},
143143
{
144144
"path": "./setup/kubernetes/google.md"
145+
},
146+
{
147+
"path": "./setup/kubernetes/openshift/index.md",
148+
"children": [
149+
{
150+
"path": "./setup/kubernetes/openshift/images.md"
151+
}
152+
]
145153
}
146154
]
147155
},

setup/kubernetes/openshift/images.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: "Openshift Image"
3+
description: Learn how to make your Coder images compatible with Openshift.
4+
---
5+
6+
> This is required if running with 'restricted' pods. Giving the `builder` service account in your project [anyuid](https://www.openshift.com/blog/managing-sccs-in-openshift) permissions makes these steps unnecessary.
7+
8+
First, you should be familiar with [creating an image for your coder workspace](../../../images/writing.md). Openshift by default will not allow the default `coder` user in the base image. To create a good experience in Coder, we recommend creating a new image specific for your Openshift namespace.
9+
10+
## Openshift Dockerfile
11+
12+
This dockerfile should extend your Coder image for a specific project. This allows the `coder` user to be used in the image within the project.
13+
14+
First we need to get the allowed uid range for the project. Select the project in which Coder was installed.
15+
16+
```bash
17+
$ oc describe project coder | grep uid-range
18+
openshift.io/sa.scc.uid-range=1000670000/10000
19+
```
20+
21+
Knowing the allowed uid range, we can change the uid of the `coder` user in our image.
22+
23+
```dockerfile
24+
# Change this to your docker image.
25+
FROM docker.io/codercom/enterprise-base:ubuntu
26+
27+
# Switch to root
28+
USER root
29+
# As root, change the coder user id
30+
RUN usermod -u 1000670000 coder
31+
32+
# Go back to the user 'coder'
33+
USER coder
34+
```
35+
36+
## Builtin Registry
37+
38+
This Dockerfile can be placed in the `openshift-image-registry` project's [build configs](https://docs.openshift.com/container-platform/4.7/cicd/builds/understanding-buildconfigs.html) to automatically build this project specific dockerfile each time the underlying image is updated.

setup/kubernetes/openshift/index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: "Openshift"
3+
description: Learn about deploying Coder in Openshift
4+
---
5+

0 commit comments

Comments
 (0)