-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added template to use powervs cloud provider
- Loading branch information
1 parent
6af922e
commit a1c5575
Showing
6 changed files
with
586 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# IBM Power VS External Cloud Provider | ||
|
||
## Steps | ||
|
||
- To deploy a Power VS workload cluster with IBM Power VS external cloud provider, create a cluster configuration with the [external cloud provider template](https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/blob/main/templates/cluster-template-powervs-external-cloud-provider.yaml) | ||
- The [external cloud provider template](https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/blob/main/templates/cluster-template-powervs-external-cloud-provider.yaml) will use [clusterresourceset](https://cluster-api.sigs.k8s.io/tasks/experimental-features/cluster-resource-set.html) and will create the necessary config map, secret and roles to runt the cloud controller manager | ||
|
||
``` | ||
IBMPOWERVS_SSHKEY_NAME="my-pub-key" \ | ||
IBMPOWERVS_VIP="192.168.151.22" \ | ||
IBMPOWERVS_VIP_EXTERNAL="158.175.162.22" \ | ||
IBMPOWERVS_VIP_CIDR="29" \ | ||
IBMPOWERVS_IMAGE_NAME="capibm-powervs-centos-8-1-22-4" \ | ||
IBMPOWERVS_SERVICE_INSTANCE_ID="7845d372-d4e1-46b8-91fc-41051c984601" \ | ||
IBMPOWERVS_NETWORK_NAME="capi-test-3" \ | ||
IBMACCOUNT_ID="1234567889" \ | ||
IBMPOWERVS_RESOURCE_GROUP="powervs-resource-group-name" \ | ||
IBMVPC_SUBNET_NAMES="subnet-name" \ | ||
IBMVPC_NAME="vpc-name" \ | ||
IBMVPC_REGION="vpc-region" \ | ||
IBMPOWERVS_REGION="powervs-region" \ | ||
IBMPOWERVS_ZONE="powervs-zone" \ | ||
BASE64_API_KEY=$(echo -n $IBMCLOUD_API_KEY | base64) \ | ||
clusterctl generate cluster ibm-powervs-1 --kubernetes-version v1.22.4 \ | ||
--target-namespace default \ | ||
--control-plane-machine-count=3 \ | ||
--worker-machine-count=1 \ | ||
--from ./cluster-template-powervs-external-cloud-provider.yaml | kubectl apply -f - | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
ARG GOLANG_IMAGE=golang:1.17 | ||
ARG TARGETPLATFORM=linux/amd64 | ||
ARG ARCH=amd64 | ||
|
||
# Build vpcctl binary | ||
FROM ${GOLANG_IMAGE} as vpc-builder | ||
ARG ARCH | ||
WORKDIR /build | ||
RUN git clone https://github.com/openshift/cloud-provider-vpc-controller | ||
RUN cd cloud-provider-vpc-controller/cmd && CGO_ENABLED=0 GOARCH=$ARCH go build \ | ||
-ldflags "-s -w" -o /build/vpcctl . | ||
|
||
# Build IBM cloud controller manager binary | ||
FROM ${GOLANG_IMAGE} AS ccm-builder | ||
ARG ARCH | ||
WORKDIR /build | ||
RUN git clone https://github.com/openshift/cloud-provider-powervs | ||
RUN cd cloud-provider-powervs && CGO_ENABLED=0 GOARCH=$ARCH go build \ | ||
-ldflags "-s -w" -o /build/ibm-cloud-controller-manager . | ||
|
||
# Assemble the final image | ||
FROM --platform=$TARGETPLATFORM quay.io/centos/centos:stream8 AS centos-base | ||
LABEL description="IBM PowerVS Cloud Controller Manager" | ||
COPY --from=vpc-builder /build/vpcctl /bin/vpcctl | ||
COPY --from=ccm-builder /build/ibm-cloud-controller-manager /bin/ibm-cloud-controller-manager | ||
ENTRYPOINT [ "/bin/ibm-cloud-controller-manager" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
REGISTRY=quay.io/kabhat | ||
IMG=powervs-cloud-controller-manager | ||
GIT_COMMIT?=$(shell git rev-parse --short HEAD) | ||
TAG?=$(GIT_COMMIT) | ||
|
||
build-image-and-push-linux-amd64: init-buildx | ||
{ \ | ||
set -e ; \ | ||
docker buildx build \ | ||
--build-arg TARGETPLATFORM=linux/amd64 --build-arg ARCH=amd64 \ | ||
-t $(REGISTRY)/$(IMG):$(TAG)_linux_amd64 . --push --target centos-base; \ | ||
} | ||
|
||
build-image-and-push-linux-ppc64le: init-buildx | ||
{ \ | ||
set -e ; \ | ||
docker buildx build \ | ||
--build-arg TARGETPLATFORM=linux/ppc64le --build-arg ARCH=ppc64le\ | ||
-t $(REGISTRY)/$(IMG):$(TAG)_linux_ppc64le . --push --target centos-base; \ | ||
} | ||
|
||
init-buildx: | ||
# Ensure we use a builder that can leverage it (the default on linux will not) | ||
docker buildx rm multiarch-multiplatform-builder | ||
docker buildx create --use --name=multiarch-multiplatform-builder | ||
docker run --rm --privileged multiarch/qemu-user-static --reset --credential yes --persistent yes | ||
# Required for "docker buildx build --push". | ||
#TODO: Add respective registry login info | ||
|
||
build-and-push-multi-arch: build-image-and-push-linux-amd64 build-image-and-push-linux-ppc64le | ||
docker manifest create --amend $(REGISTRY)/$(IMG):$(TAG) $(REGISTRY)/$(IMG):$(TAG)_linux_amd64 $(REGISTRY)/$(IMG):$(TAG)_linux_ppc64le | ||
docker manifest push -p $(REGISTRY)/$(IMG):$(TAG) |
Oops, something went wrong.