Skip to content
Snippets Groups Projects
Commit 77cf8bc6 authored by Alexandre Lossent's avatar Alexandre Lossent
Browse files

go operator CRD example

parent 1fca4c1f
No related branches found
No related tags found
No related merge requests found
Pipeline #4134989 passed
# First Operator
As an introductory step we recommend going over the [tutorial](https://sdk.operatorframework.io/docs/building-operators/golang/tutorial/) on the Operator-SDK project in order to get familiar with the OperatorSDK CLI and what it does.
For OKD4 operators we typically use:
- `--domain=webservices.cern.ch`
- a separate `--group=<myoperator>` for each operator
- a GitLab project under <https://gitlab.cern.ch/paas-tools/operators>
......@@ -12,6 +12,20 @@ When you have reached a solid design, of your CRD the next step is to code its t
- Defining the `Spec`: part of the CR that users will be able to modify;
- Defining the `Status`: part of the CR that will be used by the Operator to report back status;
## Example
For OKD4 operators we typically use:
- `--domain=webservices.cern.ch`
- a separate `--group=<myoperator>` for each operator
- a GitLab project under <https://gitlab.cern.ch/paas-tools/operators>
```bash
operator-sdk init --domain webservices.cern.ch --repo gitlab.cern.ch/paas-tools/operators/sitedetails-operator
# create a cluster-scoped custom resource with Group=sitedetails.webservices.cern.ch, Version=v1alpha1, Kind=HostnameInfo
operator-sdk create api --group sitedetails --version v1alpha1 --kind HostnameInfo --resource --controller --plural=hostnameinfos --namespaced=false
```
## CRD Group, Version and Kind
### Group
......
......@@ -4,7 +4,11 @@ In order to create a new Helm operator, refer to the upstream documentation:
- <https://sdk.operatorframework.io/docs/building-operators/helm/tutorial/#create-a-new-project>
E.g. for an application template `Nexus` for the app-catalogue, use the following domain and group so that each operator has its own group: `operator-sdk init --plugins helm --domain webservices.cern.ch --group nexus --version v1alpha1 --kind Nexus`
E.g. for an application template `Nexus` for the app-catalogue, use the following domain and group so that each operator has its own group:
```bash
operator-sdk init --plugins helm --domain webservices.cern.ch --group nexus --version v1alpha1 --kind Nexus
```
You can create a Helm operator from scratch, or create one based on an existing chart.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment