Skip to content

Instantly share code, notes, and snippets.

@shaunhess
Last active March 3, 2022 20:10
Show Gist options
  • Save shaunhess/bf23c413f50bb6bf6454fef6d711b7d2 to your computer and use it in GitHub Desktop.
Save shaunhess/bf23c413f50bb6bf6454fef6d711b7d2 to your computer and use it in GitHub Desktop.

Tanzu Community Edition (CE) Notes

Tanzu Stack

image

Useful Links

Prequisites

Quick Start - Windows Subsystem for Linux (ubuntu) w/ Docker desktop

  1. Install tanzu
curl -H "Accept: application/vnd.github.v3.raw" -L https://api.github.com/repos/vmware-tanzu/community-edition/content/hack/get-tce-release.sh | bash -s v0.10.0 linux

This script requires curl, grep, sed, tr, and jq in order to work. To install any missing dependencies; example sudo apt-get install jq

  1. Unpack the release
tar xzvf ./tce-linux-amd64-v0.10.0.tar.gz
  1. Run install script
cd tce-linux-amd64-v0.10.0/
./install.sh

verify installation tanzu version

  1. Initialize the Tanzu Community Edition installer interface / Install Management Cluster
tanzu management-cluster create --ui

Visit UI @ http://127.0.0.1:8080

image

image

image

CLI cmd tanzu management-cluster create mgmtcluster01 --file /home/shaunhess/.config/tanzu/tkg/clusterconfigs/8j4fjxjcwi.yaml -v 6

  1. Validate management cluster is started
tanzu management-cluster get

To delete management cluster tanzu management-cluster delete

  1. Capture management cluster kubeconfig
tanzu management-cluster kubeconfig get <MGMT-CLUSTER-NAME> --admin
  1. Set your kubectl context to the management cluster.
kubectl config use-context <MGMT-CLUSTER-NAME>-admin@<MGMT-CLUSTER-NAME>
  1. Get nodes
kubectl get nodes
  1. Create workload cluster
tanzu cluster create <WORKLOAD-CLUSTER-NAME> --plan dev

Validate cluster started tanzu cluster list

  1. Capture the workload cluster’s kubeconfig
tanzu cluster kubeconfig get <WORKLOAD-CLUSTER-NAME> --admin
  1. Set kubectl context
kubectl config use-context <WORKLOAD-CLUSTER-NAME>-admin@<WORKLOAD-CLUSTER-NAME>
  1. Get pods in cluster
kubectl get pods -A
  1. Get services in cluster
kubectl get svc -A

Managed Cluster

image

Integrate into preferred infrastructure

image

  • CNI - Container Network Interface
  • CPI - Cloud Provider Interface - CSI
  • Container Storage Interface (Native storage interface for persistent storage)

East <--> West Traffic (Pod container communication)

  • Antrea (VMware)
  • Calico
  • Multus (Multi-homed pods; pods with multiple network interfaces)

North <--> South Traffic (Layer 4 - External Traffic)

  • kube-vip
  • NSX

Consistently Deploy Apps Across Any Infrastructure

image

Secure End-to-End Cloud Native Operations

image

Visibility Into Cluster Operations and Apps

image

Random notes

Create a cluster from template

tanzu cluster create <cluster_name> -f ~/.config/tanzu/tkg/clusterconfigs/tcstemplate.yaml

Scale worker nodes on a cluster

tanzu cluster scale <cluster_name>> -w <num_of_worker_nodes>

List available tanzu packages

tanzu package available list

Add tanzu package repo

tanzu package repository add <repo_name> --url <url> --names <pkg_name>

List installed packages tanzu package repository list --all-namespaces

Secure ingress w/ lets encrypt

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
	name: nginx
	annotations:
		cert-manager.io/cluster-issuer: letsencrypt-prod
		ingress.kubernetes.io/force-ssl-redirect: "true"
		kubernetes.io/ingress.class: contour
		kubernetes.io/tls-acme: "true"
spec:
	tls:
	- secretName: nginx-tls
		hosts:
		- nginx.mytanzu.com
	rules:
	- host: nginx.mytanzu.com
		http:
			paths:
			- pathType: Prefix
				path: "/"
				backend:
					service:
						name: nginx
						port:
							number: 443
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment