This document is to aid any developers working on building the k8s operator. It is not needed to just use the operator (the operator is not ready for use yet!!)
These need to be installed and configured in order to build the k8s operator
- operator sdk - version 1.6.2
- go 1.15.x - install from website, os distro, or homebrew (As of April 2021 1.16 is not supported - see operator-framework/operator-sdk#4690 )
- Other dependencies as documented by operator-sdk including docker, kubectl, kubernetes
- make - for the build process
- A *nix variant or macOS (shell script usage)
- Ensure you have 'GO111MODULE=on' set
- Due to a bug in the toolkit, the kube-proxy-rbac image used is provided by openshift. See operator-framework/operator-sdk#4813 (comment) for more information.
These commands use the operator-sdk to create the initial project. Code is then edited manually. The commands used are included here in case we need to rebuild the template in future and remerge in customized code
operator-sdk init --domain egeria-project.org --license apache2 --owner 'Contributors to the Egeria project' --project-name 'egeria' --repo 'github.com/odpi/egeria-k8s-operator' [11:13:14]
operator-sdk create api --group egeria --version v1alpha1 --kind EgeriaPlatform
This is needed if the egeria type is modified -- it keeps the go type definitions in sync
make generate
Then we need to build the new CRD with
make manifests
make install
make docker-build docker-push IMG=odpi/egeria-k8s-operator:0.1.0
make install
make deploy IMG=odpi/egeria-k8s-operator:0.1.0
kubectl get deployment -n egeria-system
kubectl get pods -n egeria-system
Then use that pod id in the entry below:
kubectl logs egeria-k8s-operator-controller-manager-6bf887c74c-78mwc -n egeria-k8s-operator-system manager
kubectl apply -f config/samples/egeria_v1alpha1_egeriaplatform.yaml
kubectl get egeria.egeria.odpi.org
kubectl edit egeria.egeria.odpi.org egeria-sample
ie change the size to 10 to scale
kubectl delete -f config/crd/bases/egeria.egeria-project.org_egeriaplatforms.yaml
kustomize build config/default | kubectl delete -f -
- We are using operator-sdk 1.0.0 for tooling
- golang is the implementation language for the oeprator
- operator is cluster-scoped - this is the default and can be revisited in future
- operator uses a single group 'org.odpi.egeria' for it's APIs - also the default
- The initial implementation uses a single kind called 'Egeria' - think of this as the k8s resource type we are dealing with
- We will start with version 1 ('v1')
See the #egeria-k8s channel on slack at https://slack.odpi.org
License: CC BY 4.0, Copyright Contributors to the ODPi Egeria project.