Supervisor with "VDS + FLB"
This section describes the procedures for deploying a K8s Cluster in a Namespace utilizing a "VDS + FLB" architecture inside a vSphere environment.
- K8s Cluster
K8s Cluster Deployment
Client Operating System
While the command outputs below are captured from a Windows client, the vcf and kubectl CLI tools operate identically across Linux and macOS environments.
Connect to the Supervisor Namespace
-
List the Supervisor Namespaces
vcf context listOutput example
PS C:\Users\Administrator\Documents> vcf context list NAME CURRENT TYPE supervisor-mgt false kubernetes supervisor-mgt:demo-space true kubernetes supervisor-mgt:svc-cci-ns-hzbv0 false kubernetes supervisor-mgt:svc-tkg-m829h false kubernetes supervisor-mgt:svc-velero-xqgz5 false kubernetes [i] Use '--wide' to view additional columns. -
Connect to the Supervisor Namespace
If the current context is not the good one, connect to the Supervisor Namespacevcf context use supervisor-mgt:demo-spaceOutput example
PS C:\Users\Administrator\Documents> vcf context use supervisor-mgt:demo-space [ok] Token is still active. Skipped the token refresh for context "supervisor-mgt:demo-space" [i] Successfully activated context 'supervisor-mgt:demo-space' (Type: kubernetes) [i] Fetching recommended plugins for active context 'supervisor-mgt:demo-space'...
Create K8s Cluster
Check all K8s Cluster resources
-
Check TKR releases available
kubectl get kubernetesreleasesOutput example
PS C:\Users\Administrator\Documents> kubectl get kubernetesreleases NAME VERSION READY COMPATIBLE CREATED TYPEv1.35.5---vmware.1-vkr.1 v1.35.5+vmware.1-vkr.1 True True 4d8h< -
Check VM Class available
kubectl get virtualmachineclassOutput example
PS C:\Users\Administrator\Documents> kubectl get virtualmachineclass NAME CPU MEMORY best-effort-medium 2 8Gi best-effort-small 2 4Gi guaranteed-medium 2 8Gi guaranteed-small 2 4Gi -
Check Storage Class availablee
kubectl get storageclassOutput example
PS C:\Users\Administrator\Documents> kubectl get storageclass NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGEvsan-default-storage-policy csi.vsphere.vmware.com Delete Immediate true 22h
Create the K8s Cluster yaml file
Create file "my-cluster.yaml"
my-cluster.yaml file
apiVersion: cluster.x-k8s.io/v1beta2
kind: Cluster
metadata:
name: my-cluster
namespace: demo-space
spec:
clusterNetwork:
services:
cidrBlocks: ["10.96.0.0/12"]
pods:
cidrBlocks: ["192.168.156.0/20"]
serviceDomain: "cluster.local"
topology:
classRef:
name: builtin-generic-v3.6.0
version: v1.35.5---vmware.1-vkr.1
controlPlane:
replicas: 3
workers:
machineDeployments:
- class: node-pool
name: workers
metadata:
annotations:
cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "3"
cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "5"
variables:
- name: vmClass
value: best-effort-small
- name: storageClass
value: vsan-default-storage-policy
Deploy the K8s Cluster yaml file
kubectl apply -f my-cluster.yaml
Output example
PS C:\Users\Administrator\Documents> kubectl apply -f my-cluster.yaml
cluster.cluster.x-k8s.io/my-cluster created
Validate Deployment
Validate K8s Cluster Status
It takes around 5 minutes to get the K8s Cluster ready
kubectl get cluster
Output example
PS C:\Users\Administrator\Documents> kubectl get cluster
NAME CLUSTERCLASS AVAILABLE CP DESIRED CP AVAILABLE CP UP-TO-DATE W DESIRED W AVAILABLE W UP-TO-DATE PHASE AGE VERSION
my-cluster builtin-generic-v3.6.0 True 3 3 3 3 3 3 Provisioned 7m32s v1.35.5+vmware.1
Retrieve K8s Cluster Controller VIP
kubectl get cluster my-cluster -o jsonpath='{.spec.controlPlaneEndpoint.host}'
Output example
PS C:\Users\Administrator\Documents> kubectl get cluster my-cluster -o jsonpath='{.spec.controlPlaneEndpoint.host}'
10.1.11.47
Validate K8s Nodes Status
kubectl get machines
Output example
PS C:\Users\Administrator\Documents> kubectl get machines
NAME CLUSTER NODE NAME READY AVAILABLE UP-TO-DATE PHASE AGE VERSION
my-cluster-t9kts-khnwk my-cluster my-cluster-t9kts-khnwk True True True Running 34m v1.35.5+vmware.1
my-cluster-t9kts-vp9vg my-cluster my-cluster-t9kts-vp9vg True True True Running 36m v1.35.5+vmware.1
my-cluster-t9kts-x6ct8 my-cluster my-cluster-t9kts-x6ct8 True True True Running 39m v1.35.5+vmware.1
my-cluster-workers-tpq48-bk2rz-4zx2n my-cluster my-cluster-workers-tpq48-bk2rz-4zx2n True True True Running 39m v1.35.5+vmware.1
my-cluster-workers-tpq48-bk2rz-6dm7f my-cluster my-cluster-workers-tpq48-bk2rz-6dm7f True True True Running 39m v1.35.5+vmware.1
my-cluster-workers-tpq48-bk2rz-pskrn my-cluster my-cluster-workers-tpq48-bk2rz-pskrn True True True Running 39m v1.35.5+vmware.1

