Add Makefile cluster sync target#8
Conversation
3e7b578 to
0eef43b
Compare
Since config/crd/kustomizeconfig.yaml not exist it should be removed from config/crd/kustomization.yaml manifest. Without this change 'make manifests' fails. Signed-off-by: Or Mergi <ormergi@redhat.com>
790322b to
0bb3b61
Compare
| endif | ||
|
|
||
| IMAGE_REGISTRY ?= quay.io | ||
| IMAGE_ORG ?= omergi |
There was a problem hiding this comment.
IMAGE_ORG ?= slefserviceoverlay
There was a problem hiding this comment.
I removed the image org for now and set the registry to localhost to make kind load work as expected (leaving the image with no org cause the node to fetch image from docker.io).
Let set the image org name and a remote regeistry once we setup local/remote registry.
| ./automation/cluster.sh --down | ||
|
|
||
| KIND_BIN ?= kind | ||
| CLUSTER_NAME ?= ovn |
There was a problem hiding this comment.
Where do we specify it is the name of the cluster?
There was a problem hiding this comment.
cluster-up target uses ovn-org/ovn-kubernetes scripts to create cluster for tests, default name is "ovn".
I will post a follow up PR to make it visible in the Makefile.
| docker save ${IMG} -o ${IMAGE_TAR} | ||
| $(KIND_BIN) load image-archive --name=${CLUSTER_NAME} ${IMAGE_TAR} | ||
|
|
||
| .PHONY: |
| $(KIND_BIN) load image-archive --name=${CLUSTER_NAME} ${IMAGE_TAR} | ||
|
|
||
| .PHONY: | ||
| cluster-sync: undeploy uninstall test install docker-build kind-push deploy |
There was a problem hiding this comment.
Why unit tests have to run on cluster-sync?
There was a problem hiding this comment.
Please make the build work with any oci bin.
OCI_BIN ?= $(shell if podman ps >/dev/null 2>&1; then echo podman; elif docker ps >/dev/null 2>&1; then echo docker; fi)
There was a problem hiding this comment.
Why unit tests have to run on cluster-sync?
My bad, no need to run unit tests as part of cluster-sync.
Changed to use generate fmt and vet instead on test.
We could use build target, but since docker-build already build the go binary we avoid building it twice by calling docker-build only.
Also, I had to change 'undelpoy' target to have `kustomize' target as a prerequisite to avoid failures when Kustomize is not installed yet.
Please make the build work with any oci bin.
OCI_BIN ?= $(shell if podman ps >/dev/null 2>&1; then echo podman; elif docker ps >/dev/null 2>&1; then echo docker; fi)
I have posted another PR that introduce OCI_BIN #7
| - manager.yaml | ||
| images: | ||
| - name: controller | ||
| newName: quay.io/omergi/overlay-network-controller |
There was a problem hiding this comment.
Please change according to the new proposed image name.
Cluster sync build the controller and deploy it to the local cluster enabling faster iterations. Introduce 'kind-push' target, it enables pushing the controller image to cluster nodes container runtime local registry using KinD. cluster-sync flow: - Remove the installed CRDs, Deployment and all related object (namesapce, sa, rbac, etc..) - Generate manifest (CRD, RBAC, etc..). - Generates code (DeepCopy, etc..). - go fmt, go vet - Build controller the image. - Push the image to cluster nodes container runtime local registry (using kind). - Deploy the controller CRDs. - Generate manifests (Namespace, SA, Deployment, etc.., using Kustomize) - Deploy controller and all related objects. The default container image tag, represented by IMG, is changed as follows to make kind load work as expected: 'localhost/overlay-network-controller:devel' Add 'kustomize' target as a prerequisite of 'undelpoy' target to avoid failures when Kustomize is not installed. Signed-off-by: Or Mergi <ormergi@redhat.com>
This commit change introduced by 'make deploy'.
It replaces the default image name ("controller") with the image name spesified
in Makefile by $IMG.
Signed-off-by: Or Mergi <ormergi@redhat.com>
0bb3b61 to
88afbd6
Compare
Please update the image. |
Cluster sync build the controller and deploy it to the local cluster
enabling faster iterations.
Introduce 'kind-push' target, it enables pushing the controller image
to cluster nodes container runtime local registry using KinD.
cluster-sync flow:
The default container image tag, represented by $IMG, is changed as follows to
make kind load work as expected:
'localhost/overlay-network-controller:devel'