|
1 | 1 | # OpenShift Support |
2 | 2 |
|
3 | | -The `camunda-platform` Helm chart can be deployed to Openshift with a few modifications. |
| 3 | +The Camunda 8 Helm chart can be deployed to OpenShift using extra values file that unset the `securityContext` |
| 4 | +according to OpenShift default Security Context Constraints (SCCs). |
4 | 5 |
|
5 | | -## Getting started |
| 6 | +For full details, please check the official docs: |
| 7 | +[Camunda 8 Self-Managed Red Hat OpenShift](https://docs.camunda.io/docs/self-managed/platform-deployment/helm-kubernetes/platforms/redhat-openshift/). |
6 | 8 |
|
7 | | -In order to deploy the chart to a standard Openshift cluster with default policies, we need to configure each chart |
8 | | -ensure that none of the bundled applications run under a specific user and/or group. This means making sure that no |
9 | | -security context, whether pod or container specific, specifies a user via `runAsUser` or `fsGroup`. |
10 | 9 |
|
11 | | -The `Elasticsearch`, `Keycloak`, and `Postgresql` charts all specify default non-root users for security purposes. This |
12 | | -needs to be disabled by removing these. Because of this, it's unfortunately not possible to deploy the chart with Helm |
13 | | -3.2.x or greater and the `restricted` SCC without using a workaround. This is due to a longstanding bug in Helm, which |
14 | | -you can see [here](https://github.com/helm/helm/issues/9136). You can read more about this in the [Usage](#usage) |
15 | | -section. |
| 10 | +## Prerequisite |
16 | 11 |
|
17 | | -## Compatibility |
18 | | - |
19 | | -We test against the following Openshift versions, and guarantee compatibility with: |
20 | | - |
21 | | -| Openshift Version | Supported | |
22 | | -|-------------------|--------------------| |
23 | | -| 4.10.x | :white_check_mark: | |
24 | | - |
25 | | -Any version not explicitly marked in the table above is not tested, and we cannot guarantee compatibility. |
26 | | - |
27 | | -## Usage |
28 | | - |
29 | | -You will find in this repository a sample `values.yaml` file to get you start on Openshift |
30 | | -[here](./values.yaml). |
31 | | - |
32 | | -Before proceeding, make sure you've fulfilled all the requirements as described in the [README](/README.md), namely that |
33 | | -you have Helm installed, and you've added the chart's repository. |
34 | | - |
35 | | -Finally, due to a longstanding bug in Helm (see [here](https://github.com/helm/helm/issues/9136)), the installation |
36 | | -instructions are a bit different depending on your Helm version. To find out, quickly run: |
| 12 | +First, download the exact chart version you use and extract the OpenShift extra values file: |
37 | 13 |
|
38 | 14 | ```shell |
39 | | -helm version |
| 15 | +# Ensure set CHART_VERSION to match the chart you want to install. |
| 16 | +helm pull camunda/camunda-platform --version CHART_VERSION --untar --untardir /tmp |
40 | 17 | ``` |
41 | 18 |
|
42 | | -For example, if your version was "3.9.0", you would get something like this: |
43 | | - |
44 | | -```shell |
45 | | -$ helm version |
46 | | -version.BuildInfo{Version:"v3.9.0", GitCommit:"7ceeda6c585217a19a1131663d8cd1f7d641b2a7", GitTreeState:"clean", GoVersion:"go1.17.5"} |
47 | | -``` |
48 | 19 |
|
49 | | -If your version is greater than or equal to 3.2.0, refer to [this section](#helm-32x-and-greater). If it's lower, refer |
50 | | -to [this section](#helm-313-or-lower). |
| 20 | +## Post-renderer setup |
51 | 21 |
|
52 | | -### Helm 3.1.3 or lower |
| 22 | +> **Warning** |
| 23 | +> If using a post-renderer, you must use the post-renderer whenever you are updating your release, |
| 24 | +> not only during the initial installation. If you do not, the default values will be used again, |
| 25 | +> which will prevent some services from starting. |
53 | 26 |
|
54 | | -If you're using Helm 3.1.3 or lower, you can simply install the chart as you normally would. Copy |
55 | | -the [values.yaml](/openshift/values.yaml) locally, or merge the values with your own values file. |
56 | | - |
57 | | -> Make sure you've logged into your Openshift cluster, and have selected a project to deploy the chart into. You can |
58 | | -> login using `oc login`, and create a new project via `oc new-project myProject`. |
59 | | -
|
60 | | -```shell |
61 | | -helm install test camunda/camunda-platform --skip-crds -f values.yaml |
62 | | -``` |
63 | | - |
64 | | -If you wanted to use the chart with your own values, simply copy the [values.yaml](/openshift/values.yaml) locally, e.g. |
65 | | -as `openshift.yaml`, and run: |
| 27 | +If you are using one of the Helm CLI version affected by the nested null bug [1](https://github.com/helm/helm/issues/9136) |
| 28 | +[2](https://github.com/helm/helm/issues/12490) |
| 29 | +then you need to Helm post-render with a patch script as following: |
66 | 30 |
|
67 | 31 | ```shell |
68 | | -helm install test camunda/camunda-platform --skip-crds -f openshift.yaml -f values.yaml |
| 32 | +helm install camunda camunda/camunda-platform --skip-crds \ |
| 33 | + --values /tmp/camunda-platform/openshift/values.yaml \ |
| 34 | + --post-renderer bash --post-renderer-args /tmp/camunda-platform/openshift/patch.sh |
69 | 35 | ``` |
70 | 36 |
|
71 | | -By specifying your own values file last, you can then override any default values we set in the OpenShift specific file. |
72 | 37 |
|
73 | | -You can verify the installation as described in the [README.md](/README.md). |
| 38 | +## Normal setup |
74 | 39 |
|
75 | | -### Helm 3.2.x and greater |
| 40 | +If you are using any Helm CLI 3.1.4 or less, which is not affected by the nested null bug |
| 41 | +[1](https://github.com/helm/helm/issues/9136) [2](https://github.com/helm/helm/issues/12490), |
| 42 | +then follow [normal installation flow](../README.md#installation) using OpenShift extra values file |
| 43 | +(you don't need to edit that file!). |
76 | 44 |
|
77 | | -Because Helm 3.2.x or greater cannot unset default values in sub-charts, we have two options: allow usage of the |
78 | | -`anyuid` or `nonroot` SCC, or use a chart post-renderer. |
79 | | - |
80 | | -#### anyuid or nonroot SCC |
81 | | - |
82 | | -Under the `restricted` SCC, these charts (`elasticsearch`, `bitnami/keycloak`, and `bitnami/postgresql`) would fail to |
83 | | -deploy. The simplest method is thus to allow the user/service account which will deploy your chart to use the `anyuid` |
84 | | -or `nonroot` SCC. This will let sub-charts which define arbitrary UIDs/GIDs use these IDs. |
85 | | - |
86 | | -For example, if you will use the user `deployer` to deploy the chart but still want to restrict running to nonroot |
87 | | -users: |
| 45 | +E.g. |
88 | 46 |
|
89 | 47 | ```shell |
90 | | -oc adm policy add-scc-to-user nonroot deployer |
| 48 | +helm install camunda camunda/camunda-platform --skip-crds \ |
| 49 | + --values /tmp/camunda-platform/openshift/values.yaml |
91 | 50 | ``` |
92 | | - |
93 | | -When this is done, you do not need any special values file to install the charts. |
94 | | - |
95 | | -#### Using a post-renderer |
96 | | - |
97 | | -If you must use the `restricted` SCC and Helm 3.2.x, then you will need to use a post-renderer to install the charts. To |
98 | | -do so, you'll need to use both values file, [openshift/values.yaml](/openshift/values.yaml) and |
99 | | -[openshift/values-patch.yaml](/openshift/values-patch.yaml), and the companion script [patch.sh](/openshift/patch.sh), |
100 | | -a Helm post renderer. |
101 | | - |
102 | | -> For this method, you will need to have `bash` and `sed` installed locally. After downloading the script, make sure it |
103 | | -> is executable by your user, e.g. `chmod u+x patch.sh`. |
104 | | -
|
105 | | -When everything is ready, you can now run the following: |
106 | | - |
107 | | -```shell |
108 | | -helm install test camunda/camunda-platform --skip-crds -f values.yaml -f values-patch.yaml --post-renderer ./patch.sh |
109 | | -``` |
110 | | - |
111 | | -If you wanted to use this with your own values file, remember to place that one as the right most, but keeping the |
112 | | -above order as is. For example, let's say you download the files as `openshift.yaml` and `openshift-patch.yaml`: |
113 | | - |
114 | | -```shell |
115 | | -helm install test camunda/camunda-platform --skip-crds -f openshift.yaml -f openshift-patch.yaml -f values.yaml --post-renderer ./patch.sh |
116 | | -``` |
117 | | - |
118 | | -You can verify the installation as described in the [README.md](/README.md). |
119 | | - |
120 | | -##### Upgrade |
121 | | - |
122 | | -Note that if you use the post-renderer, you will _also_ need to use it when upgrading your chart. For example: |
123 | | - |
124 | | -```shell |
125 | | -helm install test camunda/camunda-platform --skip-crds -f values.yaml -f values-patch.yaml --post-renderer ./patch.sh |
126 | | -helm upgrade test camunda/camunda-platform --skip-crds --reuse-values -f values-patch.yaml --post-renderer ./patch.sh |
127 | | -``` |
128 | | - |
129 | | -Even if we use the flag `--reuse-values`, the default values from the sub-charts will be picked up again and need to be |
130 | | -nullified by the post-renderer again. |
0 commit comments