jueves, febrero 22, 2024
InicioCloud 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 instances, together with Cluster API, lifecycle administration by way of a consumer interface, GPU help for Kubernetes clusters, and integration with VMware Cloud Director as infrastructure. With its feature-rich consumer interface, clients can carry out operations comparable to creation, scaling, and upgrading on Tanzu Kubernetes clusters. Nevertheless, some clients could search automation help for these identical operations.

This weblog publish is meant for patrons who wish 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 publish 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 publish outlines the step-by-step course of for producing the proper payload for patrons 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 present stipulations for patrons to create TKG clusters of their organizations additionally apply to the automation stream. These stipulations are summarized right here and might be discovered within the official documentation to onboard Supplier and Tenant Admin customers. The next sections present an summary 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 devour 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. Evaluate Interoperability Matrix to help Container Service Extension 4.0 and 4.0.1
  2. Enable essential 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 consumer with the “Kubernetes cluster creator” function throughout the tenant group.

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

Generate ‘capiyaml’ payload

  • Accumulate VCD Infrastructure and Kubernetes Cluster particulars

This Operation requires following info for VCD tenant portal. The fitting column describes instance values used as reference on this weblog publish.

Enter Instance worth for this weblog
VCD_SITE VCD Tackle (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 airplane vms(TKG small)
VCD_CONTROL_PLANE_STORAGE_PROFILE Storage profile for management airplane of the cluster (Capability)
VCD_CONTROL_PLANE_PLACEMENT_POLICY Non-obligatory – Depart empty if not utilizing
VCD_WORKER_SIZING_POLICY Sizing coverage of employee nodes vms(TKG small)
VCD_WORKER_PLACEMENT_POLICY Non-obligatory – Depart empty if not utilizing
VCD_WORKER_STORAGE_PROFILE Storage profile for management airplane 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 remodeling 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 form 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.

Information Cluster

Filter Cluster by title

Get cluster by ID:

Get Kubeconfig of the cluster:

The Kubeconfig might be discovered as follows at: entity.standing.capvcd.personal.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 entire 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 airplane vms. Be aware solely odd numbers of management airplane are supported.
    • To resize Employee Aircraft VMS Modify MachineDeployment.spec.replicas with desired variety of employee airplane 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 entire output of the API response.
  • Notedown eTag Worth from API response header
  • The shopper consumer performing cluster improve would require entry to Desk 3 info. 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 entire 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 underneath 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/further 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 at liberty to checkout different sources 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
RELATED ARTICLES

DEJA UNA RESPUESTA

Por favor ingrese su comentario!
Por favor ingrese su nombre aquí

Most Popular

Recent Comments