Deploying VMware Tanzu Kubernetes Grid (TKG) using Harbor Image Registry is a powerful way to manage container images in a secure and efficient manner, specially for Air-Gap enviroment.. This post will walk you through the detailed steps required to set up and deploy TKG with Harbor in your environment.  You need to follow some steps to complete the TKG deployment using Harbor

  1. Set Up the Bastion Host:
    • Download Binaries: Obtain the TKG CLI, Kubernetes images, and NSX Advanced Load Balancer binaries from VMware’s official site.
    • Transfer Files: Use a secure method (e.g., USB drive) to transfer these files to the air-gapped environment.
  2. Install Harbor Image Registry:
    • Deploy Harbor: Install Harbor on a VM within the air-gapped environment. Follow these steps:
      • Download the Harbor OVA file from the VMware Tanzu downloads page.
      • In vCenter, right-click on a vSphere cluster and choose “Deploy OVF Template”.
      • Select the Harbor OVA file and follow the prompts to complete the deployment.
    • Push Images: Transfer the necessary container images to the Harbor registry. Use Docker commands to push images:
      docker login <harbor-registry-url>
      docker tag <image> <harbor-registry-url>/<project>/<image>:<tag>
      docker push <harbor-registry-url>/<project>/<image>:<tag>
      
  3. Configure the Bootstrap VM:
    • Install Tools: Install Tanzu CLI, kubectl, and Docker on the bootstrap VM. Ensure the versions are compatible with your TKG deployment.
    • Network Configuration: Configure the bootstrap VM to access the Harbor registry and vSphere environment. Update /etc/hosts if necessary to resolve the Harbor registry’s hostname.
  4. Deploy NSX Advanced Load Balancer:
    • Set Up NSX ALB: Install NSX Advanced Load Balancer and configure it to manage load balancing for your Kubernetes clusters.
    • Configure Services: Set up virtual services and IP pools. Ensure the NSX ALB can communicate with the Kubernetes clusters.
  5. Deploy the Management Cluster:
    • Initialize Cluster: Use the Tanzu CLI to initialize the management cluster. Example command:
      tanzu management-cluster create --file <config-file.yaml>
      
    • Configure Registry: Point the CLI to the local Harbor registry for pulling container images. Update the configuration file to include the Harbor registry URL.
    • Verify Deployment: Ensure the management cluster is operational by checking the status of the nodes and pods.
  6. Deploy Workload Clusters:
    • Create Clusters: Deploy additional workload clusters using the management cluster. Example command:
      tanzu cluster create <cluster-name> --file <config-file.yaml>
      
    • Configure Load Balancer: Ensure each cluster uses the NSX Advanced Load Balancer for ingress and load balancing. Update the cluster configuration to include the NSX ALB settings.

Tips for Success

  • Network Configuration: Ensure all network configurations, including firewall rules and DNS settings, are correctly set up to allow communication between components.
  • Resource Allocation: Allocate sufficient resources (CPU, memory, storage) to each VM and cluster to avoid performance bottlenecks.
  • Regular Updates: Periodically update your environment by downloading the latest binaries and container images on the bastion host and transferring them to the air-gapped environment.

Deploying TKG using Harbor Image Registry requires meticulous planning and execution, but it ensures a secure and controlled Kubernetes infrastructure. By following these steps, you can achieve a successful deployment and leverage the full power of VMware Tanzu Kubernetes Grid.