Using TMC CLI to create a TKG AWS production cluster
search cancel

Using TMC CLI to create a TKG AWS production cluster

book

Article ID: 337102

calendar_today

Updated On:

Products

VMware Tanzu Kubernetes Grid

Issue/Introduction

To create a Production grade TKG AWS Workload cluster, we need to pass a yaml with the necessary data to TMC CLI.

Resolution

TMC CLI should point to a yaml as show below
tmc cluster create -f <configfile>

Example:  

tmc cluster create -f ~/Downloads/prod-aws-config.yaml
√ cluster "prod-aws-cluster" is being created

Example config file below. The values inside the Cluster Spec can be changed, while making sure there are three Nodepools specified. 

The three Nodepools should have AZs in the same order as the  AZs  specified in the provider subnet section.

fullName:
  managementClusterName: <MANAGEMENT-CLUSTER-NAME>
  name: <CLUSTER-NAME>
  provisionerName: <PROVISIONER-NAME>
meta:
  labels: null
spec:
  clusterGroupName: default
  tkgAws:
    distribution:
      region: us-west-2
      version: v1.21.2+vmware.1-tkg.2
    settings:
      network:
        cluster:
          apiServerPort: 6443
          pods:
          - cidrBlocks: 100.96.0.0/11
          services:
          - cidrBlocks: 100.64.0.0/13
        provider:
          subnets:
          - availabilityZone: us-west-2a
            cidrBlock: 10.0.1.0/24
            isPublic: true
          - availabilityZone: us-west-2a
            cidrBlock: 10.0.0.0/24
            isPublic: false
          - availabilityZone: us-west-2b
            cidrBlock: 10.0.3.0/24
            isPublic: true
          - availabilityZone: us-west-2b
            cidrBlock: 10.0.2.0/24
            isPublic: false
          - availabilityZone: us-west-2c
            cidrBlock: 10.0.5.0/24
            isPublic: true
          - availabilityZone: us-west-2c
            cidrBlock: 10.0.4.0/24
            isPublic: false
          vpc:
            cidrBlock: 10.0.0.0/16
      security:
        sshKey: <SSH-KEY>
    topology:
      controlPlane:
        availabilityZones:
        - us-west-2a
        - us-west-2b
        - us-west-2c
        instanceType: m5.large
        highAvailability: true
      nodePools:
      - info:
          description: ""
          name: md-0
        spec:
          tkgAws:
            instanceType: m5.large
            nodePlacement:
            - availabilityZone: us-west-2a
            version: v1.21.2+vmware.1-tkg.2
          workerNodeCount: 2
      - info:
          description: ""
          name: md-1
        spec:
          tkgAws:
            instanceType: m5.large
            nodePlacement:
            - availabilityZone: us-west-2b
            version: v1.21.2+vmware.1-tkg.2
          workerNodeCount: 2
      - info:
          description: ""
          name: md-2
        spec:
          tkgAws:
            instanceType: m5.large
            nodePlacement:
            - availabilityZone: us-west-2c
            version: v1.21.2+vmware.1-tkg.2
          workerNodeCount: 2
type:
  kind: Cluster
  package: vmware.tanzu.manage.v1alpha1.cluster
  version: v1alpha1