Friday, October 13, 2023
HomeCloud ComputingAPI Information for Tanzu Kubernetes Clusters for VMware Cloud Director

API Information for Tanzu Kubernetes Clusters for VMware Cloud Director


The Container Service Extension 4.0 has been launched with a number of vital enhancements and extra use circumstances, together with Cluster API, lifecycle administration via a person interface, GPU assist for Kubernetes clusters, and integration with VMware Cloud Director as infrastructure. With its feature-rich person interface, clients can carry out operations similar to creation, scaling, and upgrading on Tanzu Kubernetes clusters. Nevertheless, some clients could search automation assist for these similar operations.

This weblog submit is meant for purchasers who want to automate the provisioning of Tanzu Kubernetes clusters on the VMware Cloud Director Tenant portal utilizing the VMware Cloud Director API. Though the VCD API is supported, the weblog submit is critical as a result of the Cluster API is used to create and handle TKG clusters on VCD. The payload required to carry out operations on TKG clusters requires some work to offer the Cluster API-generated payload. The weblog submit outlines the step-by-step course of for producing the proper payload for purchasers utilizing their VCD infrastructure.

Model Help:

This API information is relevant to clusters created by CSE 4.0 and CSE 4.0.1 Tanzu Kubernetes Clusters.

The prevailing stipulations for purchasers to create TKG clusters of their organizations additionally apply to the automation stream. These stipulations are summarized right here and will be discovered within the official documentation to onboard Supplier and Tenant Admin customers. The next sections present an outline of the necessities for each cloud supplier directors and Tenant Admin customers.

Cloud Supplier Admin Steps

The Steps to onboard the shoppers is demonstrated on this video and documented right here. As soon as buyer group and its customers are onboarded, they will use subsequent part to make use of APIs, or eat it to create automated Cluster operations.

As a fast abstract following steps are anticipated to be carried out by cloud supplier to onboard and put together the shopper:

  1. Assessment Interoperability Matrix to assist Container Service Extension 4.0 and 4.0.1
  2. Enable obligatory communication for CSE server
  3. Begin CSE server and Onboard buyer group (Reference Demo and Official Documentation)

Buyer Org Admin Steps

When the cloud supplier has onboarded the shopper onto the Container Service Extension, the group administrator should create and assign customers with the potential to create and handle TKG clusters for the shopper group. This documentation outlines the process for making a person with the “Kubernetes cluster creator” function throughout the tenant group.

It’s then assumed that the person “acmekco” has obtained the required assets and entry throughout the buyer group to execute Kubernetes cluster operations.

Generate ‘capiyaml’ payload

  • Gather VCD Infrastructure and Kubernetes Cluster particulars

This Operation requires following data for VCD tenant portal. The suitable column describes instance values used as reference on this weblog submit.

Enter Instance worth for this weblog
VCD_SITE VCD Handle (https://vcd-01a.native)
VCD_ORGANIZATION Buyer Group title(ACME)
VCD_ORGANIZATION_VDC Buyer OVDC title (ACME_VDC_T)
VCD_ORGANIZATION_VDC_NETWORK Community title in buyer org (172.16.2.0)
VCD_CATALOG CSE shared catalog title (cse)
Desk -1 Infrastructure particulars
Enter Instance worth for this weblog
VCD_TEMPLATE_NAME Kubernetes and TKG model of the cluster(Ubuntu 20.04 and Kubernetes v1.22.9+vmware.1)
VCD_CONTROL_PLANE_SIZING_POLICY Sizing coverage of management aircraft vms(TKG small)
VCD_CONTROL_PLANE_STORAGE_PROFILE Storage profile for management aircraft of the cluster (Capability)
VCD_CONTROL_PLANE_PLACEMENT_POLICY Non-compulsory – Go away empty if not utilizing
VCD_WORKER_SIZING_POLICY Sizing coverage of employee nodes vms(TKG small)
VCD_WORKER_PLACEMENT_POLICY Non-compulsory – Go away empty if not utilizing
VCD_WORKER_STORAGE_PROFILE Storage profile for management aircraft of the cluster (Capability)
CONTROL_PLANE_MACHINE_COUNT 1
WORKER_MACHINE_COUNT 1
VCD_REFRESH_TOKEN_B64 “MHB1d0tXSllVb2twU2tGRjExNllCNGZnVWZqTm5UZ2U=”
Ref VMware Doc to Generate token earlier than reworking it to Base64
Desk 2- Kubernetes Cluster properties
Kubernetes Model Etcd ImageTag CoreDNS ImageTag Full Distinctive Model OVA TKG Product Model TKr model
v1.22.9+vmware.1 v3.5.4_vmware.2 v1.8.4_vmware.9 v1.22.9+vmware.1-tkg.1 ubuntu-2004-kube-v1.22.9+vmware.1-tkg.1-2182cbabee08edf480ee9bc5866d6933.ova 1.5.4 v1.22.9—vmware.1-tkg.1
v1.21.11+vmware.1 v3.4.13_vmware.27 v1.8.0_vmware.13 v1.21.11+vmware.1-tkg.2 ubuntu-2004-kube-v1.21.11+vmware.1-tkg.2-d788dbbb335710c0a0d1a28670057896.ova 1.5.4 v1.21.11—vmware.1-tkg.3
v1.20.15+vmware.1 v3.4.13_vmware.23 v1.7.0_vmware.15 v1.20.15+vmware.1-tkg.2 ubuntu-2004-kube-v1.20.15+vmware.1-tkg.2-839faf7d1fa7fa356be22b72170ce1a8.ova 1.5.4 v1.20.15—vmware.1-tkg.2
Desk 3 – Kubernetes, Etcd, Coredns for relavant Tanzu Kubernetes variations for CSE 4.0, 4.0.1

  • Copy the ~/infrastructure-vcd/v1.0.0/clusterctl.yaml to ~/.cluster-api/clusterctl.yaml.
  • The ‘clusterctl‘ command makes use of clusterctl.yaml from ~/.cluster-api/clusterctl.yaml to create the capiyaml payload. Replace the infrastructure particulars from step one on this doc.
  • Replace the suppliers.url in ~/.cluster-api/clusterctl.yaml to ~/infrastructure-vcd/v1.0.0/infrastructure-components.yaml.

  • At this level your ~/cluster-api/clusterctl.yaml values ought to look as follows

At this level, we are going to want a sort cluster to put in clusterctl to generate the payload. On this step, create Sort cluster to generate capiyaml payload and initialize clusterctl as follows:

Replace the beneath tkg labels to “Sort: Cluster” object and annotations.

Following part describes all supported API operations for Tanzu Kubernetes Cluster on VMware Cloud Director:

Record Clusters

Record all clusters within the buyer group. for CSE 4.0 launch the CAPVCD model is 1.

Data Cluster

Filter Cluster by title

Get cluster by ID:

Get Kubeconfig of the cluster:

The Kubeconfig will be discovered as follows at: entity.standing.capvcd.non-public.kubeconfig

Create a brand new Cluster

Resize a Cluster

  • Fetch the Cluster ID("id": "urn:vcloud:entity:vmware:capvcdCluster:<ID>) from the above API name’s output.
  • Copy the whole output of the API response.
  • Notedown eTag Worth from API response header
  • Modify “capiyaml” with following values:
    • To resize Management Aircraft VMs Modify kubeadmcontrolplane.spec.replicas with desired variety of management aircraft vms. Word solely odd numbers of management aircraft are supported.
    • To resize Employee Aircraft VMS Modify MachineDeployment.spec.replicas with desired variety of employee aircraft VMs
  • Whereas performing the PUT API name, guarantee to incorporate fetched eTag worth as If-Match

Improve a Cluster

To Improve a cluster, Supplier admin must publish desired the Tanzu Kubernetes templates to the shopper group in catalog utilized by Container Service Extension.

accumulate the GET API response for the cluster to be upgraded as follows:

  • Fetch the Cluster ID("id": "urn:vcloud:entity:vmware:capvcdCluster:<ID>) from the above API name’s output.
  • Copy the whole output of the API response.
  • Notedown eTag Worth from API response header
  • The client person performing cluster improve would require entry to Desk 3 data. Modify Following values matching the goal TKG model. The Following desk reveals Improve for TKG model 1.5.4 from v1.20.15+vmware.1 to v1.22.9+vmware.1
Management Aircraft Model Outdated Values New Values
VCDMachineTemplate
VCDMachineTemplate.spec.template.spec.template Ubuntu 20.04 and Kubernetes v1.20.15+vmware.1 Ubuntu 20.04 and Kubernetes v1.22.9+vmware.1
KubeadmControlPlane
KubeadmControlPlane.spec.model v1.20.15+vmware.1 v1.22.9+vmware.1
KubeadmControlPlane.spec.kubeadmConfigSpec.dns imageTag: v1.7.0_vmware.15 v1.8.4_vmware.9
KubeadmControlPlane.spec.kubeadmConfigSpec.etcd v3.4.13_vmware.23 v3.5.4_vmware.2
KubeadmControlPlane.spec.kubeadmConfigSpec.imageRepository imageRepository: tasks.registry.vmware.com/tkg imageRepository: tasks.registry.vmware.com/tkg
Employee Node Model
VCDMachineTemplate
VCDMachineTemplate.spec.template.spec.template Ubuntu 20.04 and Kubernetes v1.20.15+vmware.1 Ubuntu 20.04 and Kubernetes v1.22.9+vmware.1
VCDMachineTemplate.spec.template.spec
MachineDeployment
MachineDeployment.spec.model v1.20.15+vmware.1 v1.22.9+vmware.1
Desk 4 – Instance values to alter in capiyaml payload for TKG 1.5.4 Kubernetes model 1.20.15 to 1.22.9 for CSE 4.0, 4.0.1
  • Whereas performing the PUT API name, guarantee to incorporate fetched eTag worth as If-Match

Delete a Cluster

  • Fetch the Cluster ID("id": "urn:vcloud:entity:vmware:capvcdCluster:<ID>) from the above API name’s output.
  • Copy the whole output of the API response.
  • Notedown eTag Worth from API response header
  • Add or modify the next fields to delete or forcefully delete the cluster beneath entity.spec.vcdke:
    • “markForDelete”: true, –> Set the worth to true to delete the cluster
    • “forceDelete”: true, –> Set this worth to true for Forceful deletion of a cluster

Advice for API Utilization throughout automation

  • DO NOT hardcode API urls with RDE variations. ALWAYS parameterize RDE variations. For instance:

POST https://{{vcd}}/cloudapi/1.0.0/entityTypes/urn:vcloud:kind:vmware:capvcdCluster:1.1.0 Guarantee to declare 1.1.0 as a variable. This may guarantee simple API shopper upgrades to future variations of CSE.

  • Make sure the API shopper code ignores any unknown/extra properties whereas unmarshaling the API response

Abstract

To summarize, we checked out CRUD operations for a Tanzu Kubernetes clusters on VMware Cloud Director platform utilizing VMware Cloud Director supported APIs. Please be happy to checkout different assets for Container Service Extension as follows:

  1. Generate API token utilizing VMware Cloud Director
  2. CSE 4.0 Official Documentation
  3. Cluster API for VMware Cloud Director Platform official Documentation



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments