Skip to content

Commit 307dff9

Browse files
Add VPC Load Balancer template (#857)
Signed-off-by: Prajyot-Parab <[email protected]> Signed-off-by: Prajyot-Parab <[email protected]> Co-authored-by: Prajyot-Parab <[email protected]>
1 parent 2c9f59a commit 307dff9

File tree

3 files changed

+164
-0
lines changed

3 files changed

+164
-0
lines changed

docs/book/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- [Prerequisites](./topics/vpc/prerequisites.md)
1111
- [Uploading an image](topics/vpc/uploading-an-image.md)
1212
- [Creating a cluster](./topics/vpc/creating-a-cluster.md)
13+
- [Creating a cluster with Load Balancer](./topics/vpc/load-balancer.md)
1314
- [Power VS Cluster](./topics/powervs/index.md)
1415
- [Prerequisites](./topics/powervs/prerequisites.md)
1516
- [Creating a cluster](./topics/powervs/creating-a-cluster.md)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## Provision workload Cluster with Load Balancer in IBM Cloud VPC
2+
### This feature is currently in experimental stage
3+
4+
### Deploy VPC cluster with Load Balancer
5+
6+
```
7+
IBMVPC_REGION=us-south \
8+
IBMVPC_ZONE=us-south-1 \
9+
IBMVPC_RESOURCEGROUP=4f15679623607b855b1a27a67f20e1c7 \
10+
IBMVPC_NAME=ibm-vpc-0 \
11+
IBMVPC_IMAGE_ID=r134-ea84bbec-7986-4ff5-8489-d9ec34611dd4 \
12+
IBMVPC_PROFILE=bx2-4x16 \
13+
IBMVPC_SSHKEY_ID=r134-2a82b725-e570-43d3-8b23-9539e8641944 \
14+
clusterctl generate cluster ibm-vpc-0 --kubernetes-version v1.22.0 \
15+
--target-namespace default \
16+
--control-plane-machine-count=3 \
17+
--worker-machine-count=1 \
18+
--flavor=load-balancer | kubectl apply -f -
19+
```
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
apiVersion: cluster.x-k8s.io/v1beta1
2+
kind: Cluster
3+
metadata:
4+
labels:
5+
cluster.x-k8s.io/cluster-name: "${CLUSTER_NAME}"
6+
name: "${CLUSTER_NAME}"
7+
namespace: "${NAMESPACE}"
8+
spec:
9+
clusterNetwork:
10+
pods:
11+
cidrBlocks:
12+
- ${POD_CIDR:="192.168.0.0/16"}
13+
serviceDomain: ${SERVICE_DOMAIN:="cluster.local"}
14+
services:
15+
cidrBlocks:
16+
- ${SERVICE_CIDR:="10.128.0.0/12"}
17+
infrastructureRef:
18+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
19+
kind: IBMVPCCluster
20+
name: "${CLUSTER_NAME}"
21+
namespace: "${NAMESPACE}"
22+
controlPlaneRef:
23+
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
24+
kind: KubeadmControlPlane
25+
name: "${CLUSTER_NAME}-control-plane"
26+
namespace: "${NAMESPACE}"
27+
---
28+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
29+
kind: IBMVPCCluster
30+
metadata:
31+
labels:
32+
cluster.x-k8s.io/cluster-name: "${CLUSTER_NAME}"
33+
name: "${CLUSTER_NAME}"
34+
spec:
35+
region: "${IBMVPC_REGION}"
36+
zone: "${IBMVPC_ZONE}"
37+
resourceGroup: "${IBMVPC_RESOURCEGROUP}"
38+
vpc: "${IBMVPC_NAME}"
39+
controlPlaneLoadBalancer:
40+
name: "${CLUSTER_NAME}-load-balancer"
41+
---
42+
kind: KubeadmControlPlane
43+
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
44+
metadata:
45+
name: "${CLUSTER_NAME}-control-plane"
46+
namespace: "${NAMESPACE}"
47+
spec:
48+
version: "${KUBERNETES_VERSION}"
49+
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
50+
machineTemplate:
51+
infrastructureRef:
52+
kind: IBMVPCMachineTemplate
53+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
54+
name: "${CLUSTER_NAME}-control-plane"
55+
namespace: "${NAMESPACE}"
56+
kubeadmConfigSpec:
57+
clusterConfiguration:
58+
kubernetesVersion: ${KUBERNETES_VERSION}
59+
controllerManager:
60+
extraArgs: {enable-hostpath-provisioner: 'true'}
61+
apiServer:
62+
certSANs: [localhost, 127.0.0.1]
63+
dns: {}
64+
etcd: {}
65+
networking: {}
66+
scheduler: {}
67+
initConfiguration:
68+
nodeRegistration:
69+
criSocket: /var/run/containerd/containerd.sock
70+
kubeletExtraArgs:
71+
cloud-provider: external
72+
provider-id: ibmvpc://${CLUSTER_NAME}/'{{ v1.local_hostname }}'
73+
eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%'
74+
joinConfiguration:
75+
discovery: {}
76+
nodeRegistration:
77+
criSocket: /var/run/containerd/containerd.sock
78+
kubeletExtraArgs:
79+
cloud-provider: external
80+
provider-id: ibmvpc://${CLUSTER_NAME}/'{{ v1.local_hostname }}'
81+
eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%'
82+
---
83+
kind: IBMVPCMachineTemplate
84+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
85+
metadata:
86+
name: "${CLUSTER_NAME}-control-plane"
87+
spec:
88+
template:
89+
spec:
90+
image: "${IBMVPC_IMAGE_ID}"
91+
zone: "${IBMVPC_ZONE}"
92+
profile: "${IBMVPC_PROFILE}"
93+
sshKeys:
94+
- "${IBMVPC_SSHKEY_ID}"
95+
---
96+
apiVersion: cluster.x-k8s.io/v1beta1
97+
kind: MachineDeployment
98+
metadata:
99+
name: "${CLUSTER_NAME}-md-0"
100+
spec:
101+
clusterName: "${CLUSTER_NAME}"
102+
replicas: ${WORKER_MACHINE_COUNT}
103+
selector:
104+
matchLabels:
105+
template:
106+
spec:
107+
clusterName: "${CLUSTER_NAME}"
108+
version: "${KUBERNETES_VERSION}"
109+
bootstrap:
110+
configRef:
111+
name: "${CLUSTER_NAME}-md-0"
112+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
113+
kind: KubeadmConfigTemplate
114+
infrastructureRef:
115+
name: "${CLUSTER_NAME}-md-0"
116+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
117+
kind: IBMVPCMachineTemplate
118+
---
119+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
120+
kind: IBMVPCMachineTemplate
121+
metadata:
122+
name: "${CLUSTER_NAME}-md-0"
123+
spec:
124+
template:
125+
spec:
126+
image: "${IBMVPC_IMAGE_ID}"
127+
zone: "${IBMVPC_ZONE}"
128+
profile: "${IBMVPC_PROFILE}"
129+
sshKeys:
130+
- "${IBMVPC_SSHKEY_ID}"
131+
---
132+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
133+
kind: KubeadmConfigTemplate
134+
metadata:
135+
name: "${CLUSTER_NAME}-md-0"
136+
spec:
137+
template:
138+
spec:
139+
joinConfiguration:
140+
nodeRegistration:
141+
kubeletExtraArgs:
142+
cloud-provider: external
143+
provider-id: ibmvpc://${CLUSTER_NAME}/'{{ v1.local_hostname }}'
144+
eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%

0 commit comments

Comments
 (0)