-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add VPC Load Balancer template (#838)
Signed-off-by: Prajyot-Parab <[email protected]> Signed-off-by: Prajyot-Parab <[email protected]>
- Loading branch information
1 parent
416bed6
commit b278813
Showing
3 changed files
with
164 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
## Provision workload Cluster with Load Balancer in IBM Cloud VPC | ||
### This feature is currently in experimental stage | ||
|
||
### Deploy VPC cluster with Load Balancer | ||
|
||
``` | ||
IBMVPC_REGION=us-south \ | ||
IBMVPC_ZONE=us-south-1 \ | ||
IBMVPC_RESOURCEGROUP=4f15679623607b855b1a27a67f20e1c7 \ | ||
IBMVPC_NAME=ibm-vpc-0 \ | ||
IBMVPC_IMAGE_ID=r134-ea84bbec-7986-4ff5-8489-d9ec34611dd4 \ | ||
IBMVPC_PROFILE=bx2-4x16 \ | ||
IBMVPC_SSHKEY_ID=r134-2a82b725-e570-43d3-8b23-9539e8641944 \ | ||
clusterctl generate cluster ibm-vpc-0 --kubernetes-version v1.22.0 \ | ||
--target-namespace default \ | ||
--control-plane-machine-count=3 \ | ||
--worker-machine-count=1 \ | ||
--flavor=load-balancer | 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,144 @@ | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: Cluster | ||
metadata: | ||
labels: | ||
cluster.x-k8s.io/cluster-name: "${CLUSTER_NAME}" | ||
name: "${CLUSTER_NAME}" | ||
namespace: "${NAMESPACE}" | ||
spec: | ||
clusterNetwork: | ||
pods: | ||
cidrBlocks: | ||
- ${POD_CIDR:="192.168.0.0/16"} | ||
serviceDomain: ${SERVICE_DOMAIN:="cluster.local"} | ||
services: | ||
cidrBlocks: | ||
- ${SERVICE_CIDR:="10.128.0.0/12"} | ||
infrastructureRef: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: IBMVPCCluster | ||
name: "${CLUSTER_NAME}" | ||
namespace: "${NAMESPACE}" | ||
controlPlaneRef: | ||
apiVersion: controlplane.cluster.x-k8s.io/v1beta1 | ||
kind: KubeadmControlPlane | ||
name: "${CLUSTER_NAME}-control-plane" | ||
namespace: "${NAMESPACE}" | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: IBMVPCCluster | ||
metadata: | ||
labels: | ||
cluster.x-k8s.io/cluster-name: "${CLUSTER_NAME}" | ||
name: "${CLUSTER_NAME}" | ||
spec: | ||
region: "${IBMVPC_REGION}" | ||
zone: "${IBMVPC_ZONE}" | ||
resourceGroup: "${IBMVPC_RESOURCEGROUP}" | ||
vpc: "${IBMVPC_NAME}" | ||
controlPlaneLoadBalancer: | ||
name: "${CLUSTER_NAME}-load-balancer" | ||
--- | ||
kind: KubeadmControlPlane | ||
apiVersion: controlplane.cluster.x-k8s.io/v1beta1 | ||
metadata: | ||
name: "${CLUSTER_NAME}-control-plane" | ||
namespace: "${NAMESPACE}" | ||
spec: | ||
version: "${KUBERNETES_VERSION}" | ||
replicas: ${CONTROL_PLANE_MACHINE_COUNT} | ||
machineTemplate: | ||
infrastructureRef: | ||
kind: IBMVPCMachineTemplate | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
name: "${CLUSTER_NAME}-control-plane" | ||
namespace: "${NAMESPACE}" | ||
kubeadmConfigSpec: | ||
clusterConfiguration: | ||
kubernetesVersion: ${KUBERNETES_VERSION} | ||
controllerManager: | ||
extraArgs: {enable-hostpath-provisioner: 'true'} | ||
apiServer: | ||
certSANs: [localhost, 127.0.0.1] | ||
dns: {} | ||
etcd: {} | ||
networking: {} | ||
scheduler: {} | ||
initConfiguration: | ||
nodeRegistration: | ||
criSocket: /var/run/containerd/containerd.sock | ||
kubeletExtraArgs: | ||
cloud-provider: external | ||
provider-id: ibmvpc://${CLUSTER_NAME}/'{{ v1.local_hostname }}' | ||
eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' | ||
joinConfiguration: | ||
discovery: {} | ||
nodeRegistration: | ||
criSocket: /var/run/containerd/containerd.sock | ||
kubeletExtraArgs: | ||
cloud-provider: external | ||
provider-id: ibmvpc://${CLUSTER_NAME}/'{{ v1.local_hostname }}' | ||
eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' | ||
--- | ||
kind: IBMVPCMachineTemplate | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
metadata: | ||
name: "${CLUSTER_NAME}-control-plane" | ||
spec: | ||
template: | ||
spec: | ||
image: "${IBMVPC_IMAGE_ID}" | ||
zone: "${IBMVPC_ZONE}" | ||
profile: "${IBMVPC_PROFILE}" | ||
sshKeys: | ||
- "${IBMVPC_SSHKEY_ID}" | ||
--- | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: MachineDeployment | ||
metadata: | ||
name: "${CLUSTER_NAME}-md-0" | ||
spec: | ||
clusterName: "${CLUSTER_NAME}" | ||
replicas: ${WORKER_MACHINE_COUNT} | ||
selector: | ||
matchLabels: | ||
template: | ||
spec: | ||
clusterName: "${CLUSTER_NAME}" | ||
version: "${KUBERNETES_VERSION}" | ||
bootstrap: | ||
configRef: | ||
name: "${CLUSTER_NAME}-md-0" | ||
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 | ||
kind: KubeadmConfigTemplate | ||
infrastructureRef: | ||
name: "${CLUSTER_NAME}-md-0" | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: IBMVPCMachineTemplate | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: IBMVPCMachineTemplate | ||
metadata: | ||
name: "${CLUSTER_NAME}-md-0" | ||
spec: | ||
template: | ||
spec: | ||
image: "${IBMVPC_IMAGE_ID}" | ||
zone: "${IBMVPC_ZONE}" | ||
profile: "${IBMVPC_PROFILE}" | ||
sshKeys: | ||
- "${IBMVPC_SSHKEY_ID}" | ||
--- | ||
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 | ||
kind: KubeadmConfigTemplate | ||
metadata: | ||
name: "${CLUSTER_NAME}-md-0" | ||
spec: | ||
template: | ||
spec: | ||
joinConfiguration: | ||
nodeRegistration: | ||
kubeletExtraArgs: | ||
cloud-provider: external | ||
provider-id: ibmvpc://${CLUSTER_NAME}/'{{ v1.local_hostname }}' | ||
eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0% |