Skip to content

Commit fcf6756

Browse files
authored
chore: v8.3 post-release clean-up (#952)
* chore: remove es pvc clone * chore: enhance setup for openshift
1 parent 366edc6 commit fcf6756

File tree

11 files changed

+182
-240
lines changed

11 files changed

+182
-240
lines changed

.github/workflows/chart-update-readme.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Run readme generator
2525
run: |
2626
echo "Updating README.md"
27-
make helm.readme-generator
27+
make helm.readme-update
2828
- uses: EndBug/[email protected]
2929
with:
3030
author_name: "renovate[bot]"

charts/camunda-platform/README.md

Lines changed: 22 additions & 8 deletions
Large diffs are not rendered by default.
Lines changed: 27 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,130 +1,50 @@
11
# OpenShift Support
22

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).
45

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/).
68

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`.
109

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
1611

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:
3713

3814
```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
4017
```
4118

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-
```
4819

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
5121

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.
5326
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:
6630

6731
```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
6935
```
7036

71-
By specifying your own values file last, you can then override any default values we set in the OpenShift specific file.
7237

73-
You can verify the installation as described in the [README.md](/README.md).
38+
## Normal setup
7439

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!).
7644

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.
8846

8947
```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
9150
```
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.

charts/camunda-platform/openshift/patch.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,4 @@
1414
# from any working directory.
1515

1616
set -o pipefail
17-
18-
# Perform two passes: once for single quotes, once for double quotes, as it's not specified that string values are
19-
# always output with single or double quotes
20-
sed -e "s/'@@null@@'/null/g" -e 's/"@@null@@"/null/g' |
21-
22-
# This is needed for bitnami/elasticsearch since the schema doesn't allow to have to apply the above workaround.
23-
# So we cannot use '@@null@@' as it's a string not an int.
24-
yq 'del(.. | select(has("runAsUser")).runAsUser) | del(.. | select(has("fsGroup")).fsGroup)'
17+
sed -e '/\srunAsUser:\s/d' -e '/\sfsGroup:\s/d'

charts/camunda-platform/openshift/values-patch.yaml

Lines changed: 0 additions & 74 deletions
This file was deleted.

0 commit comments

Comments
 (0)