Oracle welcomes your contributions! For more information about how to contribute, review the Contributing guidelines.
The below is guidance for establishing a development environment and building/testing contributions before submitting them for review.
This Operator is developed using the Operator SDK Framework. It is recommended to walk-through the Operator SDK Go tutorial to familiarise yourself with the process.
- Access to a Kubernetes v1.28.8+ cluster.
- Access to a Container Registry.
- kubectl version v1.29.3+.
- go version v1.21.9+.
- docker or podman. If using docker, alias
podman
to thedocker
binary.
A Kubernetes Cluster is required. The cluster can be localised via Rancher, Docker, Minikube, Kind etc. or remote using cloud based clusters such as Oracle Kubernetes Engine (OKE). For a localised cluster, Kind is preferred as it can store the Operator image without the need for an external Container Registry.
Access to the Cluster is required. Access via kubectl
to the Kubernetes cluster
This is an example only of setting up your development environment and a standard workflow.
If you are using a different OS/Architecture, please feel encouraged to provide additional instructions.
Note the following images are pulled as part of the development:
- docker.io/kindest/node:v1.29.2 (when using Kind)
- docker.io/moby/buildkit:buildx-stable-1
- container-registry.oracle.com/os/oraclelinux:9-slim
This example was tested on MacOS(Intel) using a Kind cluster and podman
.
-
Install Software using Brew
brew install kind podman kubectl golang operator-sdk
-
Setup the
podman
helperPODMAN_VERSION=$(podman -v |awk '{print $NF}') sudo /usr/local/Cellar/podman/${PODMAN_VERSION}/bin/podman-mac-helper install
-
Symlink
docker
topodman
; this is forkind load docker-image
to workln -s /usr/local/bin/podman /usr/local/bin/docker
-
Create a
podman
machine: During theinit
you may want to increase the cpu/memory/disk (i.e --memory 32768 --cpus 6 --disk-size 1000)podman machine init podman machine set --rootful podman machine start
-
Create a Kind cluster:
kind create cluster --name ords-operator
-
Verify cluster access:
kubectl cluster-info --context kind-ords-operator
-
Install Software using dnf
dnf install podman podman-docker golang
-
Install Kind and Kubectl:
[ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.22.0/kind-linux-amd64 curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" chomd u+x kind kubectl cp kind /usr/local/bin cp kubectl /usr/local/bin
-
Create a Kind cluster:
kind create cluster --name ords-operator
-
Verify cluster access:
kubectl cluster-info --context kind-ords-operator
After developing, perform the following build steps:
make generate manifests gen-doco
make docker-build
make kind-load
Deploy the updated code:
make undeploy
make deploy