Skip to content

Commit fb9af3b

Browse files
authored
feat(helm): providing kamaji-crds chart (#894)
* feat(helm): providing kamaji-crds chart Signed-off-by: Dario Tranchitella <[email protected]> * chore(gh): linting and publishing Signed-off-by: Dario Tranchitella <[email protected]> * chore(e2e): installing crds during e2e Signed-off-by: Dario Tranchitella <[email protected]> --------- Signed-off-by: Dario Tranchitella <[email protected]>
1 parent b65a7cf commit fb9af3b

15 files changed

+8077
-2
lines changed

.github/workflows/helm.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ jobs:
1515
with:
1616
fetch-depth: 0
1717
- run: make -C charts/kamaji docs
18-
- name: Checking if Helm docs is not aligned
18+
- name: Checking if Kamaji Helm Chart docs is not aligned
19+
run: if [[ $(git diff | wc -l) -gt 0 ]]; then echo ">>> Untracked changes have not been committed" && git --no-pager diff && exit 1; fi
20+
- run: make -C charts/kamaji-crds docs
21+
- name: Checking if Kamaji CRDs Helm Chart docs is not aligned
1922
run: if [[ $(git diff | wc -l) -gt 0 ]]; then echo ">>> Untracked changes have not been committed" && git --no-pager diff && exit 1; fi
2023
lint:
2124
runs-on: ubuntu-22.04
@@ -28,8 +31,10 @@ jobs:
2831
run: |-
2932
helm repo add clastix https://clastix.github.io/charts
3033
helm dependency build ./charts/kamaji
31-
- name: Linting Chart
34+
- name: Linting Kamaji Helm Chart
3235
run: helm lint ./charts/kamaji
36+
- name: Linting Kamaji CRDS Helm Chart
37+
run: helm lint ./charts/kamaji-crds
3338
release:
3439
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
3540
needs: [ "lint", "diff" ]

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,16 @@ webhook: controller-gen yq
129129
$(YQ) -i 'map(.clientConfig.service.namespace |= "{{ .Release.Namespace }}")' ./charts/kamaji/controller-gen/validating-webhook.yaml
130130

131131
crds: controller-gen yq
132+
# kamaji chart
132133
$(CONTROLLER_GEN) crd webhook paths="./..." output:stdout | $(YQ) 'select(documentIndex == 0)' > ./charts/kamaji/crds/kamaji.clastix.io_datastores.yaml
133134
$(CONTROLLER_GEN) crd webhook paths="./..." output:stdout | $(YQ) 'select(documentIndex == 1)' > ./charts/kamaji/crds/kamaji.clastix.io_tenantcontrolplanes.yaml
134135
$(YQ) -i '. *n load("./charts/kamaji/controller-gen/crd-conversion.yaml")' ./charts/kamaji/crds/kamaji.clastix.io_tenantcontrolplanes.yaml
136+
# kamaji-crds chart
137+
cp ./charts/kamaji/controller-gen/crd-conversion.yaml ./charts/kamaji-crds/hack/crd-conversion.yaml
138+
$(YQ) '.spec' ./charts/kamaji/crds/kamaji.clastix.io_datastores.yaml > ./charts/kamaji-crds/hack/kamaji.clastix.io_datastores_spec.yaml
139+
$(YQ) '.spec' ./charts/kamaji/crds/kamaji.clastix.io_tenantcontrolplanes.yaml > ./charts/kamaji-crds/hack/kamaji.clastix.io_tenantcontrolplanes_spec.yaml
140+
$(YQ) -i '.conversion.webhook.clientConfig.service.name = "{{ .Values.kamajiService }}"' ./charts/kamaji-crds/hack/kamaji.clastix.io_tenantcontrolplanes_spec.yaml
141+
$(YQ) -i '.conversion.webhook.clientConfig.service.namespace = "{{ .Values.kamajiNamespace }}"' ./charts/kamaji-crds/hack/kamaji.clastix.io_tenantcontrolplanes_spec.yaml
135142

136143
manifests: rbac webhook crds ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
137144

@@ -242,6 +249,7 @@ env: kind
242249

243250
.PHONY: e2e
244251
e2e: env build load helm ginkgo cert-manager ## Create a KinD cluster, install Kamaji on it and run the test suite.
252+
$(HELM) upgrade --debug --install kamaji-crds ./charts/kamaji-crds --create-namespace --namespace kamaji-system
245253
$(HELM) repo add clastix https://clastix.github.io/charts
246254
$(HELM) dependency build ./charts/kamaji
247255
$(HELM) upgrade --debug --install kamaji ./charts/kamaji --create-namespace --namespace kamaji-system --set "image.tag=$(VERSION)" --set "image.pullPolicy=Never" --set "telemetry.disabled=true"

charts/kamaji-crds/.helmignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
24+
# Helm source files
25+
README.md.gotmpl
26+
.helmignore
27+
# Build tools
28+
Makefile

charts/kamaji-crds/Chart.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
apiVersion: v2
2+
appVersion: latest
3+
description: Kamaji is the Hosted Control Plane Manager for Kubernetes.
4+
home: https://github.com/clastix/kamaji
5+
icon: https://github.com/clastix/kamaji/raw/master/assets/logo-colored.png
6+
maintainers:
7+
8+
name: Dario Tranchitella
9+
url: https://clastix.io
10+
11+
name: Adriano Pezzuto
12+
url: https://clastix.io
13+
name: kamaji-crds
14+
sources:
15+
- https://github.com/clastix/kamaji
16+
type: application
17+
version: 0.0.0+edge
18+
annotations:
19+
artifacthub.io/crds: |
20+
- kind: TenantControlPlane
21+
version: v1alpha1
22+
name: tenantcontrolplanes.kamaji.clastix.io
23+
displayName: TenantControlPlane
24+
description: TenantControlPlane defines the desired state for a Control Plane backed by Kamaji.
25+
- kind: DataStore
26+
version: v1alpha1
27+
name: datastores.kamaji.clastix.io
28+
displayName: DataStore
29+
description: DataStores is holding all the required details to communicate with a Datastore, such as etcd, MySQL, PostgreSQL, and NATS.
30+
artifacthub.io/links: |
31+
- name: CLASTIX
32+
url: https://clastix.io
33+
- name: support
34+
url: https://clastix.io/support
35+
artifacthub.io/changes: |
36+
- kind: added
37+
description: First commit

charts/kamaji-crds/Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
docs: HELMDOCS_VERSION := v1.8.1
2+
docs: docker
3+
@docker run --rm -v "$$(pwd):/helm-docs" -u $$(id -u) jnorwood/helm-docs:$(HELMDOCS_VERSION)
4+
5+
docker:
6+
@hash docker 2>/dev/null || {\
7+
echo "You need docker" &&\
8+
exit 1;\
9+
}

charts/kamaji-crds/NOTES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Kamaji Custom Resource Definitions have been installed properly:
2+
you can proceed to upgrade your Kamaji operator instance.

charts/kamaji-crds/README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# kamaji-crds
2+
3+
![Version: 0.0.0+edge](https://img.shields.io/badge/Version-0.0.0+edge-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)
4+
5+
Kamaji is the Hosted Control Plane Manager for Kubernetes.
6+
7+
## Maintainers
8+
9+
| Name | Email | Url |
10+
| ---- | ------ | --- |
11+
| Dario Tranchitella | <[email protected]> | <https://clastix.io> |
12+
| Adriano Pezzuto | <[email protected]> | <https://clastix.io> |
13+
14+
## Source Code
15+
16+
* <https://github.com/clastix/kamaji>
17+
18+
[Kamaji](https://github.com/clastix/kamaji) Custom Resource Definitions packaged as Helm Charts.
19+
20+
## How to use this chart
21+
22+
Add `clastix` Helm repository:
23+
24+
helm repo add clastix https://clastix.github.io/charts
25+
26+
Install the Chart with the release name `kamaji-crds`:
27+
28+
helm upgrade --install --namespace kamaji-system --create-namespace kamaji-crds clastix/kamaji-crds
29+
30+
Show the status:
31+
32+
helm status kamaji-crds -n kamaji-system
33+
34+
Upgrade the Chart
35+
36+
helm upgrade kamaji-crds -n kamaji-system clastix/kamaji-crds
37+
38+
Uninstall the Chart
39+
40+
helm uninstall kamaji-crds -n kamaji-system
41+
42+
## Customize the installation
43+
44+
There are two methods for specifying overrides of values during Chart installation: `--values` and `--set`.
45+
46+
The `--values` option is the preferred method because it allows you to keep your overrides in a YAML file, rather than specifying them all on the command line. Create a copy of the YAML file `values.yaml` and add your overrides to it.
47+
48+
Specify your overrides file when you install the Chart:
49+
50+
helm upgrade kamaji-crds --install --namespace kamaji-system --create-namespace clastix/kamaji-crds --values myvalues.yaml
51+
52+
The values in your overrides file `myvalues.yaml` will override their counterparts in the Chart's values.yaml file. Any values in `values.yaml` that weren’t overridden will keep their defaults.
53+
54+
If you only need to make minor customizations, you can specify them on the command line by using the `--set` option. For example:
55+
56+
helm upgrade kamaji-crds --install --namespace kamaji-system --create-namespace clastix/kamaji-crds --set kamajiCertificateName=kamaji
57+
58+
## Values
59+
60+
| Key | Type | Default | Description |
61+
|-----|------|---------|-------------|
62+
| fullnameOverride | string | `""` | Overrides the full name of the resources created by the chart. |
63+
| kamajiCertificateName | string | `"kamaji-serving-cert"` | The cert-manager Certificate resource name, holding the Certificate Authority for webhooks. |
64+
| kamajiNamespace | string | `"kamaji-system"` | The namespace where Kamaji has been installed: required to inject the Certificate Authority for cert-manager. |
65+
| kamajiService | string | `"kamaji-webhook-service"` | The Kamaji webhook Service name. |
66+
| nameOverride | string | `""` | Overrides the name of the chart for resource naming purposes. |
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{{ template "chart.header" . }}
2+
{{ template "chart.deprecationWarning" . }}
3+
4+
{{ template "chart.badgesSection" . }}
5+
6+
{{ template "chart.description" . }}
7+
8+
{{ template "chart.maintainersSection" . }}
9+
10+
{{ template "chart.sourcesSection" . }}
11+
12+
{{ template "chart.requirementsSection" . }}
13+
14+
[Kamaji](https://github.com/clastix/kamaji) Custom Resource Definitions packaged as Helm Charts.
15+
16+
## How to use this chart
17+
18+
Add `clastix` Helm repository:
19+
20+
helm repo add clastix https://clastix.github.io/charts
21+
22+
Install the Chart with the release name `kamaji-crds`:
23+
24+
helm upgrade --install --namespace kamaji-system --create-namespace kamaji-crds clastix/kamaji-crds
25+
26+
Show the status:
27+
28+
helm status kamaji-crds -n kamaji-system
29+
30+
Upgrade the Chart
31+
32+
helm upgrade kamaji-crds -n kamaji-system clastix/kamaji-crds
33+
34+
Uninstall the Chart
35+
36+
helm uninstall kamaji-crds -n kamaji-system
37+
38+
## Customize the installation
39+
40+
There are two methods for specifying overrides of values during Chart installation: `--values` and `--set`.
41+
42+
The `--values` option is the preferred method because it allows you to keep your overrides in a YAML file, rather than specifying them all on the command line. Create a copy of the YAML file `values.yaml` and add your overrides to it.
43+
44+
Specify your overrides file when you install the Chart:
45+
46+
helm upgrade kamaji-crds --install --namespace kamaji-system --create-namespace clastix/kamaji-crds --values myvalues.yaml
47+
48+
The values in your overrides file `myvalues.yaml` will override their counterparts in the Chart's values.yaml file. Any values in `values.yaml` that weren’t overridden will keep their defaults.
49+
50+
If you only need to make minor customizations, you can specify them on the command line by using the `--set` option. For example:
51+
52+
helm upgrade kamaji-crds --install --namespace kamaji-system --create-namespace clastix/kamaji-crds --set kamajiCertificateName=kamaji
53+
54+
{{ template "chart.valuesSection" . }}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
spec:
2+
conversion:
3+
strategy: Webhook
4+
webhook:
5+
clientConfig:
6+
service:
7+
name: kamaji-webhook-service
8+
namespace: kamaji-system
9+
path: /convert
10+
conversionReviewVersions:
11+
- v1

0 commit comments

Comments
 (0)