Instructions for building and testing the Verrazzano module operator.
controller-gen
v0.9.2go
version v1.19- Docker
kubectl
helm
(for testing)
-
To build the operator:
make go-build
-
To build the Docker image:
DOCKER_REPO=<repo> DOCKER_NAMESPACE=<namespace> make docker-build
-
To build and push the Docker image:
DOCKER_REPO=<repo> DOCKER_NAMESPACE=<namespace> make docker-push
-
To build and push the Docker image and generate artifacts:
IMAGE_PULL_SECRETS=<secret name> DOCKER_REPO=<repo> DOCKER_NAMESPACE=<namespace> make generate-operator-artifacts docker-push
-
After building and pushing the Docker image and generating the operator artifacts, apply the operator YAML file:
kubectl apply -f build/deploy/verrazzano-module-operator.yaml
-
Wait for the operator:
kubectl -n verrazzano-install rollout status deployment/verrazzano-module-operator
-
Alternatively, apply the CRDs and use
make
to run the operator:kubectl apply -f manifests/charts/operators/verrazzano-module-operator/crds/* make run
-
After installing the operator, apply a Module CR:
kubectl apply -f - <<EOF apiVersion: platform.verrazzano.io/v1alpha1 kind: Module metadata: name: vz-test spec: moduleName: helm targetNamespace: default EOF
-
Verify that the Helm chart was installed:
helm ls
If you update the API definitions, then you must regenerate CRDs and code.
-
To generate manifests (for example, CRDs):
make manifests
-
To generate code (for example,
zz_generated.deepcopy.go
):make generate