Skip to content

Commit

Permalink
Cherry pick updates from main (#50)
Browse files Browse the repository at this point in the history
* Cherry pick updates from main

* aamitra/update template examples (#49)

* Update CAPI to module latest main

* Update examples with module operator
  • Loading branch information
Abhishek Mitra authored Jun 14, 2023
1 parent 8423d64 commit 5958aaf
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 25 deletions.
16 changes: 14 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,33 @@ 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 && \
git -C $VERRAZZANO_MODULE_DIRECTORY checkout $VERRAZZANO_MODULE_COMMIT && \
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
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 5958aaf

Please sign in to comment.