forked from open-component-model/open-component-model
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.md.gotmpl
More file actions
125 lines (88 loc) · 3.57 KB
/
Copy pathREADME.md.gotmpl
File metadata and controls
125 lines (88 loc) · 3.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
{{ template "chart.header" . }}
{{ template "chart.deprecationWarning" . }}
{{ template "chart.badgesSection" . }}
{{ template "chart.description" . }}
{{ template "chart.homepageLine" . }}
## Description
The OCM Kubernetes Toolkit controller manages OCM (Open Component Model) resources in Kubernetes clusters.
It provides controllers for:
- **Repository** - OCM repository references
- **Component** - OCM component version tracking
- **Resource** - OCM resource extraction
- **Deployer** - Resource deployment automation
## Installation
```bash
helm install ocm-k8s-toolkit oci://ghcr.io/open-component-model/kubernetes/controller/chart \
--namespace ocm-system \
--create-namespace
```
## Upgrading
```bash
helm upgrade ocm-k8s-toolkit oci://ghcr.io/open-component-model/kubernetes/controller/chart \
--namespace ocm-system
```
## Uninstallation
```bash
helm uninstall ocm-k8s-toolkit --namespace ocm-system
```
> **Note:** CRDs are kept by default when uninstalling. To remove them:
> ```bash
> kubectl delete crd components.delivery.ocm.software deployers.delivery.ocm.software repositories.delivery.ocm.software resources.delivery.ocm.software
> ```
{{ template "chart.maintainersSection" . }}
{{ template "chart.sourcesSection" . }}
{{ template "chart.requirementsSection" . }}
{{ template "chart.valuesSection" . }}
## Development
Run these tasks from the `kubernetes/controller` directory.
### Regenerating CRDs and manager-role
When API types or `//+kubebuilder:rbac` markers change, regenerate the Helm
templates:
```bash
task helm/generate
```
This runs `controller-gen` to produce raw CRDs into `config/crd/bases` and a raw
ClusterRole into `bin/gen/rbac`, then invokes two post-processors:
- `hack/helm.generate.sh` reformats the CRDs and injects Helm template wrappers
(`crd.enable`, cert-manager CA-injection annotation, conversion webhook block)
into `chart/templates/crd/`.
- `hack/rbac.generate.sh` reformats the ClusterRole and rewrites `metadata.name`
to the chart's templated resource name, writing
`chart/templates/rbac/manager-role.yaml`.
Individual targets `task helm/generate-crds` and `task helm/generate-rbac` are
also available.
> **Note:** Only `manager-role.yaml` is regenerated from Go markers. The
> ClusterRoleBinding, ServiceAccount, leader-election Role/RoleBinding, and
> per-kind editor/viewer aggregation roles under `chart/templates/rbac/` are
> hand-maintained because they are not derivable from `//+kubebuilder:rbac`
> markers. Other templates (`manager.yaml`, `_helpers.tpl`, etc.) are likewise
> hand-maintained.
### Validating changes
Before committing, run validation to ensure all generated files are in sync:
```bash
task helm/validate
```
This checks:
- Chart linting passes
- Templates render successfully
- CRDs, manager-role, schema, and docs are up to date
### Regenerating artifacts after values.yaml changes
```bash
task helm/schema # Regenerate values.schema.json
task helm/docs # Regenerate README.md
```
### Packaging the chart
Package the chart for distribution:
```bash
task helm/package # Use versions from Chart.yaml
task helm/package VERSION=1.0.0 # Override chart version
task helm/package APP_VERSION=1.0.0 # Override app version (image tag)
task helm/package VERSION=1.0.0 APP_VERSION=1.0.0 # Override both
```
The packaged chart is saved to `dist/chart-<version>.tgz`.
### Other useful tasks
```bash
task helm/template # Render templates locally
task helm/install # Install chart to current cluster
task helm/uninstall # Remove chart from cluster
```