From 5958aaf31697baf1d1d56ae8229821ee55ad9199 Mon Sep 17 00:00:00 2001 From: Abhishek Mitra Date: Wed, 14 Jun 2023 06:48:28 -0700 Subject: [PATCH] Cherry pick updates from main (#50) * Cherry pick updates from main * aamitra/update template examples (#49) * Update CAPI to module latest main * Update examples with module operator --- Dockerfile | 16 ++++++++++++++-- Makefile | 5 +++-- ...e-existingvcnwithaddons-disconnected-env.yaml | 2 +- ...mplate-existingvcnwithaddons-skipinstall.yaml | 10 +++++----- .../cluster-template-existingvcnwithaddons.yaml | 10 +++++----- ...xistingvcnwithaddonsandproxy-skipinstall.yaml | 10 +++++----- ...r-template-existingvcnwithaddonsandproxy.yaml | 10 +++++----- 7 files changed, 38 insertions(+), 25 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4af3d57..7529461 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,17 +32,20 @@ WORKDIR /workspace ARG goproxy=https://proxy.golang.org ARG vz_module_branch ARG vz_module_commit +ARG vz_module_tag + + # Run this with docker build --build-arg package=./controlplane/kubeadm or --build-arg package=./bootstrap/kubeadm ENV GOPROXY=$goproxy ENV VERRAZZANO_MODULE_BRANCH=$vz_module_branch ENV VERRAZZANO_MODULE_COMMIT=$vz_module_commit +ENV VERRAZZANO_MODULE_OPERATOR_TAG=$vz_module_tag ENV VERRAZZANO_MODULE_DIRECTORY=verrazzano-modules - RUN dnf install -y oracle-olcne-release-el8 oraclelinux-developer-release-el8 && \ dnf config-manager --enable ol8_olcne16 ol8_developer && \ dnf update -y && \ - dnf install -y yq helm-3.11.1-1.el8 tar git go-toolset-1.19.6 && \ + dnf install -y jq helm-3.11.1-1.el8 tar git go-toolset-1.19.6 && \ go version RUN git clone -b $VERRAZZANO_MODULE_BRANCH https://github.com/verrazzano/verrazzano-modules.git && \ @@ -50,6 +53,12 @@ RUN git clone -b $VERRAZZANO_MODULE_BRANCH https://github.com/verrazzano/verrazz cd verrazzano-modules/module-operator/manifests/charts/modules && \ find . -type d -exec helm package -u '{}' \; && helm repo index . +RUN dnf module install -y python39 && \ + dnf install -y python39-pip python39-requests && \ + yum clean all && \ + python3 -m pip install -U pip && \ + python3 -m pip install yq + # Copy the Go Modules manifests COPY go.mod go.mod COPY go.sum go.sum @@ -71,6 +80,9 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} \ go build -trimpath -ldflags "${ldflags} -extldflags '-static'" \ -o manager ${package} +# update K8s version file +RUN yq -iy ".\"1.25.7\".\"container-images\".\"module-operator\" = \"${VERRAZZANO_MODULE_OPERATOR_TAG}\"" kubernetes-versions.yaml + # Production image FROM ghcr.io/oracle/oraclelinux:8-slim diff --git a/Makefile b/Makefile index 0b7f7aa..4b725fa 100644 --- a/Makefile +++ b/Makefile @@ -211,6 +211,7 @@ LDFLAGS := $(shell hack/version.sh) # Branch for obtaining module charts VERRAZZANO_MODULE_BRANCH ?= release/1.6 VERRAZZANO_MODULE_COMMIT ?= f0808d7d525b20bbe2c8b575635d15fde343f906 +VERRAZZANO_MODULE_OPERATOR_TAG ?= v0.1.0-20230613202926-e88f7d2b all: test managers @@ -375,13 +376,13 @@ ALL_DOCKER_BUILD_E2E = ocne-bootstrap ocne-control-plane .PHONY: docker-build-ocne-bootstrap docker-build-ocne-bootstrap: ## Build the docker image for ocne bootstrap controller manager - docker build --build-arg builder_image=$(GO_CONTAINER_IMAGE) --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg vz_module_branch=$(VERRAZZANO_MODULE_BRANCH) --build-arg vz_module_commit=$(VERRAZZANO_MODULE_COMMIT) --build-arg package=./bootstrap/ocne --build-arg ldflags="$(LDFLAGS)" . -t $(OCNE_BOOTSTRAP_CONTROLLER_IMG):$(TAG) + docker build --build-arg builder_image=$(GO_CONTAINER_IMAGE) --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg vz_module_branch=$(VERRAZZANO_MODULE_BRANCH) --build-arg vz_module_commit=$(VERRAZZANO_MODULE_COMMIT) --build-arg vz_module_tag=$(VERRAZZANO_MODULE_OPERATOR_TAG) --build-arg package=./bootstrap/ocne --build-arg ldflags="$(LDFLAGS)" . -t $(OCNE_BOOTSTRAP_CONTROLLER_IMG):$(TAG) $(MAKE) set-manifest-image MANIFEST_IMG=$(OCNE_BOOTSTRAP_CONTROLLER_IMG) MANIFEST_TAG=$(TAG) TARGET_RESOURCE="./bootstrap/ocne/config/default/manager_image_patch.yaml" $(MAKE) set-manifest-pull-policy TARGET_RESOURCE="./bootstrap/ocne/config/default/manager_pull_policy.yaml" .PHONY: docker-build-ocne-control-plane docker-build-ocne-control-plane: ## Build the docker image for ocne control plane controller manager - docker build --build-arg builder_image=$(GO_CONTAINER_IMAGE) --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg vz_module_branch=$(VERRAZZANO_MODULE_BRANCH) --build-arg vz_module_commit=$(VERRAZZANO_MODULE_COMMIT) --build-arg package=./controlplane/ocne --build-arg ldflags="$(LDFLAGS)" . -t $(OCNE_CONTROL_PLANE_CONTROLLER_IMG):$(TAG) + docker build --build-arg builder_image=$(GO_CONTAINER_IMAGE) --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg vz_module_branch=$(VERRAZZANO_MODULE_BRANCH) --build-arg vz_module_commit=$(VERRAZZANO_MODULE_COMMIT) --build-arg vz_module_tag=$(VERRAZZANO_MODULE_OPERATOR_TAG) --build-arg package=./controlplane/ocne --build-arg ldflags="$(LDFLAGS)" . -t $(OCNE_CONTROL_PLANE_CONTROLLER_IMG):$(TAG) $(MAKE) set-manifest-image MANIFEST_IMG=$(OCNE_CONTROL_PLANE_CONTROLLER_IMG) MANIFEST_TAG=$(TAG) TARGET_RESOURCE="./controlplane/ocne/config/default/manager_image_patch.yaml" $(MAKE) set-manifest-pull-policy TARGET_RESOURCE="./controlplane/ocne/config/default/manager_pull_policy.yaml" diff --git a/examples/module-operator/cluster-template-existingvcnwithaddons-disconnected-env.yaml b/examples/module-operator/cluster-template-existingvcnwithaddons-disconnected-env.yaml index 4f7eca8..6f1f0de 100644 --- a/examples/module-operator/cluster-template-existingvcnwithaddons-disconnected-env.yaml +++ b/examples/module-operator/cluster-template-existingvcnwithaddons-disconnected-env.yaml @@ -292,7 +292,7 @@ spec: matchLabels: cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME} resources: - - kind: ConfigMap + - kind: Secret name: ${CLUSTER_NAME}-oci-csi strategy: Reconcile --- diff --git a/examples/module-operator/cluster-template-existingvcnwithaddons-skipinstall.yaml b/examples/module-operator/cluster-template-existingvcnwithaddons-skipinstall.yaml index bf59b09..d06784b 100644 --- a/examples/module-operator/cluster-template-existingvcnwithaddons-skipinstall.yaml +++ b/examples/module-operator/cluster-template-existingvcnwithaddons-skipinstall.yaml @@ -220,7 +220,7 @@ spec: apiVersion: addons.cluster.x-k8s.io/v1beta1 kind: ClusterResourceSet metadata: - name: ${CLUSTER_NAME}-ccm-configmap + name: ${CLUSTER_NAME}-ccm-secret namespace: ${NAMESPACE} spec: clusterSelector: @@ -276,7 +276,7 @@ metadata: apiVersion: addons.cluster.x-k8s.io/v1beta1 kind: ClusterResourceSet metadata: - name: ${CLUSTER_NAME}-csi-configmap + name: ${CLUSTER_NAME}-csi-secret namespace: ${NAMESPACE} spec: clusterSelector: @@ -398,10 +398,10 @@ data: calicoNetwork: bgp: Disabled ipPools: - - cidr: ${POD_CIDR} + - cidr: ${POD_CIDR=192.168.0.0/16} encapsulation: VXLAN - registry: ${OCNE_IMAGE_REPOSITORY} - imagePath: ${OCNE_IMAGE_PATH} + registry: ${OCNE_IMAGE_REPOSITORY=container-registry.oracle.com} + imagePath: ${OCNE_IMAGE_PATH=olcne} kind: ConfigMap metadata: annotations: diff --git a/examples/module-operator/cluster-template-existingvcnwithaddons.yaml b/examples/module-operator/cluster-template-existingvcnwithaddons.yaml index 6140849..5af0fdf 100644 --- a/examples/module-operator/cluster-template-existingvcnwithaddons.yaml +++ b/examples/module-operator/cluster-template-existingvcnwithaddons.yaml @@ -214,7 +214,7 @@ spec: apiVersion: addons.cluster.x-k8s.io/v1beta1 kind: ClusterResourceSet metadata: - name: ${CLUSTER_NAME}-ccm-configmap + name: ${CLUSTER_NAME}-ccm-secret namespace: ${NAMESPACE} spec: clusterSelector: @@ -270,7 +270,7 @@ metadata: apiVersion: addons.cluster.x-k8s.io/v1beta1 kind: ClusterResourceSet metadata: - name: ${CLUSTER_NAME}-csi-configmap + name: ${CLUSTER_NAME}-csi-secret namespace: ${NAMESPACE} spec: clusterSelector: @@ -392,10 +392,10 @@ data: calicoNetwork: bgp: Disabled ipPools: - - cidr: ${POD_CIDR} + - cidr: ${POD_CIDR=192.168.0.0/16} encapsulation: VXLAN - registry: ${OCNE_IMAGE_REPOSITORY} - imagePath: ${OCNE_IMAGE_PATH} + registry: ${OCNE_IMAGE_REPOSITORY=container-registry.oracle.com} + imagePath: ${OCNE_IMAGE_PATH=olcne} kind: ConfigMap metadata: annotations: diff --git a/examples/module-operator/cluster-template-existingvcnwithaddonsandproxy-skipinstall.yaml b/examples/module-operator/cluster-template-existingvcnwithaddonsandproxy-skipinstall.yaml index c5d53d2..ab1be84 100644 --- a/examples/module-operator/cluster-template-existingvcnwithaddonsandproxy-skipinstall.yaml +++ b/examples/module-operator/cluster-template-existingvcnwithaddonsandproxy-skipinstall.yaml @@ -228,7 +228,7 @@ spec: apiVersion: addons.cluster.x-k8s.io/v1beta1 kind: ClusterResourceSet metadata: - name: ${CLUSTER_NAME}-ccm-configmap + name: ${CLUSTER_NAME}-ccm-secret namespace: ${NAMESPACE} spec: clusterSelector: @@ -284,7 +284,7 @@ metadata: apiVersion: addons.cluster.x-k8s.io/v1beta1 kind: ClusterResourceSet metadata: - name: ${CLUSTER_NAME}-csi-configmap + name: ${CLUSTER_NAME}-csi-secret namespace: ${NAMESPACE} spec: clusterSelector: @@ -406,10 +406,10 @@ data: calicoNetwork: bgp: Disabled ipPools: - - cidr: ${POD_CIDR} + - cidr: ${POD_CIDR=192.168.0.0/16} encapsulation: VXLAN - registry: ${OCNE_IMAGE_REPOSITORY} - imagePath: ${OCNE_IMAGE_PATH} + registry: ${OCNE_IMAGE_REPOSITORY=container-registry.oracle.com} + imagePath: ${OCNE_IMAGE_PATH=olcne} kind: ConfigMap metadata: annotations: diff --git a/examples/module-operator/cluster-template-existingvcnwithaddonsandproxy.yaml b/examples/module-operator/cluster-template-existingvcnwithaddonsandproxy.yaml index 2831dbf..28fc0c1 100644 --- a/examples/module-operator/cluster-template-existingvcnwithaddonsandproxy.yaml +++ b/examples/module-operator/cluster-template-existingvcnwithaddonsandproxy.yaml @@ -224,7 +224,7 @@ spec: apiVersion: addons.cluster.x-k8s.io/v1beta1 kind: ClusterResourceSet metadata: - name: ${CLUSTER_NAME}-ccm-configmap + name: ${CLUSTER_NAME}-ccm-secret namespace: ${NAMESPACE} spec: clusterSelector: @@ -280,7 +280,7 @@ metadata: apiVersion: addons.cluster.x-k8s.io/v1beta1 kind: ClusterResourceSet metadata: - name: ${CLUSTER_NAME}-csi-configmap + name: ${CLUSTER_NAME}-csi-secret namespace: ${NAMESPACE} spec: clusterSelector: @@ -402,10 +402,10 @@ data: calicoNetwork: bgp: Disabled ipPools: - - cidr: ${POD_CIDR} + - cidr: ${POD_CIDR=192.168.0.0/16} encapsulation: VXLAN - registry: ${OCNE_IMAGE_REPOSITORY} - imagePath: ${OCNE_IMAGE_PATH} + registry: ${OCNE_IMAGE_REPOSITORY=container-registry.oracle.com} + imagePath: ${OCNE_IMAGE_PATH=olcne} kind: ConfigMap metadata: annotations: