Skip to content

Commit 8698a19

Browse files
committed
rework helm
1 parent 59921bf commit 8698a19

File tree

2 files changed

+16
-251
lines changed

2 files changed

+16
-251
lines changed

charts/capsule/README.md

Lines changed: 10 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -16,34 +16,22 @@ Use the Capsule Operator for easily implementing, managing, and maintaining mult
1616

1717
* A [`kubeconfig`](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/) file accessing the Kubernetes cluster with cluster admin permissions.
1818

19-
## Breaking Changes
19+
## Major Changes
2020

2121
In the following sections you see actions which are required when you are upgrading to a specific version.
2222

23-
### 0.7.x
23+
### Upgrading to 0.7.x
2424

2525
Introduces a new methode to manage all capsule CRDs and their lifecycle. We are no longer relying on the [native CRD hook with the Helm Chart](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#some-caveats-and-explanations). The hook only allows to manage CRDs on install and uninstall but we can't deliver updates to the CRDs.
26-
When you newly install the chart we recommend to set `crds.install` to `true`. This will manage the CRDs with the Helm Chart.
27-
28-
**NOTE**: We recommend creating a dedicated release for the CRDs. This will allow you to manage the CRDs independently from the Operator.[See the Installation section](#installation)
29-
30-
If you are upgrading to this release, you can choose to set `crds.install` to `true` (by default `false`). However you need to add metadata to the existing CRDs so they can be correctly managed with the new flow. Run the following commands:
31-
32-
```bash
33-
kubectl label crd/capsuleconfigurations.capsule.clastix.io crd/globaltenantresources.capsule.clastix.io crd/tenantresources.capsule.clastix.io crd/tenants.capsule.clastix.io app.kubernetes.io/managed-by=Helm
34-
kubectl annotate crd/capsuleconfigurations.capsule.clastix.io crd/globaltenantresources.capsule.clastix.io crd/tenantresources.capsule.clastix.io crd/tenants.capsule.clastix.io meta.helm.sh/release-namespace=capsule-system # might be different
35-
kubectl annotate crd/capsuleconfigurations.capsule.clastix.io crd/globaltenantresources.capsule.clastix.io crd/tenantresources.capsule.clastix.io crd/tenants.capsule.clastix.io meta.helm.sh/release-name=capsule-crds # might be different
36-
```
37-
38-
With the new CRD management we can release update CRDs bundled with the chart. The Chart can be uninstalled and the CRDs are still kept.
26+
When you newly install the chart we recommend to set `crds.install` to `true`. This will manage the CRDs with the Helm Chart. This behavior is the new default.
3927

4028
#### Changed Values
4129

4230
The following Values have changed key or Value:
4331

4432
* All values from previous releases under `webhooks` have moved to `webhooks.hooks`.
45-
* `mutatingWebhooksTimeoutSeconds` has moved to `webhooks.mutatingWebhooksTimeoutSeconds`
46-
* `validatingWebhooksTimeoutSeconds` has moved to `webhooks.validatingWebhooksTimeoutSeconds`
33+
* `mutatingWebhooksTimeoutSeconds` has moved to `webhooks.mutatingWebhooksTimeoutSeconds`
34+
* `validatingWebhooksTimeoutSeconds` has moved to `webhooks.validatingWebhooksTimeoutSeconds`
4735

4836
## Installation
4937

@@ -54,27 +42,15 @@ The Capsule Operator Chart can be used to instantly deploy the Capsule Operator
5442

5543
$ helm repo add projectcapsule https://projectcapsule.github.io/charts
5644

57-
3. Install CRDs:
58-
59-
$ helm install capsule-crds projectcapsule/capsule --version 0.7.0 -n capsule-system --set crds.install=true --set crds.exclusive=true
60-
61-
or
62-
63-
$ helm install capsule-crds oci://ghcr.io/projectcapsule/charts/capsule --version 0.7.0 -n capsule-system --set crds.install=true --set crds.exclusive=true
64-
65-
3. Show the status:
66-
67-
$ helm status capsule-crds -n capsule-system
68-
69-
4. Install Controller:
45+
2. Install Capsule:
7046

7147
$ helm install capsule projectcapsule/capsule --version 0.7.0 -n capsule-system --create-namespace
7248

7349
or
7450

7551
$ helm install capsule oci://ghcr.io/projectcapsule/charts/capsule --version 0.7.0 -n capsule-system --create-namespace
7652

77-
5. Show the status:
53+
3. Show the status:
7854

7955
$ helm status capsule -n capsule-system
8056

@@ -90,98 +66,6 @@ The Capsule Operator Chart can be used to instantly deploy the Capsule Operator
9066

9167
$ helm uninstall capsule -n capsule-system
9268

93-
## Upgrading
94-
95-
Intsructions to upgrade the chart the versions, which may remove features or introduce breaking changes. Generally you would perform upgrades in the same order as you install the charts.
96-
97-
```
98-
1. Upgrade Helm repositories
99-
100-
$ helm repo update
101-
102-
2. Upgrade the CRDs
103-
104-
$ helm upgrade --install capsule-crds projectcapsule/capsule --version 0.7.1 -n capsule-system --set crds.install=true --set crds.exclusive=true
105-
106-
3. Show the status:
107-
108-
$ helm status capsule-crds -n capsule-system
109-
110-
4. Install Controller:
111-
112-
$ helm install upgrade --install projectcapsule/capsule --version 0.7.1 -n capsule-system --create-namespace
113-
114-
or
115-
116-
$ helm install upgrade --install oci://ghcr.io/projectcapsule/charts/capsule --version 0.7.1 -n capsule-system --create-namespace
117-
118-
5. Show the status:
119-
120-
$ helm status capsule -n capsule-system
121-
```
122-
123-
## Gitops
124-
125-
See how you can deploy Capsule with GitOps tools like FluxCD or ArgoCD.
126-
127-
### FluxCD
128-
129-
Here's an example manifest how you would deploy Capsule via [FluxCD Helmreleases](https://fluxcd.io/flux/components/helm/helmreleases/):
130-
131-
```yaml
132-
---
133-
apiVersion: source.toolkit.fluxcd.io/v1beta2
134-
kind: HelmRepository
135-
metadata:
136-
name: projectcapsule
137-
spec:
138-
type: "oci"
139-
interval: 24h0m0s
140-
url: oci://ghcr.io/projectcapsule/charts/
141-
---
142-
apiVersion: helm.toolkit.fluxcd.io/v2beta1
143-
kind: HelmRelease
144-
metadata:
145-
name: capsule-crds
146-
spec:
147-
interval: 10m
148-
targetNamespace: capsule-system
149-
releaseName: "capsule-crds"
150-
chart:
151-
spec:
152-
chart: capsule
153-
version: "0.7.0"
154-
sourceRef:
155-
kind: HelmRepository
156-
name: projectcapsule
157-
interval: 24h
158-
values:
159-
crds:
160-
install: true
161-
exclusive: true
162-
---
163-
apiVersion: helm.toolkit.fluxcd.io/v2beta1
164-
kind: HelmRelease
165-
metadata:
166-
name: capsule
167-
spec:
168-
interval: 10m
169-
dependsOn:
170-
- name: capsule-crds
171-
targetNamespace: capsule-system
172-
releaseName: "capsule"
173-
chart:
174-
spec:
175-
chart: capsule
176-
version: "0.7.0"
177-
sourceRef:
178-
kind: HelmRepository
179-
name: projectcapsule
180-
interval: 24h
181-
```
182-
183-
### ArgoCD
184-
18569
## Customize the installation
18670

18771
There are two methods for specifying overrides of values during chart installation: `--values` and `--set`.
@@ -206,8 +90,7 @@ Here the values you can override:
20690
|-----|------|---------|-------------|
20791
| crds.annnotations | object | `{}` | Extra Annotations for CRDs |
20892
| crds.exclusive | bool | `false` | Only install the CRDs, no other primitives |
209-
| crds.install | bool | `false` | Install the CustomResourceDefinitions (This also manages the lifecycle of the CRDs for update operations) |
210-
| crds.keep | bool | `true` | Keep the CustomResourceDefinitions (when the chart is deleted) |
93+
| crds.install | bool | `true` | Install the CustomResourceDefinitions (This also manages the lifecycle of the CRDs for update operations) |
21194
| crds.labels | object | `{}` | Extra Labels for CRDs |
21295

21396
### General Parameters
@@ -228,6 +111,7 @@ Here the values you can override:
228111
| jobs.nodeSelector | object | `{}` | Set the node selector |
229112
| jobs.podSecurityContext | object | `{"seccompProfile":{"type":"RuntimeDefault"}}` | Security context for the job pods. |
230113
| jobs.priorityClassName | string | `""` | Set a pod priorityClassName |
114+
| jobs.resources | object | `{}` | Job resources |
231115
| jobs.restartPolicy | string | `"Never"` | Set the restartPolicy |
232116
| jobs.securityContext | object | `{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"readOnlyRootFilesystem":true,"runAsGroup":1002,"runAsNonRoot":true,"runAsUser":1002}` | Security context for the job containers. |
233117
| jobs.tolerations | list | `[]` | Set list of tolerations |
@@ -292,6 +176,7 @@ Here the values you can override:
292176

293177
| Key | Type | Default | Description |
294178
|-----|------|---------|-------------|
179+
| webhooks.exclusive | bool | `false` | When `crds.exclusive` is `true` the webhooks will be installed |
295180
| webhooks.hooks.cordoning.failurePolicy | string | `"Fail"` | |
296181
| webhooks.hooks.cordoning.namespaceSelector.matchExpressions[0].key | string | `"capsule.clastix.io/tenant"` | |
297182
| webhooks.hooks.cordoning.namespaceSelector.matchExpressions[0].operator | string | `"Exists"` | |
@@ -324,7 +209,6 @@ Here the values you can override:
324209
| webhooks.hooks.services.namespaceSelector.matchExpressions[0].operator | string | `"Exists"` | |
325210
| webhooks.hooks.tenantResourceObjects.failurePolicy | string | `"Fail"` | |
326211
| webhooks.hooks.tenants.failurePolicy | string | `"Fail"` | |
327-
| webhooks.inclusive | bool | `false` | When `crds.exclusive` is `true` but `inclusive` is `true` the webhooks will be installed |
328212
| webhooks.mutatingWebhooksTimeoutSeconds | int | `30` | Timeout in seconds for mutating webhooks |
329213
| webhooks.service.caBundle | string | `""` | CABundle for the webhook service |
330214
| webhooks.service.name | string | `""` | Custom service name for the webhook service |

charts/capsule/README.md.gotmpl

Lines changed: 6 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -16,34 +16,22 @@ Use the Capsule Operator for easily implementing, managing, and maintaining mult
1616

1717
* A [`kubeconfig`](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/) file accessing the Kubernetes cluster with cluster admin permissions.
1818

19-
## Breaking Changes
19+
## Major Changes
2020

2121
In the following sections you see actions which are required when you are upgrading to a specific version.
2222

2323
### Upgrading to 0.7.x
2424

2525
Introduces a new methode to manage all capsule CRDs and their lifecycle. We are no longer relying on the [native CRD hook with the Helm Chart](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#some-caveats-and-explanations). The hook only allows to manage CRDs on install and uninstall but we can't deliver updates to the CRDs.
26-
When you newly install the chart we recommend to set `crds.install` to `true`. This will manage the CRDs with the Helm Chart.
27-
28-
**NOTE**: We recommend creating a dedicated release for the CRDs. This will allow you to manage the CRDs independently from the Operator.[See the Installation section](#installation)
29-
30-
If you are upgrading to this release, you can choose to set `crds.install` to `true` (by default `false`). However you need to add metadata to the existing CRDs so they can be correctly managed with the new flow. Run the following commands:
31-
32-
```bash
33-
kubectl label crd/capsuleconfigurations.capsule.clastix.io crd/globaltenantresources.capsule.clastix.io crd/tenantresources.capsule.clastix.io crd/tenants.capsule.clastix.io app.kubernetes.io/managed-by=Helm
34-
kubectl annotate crd/capsuleconfigurations.capsule.clastix.io crd/globaltenantresources.capsule.clastix.io crd/tenantresources.capsule.clastix.io crd/tenants.capsule.clastix.io meta.helm.sh/release-namespace=capsule-system # might be different
35-
kubectl annotate crd/capsuleconfigurations.capsule.clastix.io crd/globaltenantresources.capsule.clastix.io crd/tenantresources.capsule.clastix.io crd/tenants.capsule.clastix.io meta.helm.sh/release-name=capsule-crds # might be different
36-
```
37-
38-
With the new CRD management we can release update CRDs bundled with the chart. The Chart can be uninstalled and the CRDs are still kept.
26+
When you newly install the chart we recommend to set `crds.install` to `true`. This will manage the CRDs with the Helm Chart. This behavior is the new default.
3927

4028
#### Changed Values
4129

4230
The following Values have changed key or Value:
4331

4432
* All values from previous releases under `webhooks` have moved to `webhooks.hooks`.
45-
* `mutatingWebhooksTimeoutSeconds` has moved to `webhooks.mutatingWebhooksTimeoutSeconds`
46-
* `validatingWebhooksTimeoutSeconds` has moved to `webhooks.validatingWebhooksTimeoutSeconds`
33+
* `mutatingWebhooksTimeoutSeconds` has moved to `webhooks.mutatingWebhooksTimeoutSeconds`
34+
* `validatingWebhooksTimeoutSeconds` has moved to `webhooks.validatingWebhooksTimeoutSeconds`
4735

4836

4937
## Installation
@@ -55,27 +43,15 @@ The Capsule Operator Chart can be used to instantly deploy the Capsule Operator
5543

5644
$ helm repo add projectcapsule https://projectcapsule.github.io/charts
5745

58-
3. Install CRDs:
59-
60-
$ helm install capsule-crds projectcapsule/capsule --version 0.7.0 -n capsule-system --set crds.install=true --set crds.exclusive=true
61-
62-
or
63-
64-
$ helm install capsule-crds oci://ghcr.io/projectcapsule/charts/capsule --version 0.7.0 -n capsule-system --set crds.install=true --set crds.exclusive=true
65-
66-
3. Show the status:
67-
68-
$ helm status capsule-crds -n capsule-system
69-
70-
4. Install Controller:
46+
2. Install Capsule:
7147

7248
$ helm install capsule projectcapsule/capsule --version 0.7.0 -n capsule-system --create-namespace
7349

7450
or
7551

7652
$ helm install capsule oci://ghcr.io/projectcapsule/charts/capsule --version 0.7.0 -n capsule-system --create-namespace
7753

78-
5. Show the status:
54+
3. Show the status:
7955

8056
$ helm status capsule -n capsule-system
8157

@@ -91,101 +67,6 @@ The Capsule Operator Chart can be used to instantly deploy the Capsule Operator
9167

9268
$ helm uninstall capsule -n capsule-system
9369

94-
## Upgrading
95-
96-
Intsructions to upgrade the chart the versions, which may remove features or introduce breaking changes. Generally you would perform upgrades in the same order as you install the charts.
97-
98-
```
99-
1. Upgrade Helm repositories
100-
101-
$ helm repo update
102-
103-
2. Upgrade the CRDs
104-
105-
$ helm upgrade --install capsule-crds projectcapsule/capsule --version 0.7.1 -n capsule-system --set crds.install=true --set crds.exclusive=true
106-
107-
3. Show the status:
108-
109-
$ helm status capsule-crds -n capsule-system
110-
111-
4. Install Controller:
112-
113-
$ helm install upgrade --install projectcapsule/capsule --version 0.7.1 -n capsule-system --create-namespace
114-
115-
or
116-
117-
$ helm install upgrade --install oci://ghcr.io/projectcapsule/charts/capsule --version 0.7.1 -n capsule-system --create-namespace
118-
119-
5. Show the status:
120-
121-
$ helm status capsule -n capsule-system
122-
```
123-
124-
## Gitops
125-
126-
See how you can deploy Capsule with GitOps tools like FluxCD or ArgoCD.
127-
128-
### FluxCD
129-
130-
Here's an example manifest how you would deploy Capsule via [FluxCD Helmreleases](https://fluxcd.io/flux/components/helm/helmreleases/):
131-
132-
```yaml
133-
---
134-
apiVersion: source.toolkit.fluxcd.io/v1beta2
135-
kind: HelmRepository
136-
metadata:
137-
name: projectcapsule
138-
spec:
139-
type: "oci"
140-
interval: 24h0m0s
141-
url: oci://ghcr.io/projectcapsule/charts/
142-
---
143-
apiVersion: helm.toolkit.fluxcd.io/v2beta1
144-
kind: HelmRelease
145-
metadata:
146-
name: capsule-crds
147-
spec:
148-
interval: 10m
149-
targetNamespace: capsule-system
150-
releaseName: "capsule-crds"
151-
chart:
152-
spec:
153-
chart: capsule
154-
version: "0.7.0"
155-
sourceRef:
156-
kind: HelmRepository
157-
name: projectcapsule
158-
interval: 24h
159-
values:
160-
crds:
161-
install: true
162-
exclusive: true
163-
---
164-
apiVersion: helm.toolkit.fluxcd.io/v2beta1
165-
kind: HelmRelease
166-
metadata:
167-
name: capsule
168-
spec:
169-
interval: 10m
170-
dependsOn:
171-
- name: capsule-crds
172-
targetNamespace: capsule-system
173-
releaseName: "capsule"
174-
chart:
175-
spec:
176-
chart: capsule
177-
version: "0.7.0"
178-
sourceRef:
179-
kind: HelmRepository
180-
name: projectcapsule
181-
interval: 24h
182-
```
183-
184-
### ArgoCD
185-
186-
187-
188-
18970
## Customize the installation
19071

19172
There are two methods for specifying overrides of values during chart installation: `--values` and `--set`.

0 commit comments

Comments
 (0)