Skip to content

Instantly share code, notes, and snippets.

@pichuang
Last active February 20, 2022 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save pichuang/a2e95dd22855f108d962ea0b29102fa4 to your computer and use it in GitHub Desktop.
Save pichuang/a2e95dd22855f108d962ea0b29102fa4 to your computer and use it in GitHub Desktop.
#######
Phase 1
#######
# Install an NTP Server with Chrony on Ubuntu 20.04
sudo timedatectl set-timezone Asia/Taipei
sudo apt update
sudo apt install chrony -y
sudo systemctl start chronyd
sudo systemctl status chronyd
sudo timedatectl set-ntp true
sudo systemctl restart chronyd
chronyc activity
# https://docs.docker.com/engine/install/ubuntu/
# Update the apt package index and install packages to allow apt to use a repository over HTTPS
sudo apt-get update
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
# Add Docker’s official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
# Use the following command to set up the stable repository.
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Update the apt package index, and install the latest version of Docker Engine and containerd, or go to the next step to install a specific version
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
# Docker Compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
# Add your user to the docker group
# https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user
sudo usermod -aG docker ubuntu
newgrp docker
#######
Phase 2
#######
# List of docker daemon
docker version
docker info | grep -i cgroup
# You must download and install the latest version of kubectl
curl -LO https://dl.k8s.io/release/v1.20.1/bin/linux/amd64/kubectl
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
# https://github.com/vmware-tanzu/community-edition/releases/tag/v0.10.0-rc.2
# Download recent releases of VMware Tanzu Community Edition
wget https://github.com/vmware-tanzu/community-edition/releases/download/v0.10.0-rc.2/tce-linux-amd64-v0.10.0-rc.2.tar.gz
tar xzvf tce-linux-amd64-v0.10.0-rc.2.tar.gz
cd tce-linux-amd64-v0.10.0-rc.2
./install.sh
tanzu version
# Create Local Docker Clusters
docker pull kindest/haproxy:v20210715-a6da3463
docker images
# Hot Fixed
docker pull projects.registry.vmware.com/tkg/antrea/antrea-debian:v0.13.3_vmware.1
CLUSTER_PLAN=dev tanzu management-cluster create mgmt-cluster -i docker -v 10
echo "CLUSTER_PLAN=dev tanzu management-cluster create --ui --bind 0.0.0.0:8080"
# Validate the management cluster started
tanzu management-cluster get
tanzu management-cluster kubeconfig get mgmt-cluster --admin
kubectl config get-contexts
kubectl get nodes
#######
Phase 3
#######
# Create your workload cluster
tanzu cluster create workload-cluster --plan dev
tanzu cluster list
tanzu cluster kubeconfig get workload-cluster --admin
kubectl config get-contexts
kubectl config use-context workload-cluster-admin@workload-cluster
kubectl get pods --all-namespaces
#######
Phase 4
#######
tanzu cluster scale workload-cluster -w2
#######
Phase 5
#######
wget https://github.com/vmware-tanzu/octant/releases/download/v0.25.0/octant_0.25.0_Linux-64bit.deb
sudo dpkg -i octant_0.25.0_Linux-64bit.deb
octant --listener-addr 0.0.0.0:7777
#######
Phase 6
#######
kubectl apply -f https://projectcontour.io/quickstart/contour.yaml
kubectl apply -f https://projectcontour.io/examples/proxydemo/01-prereq.yaml
kubectl apply -f https://projectcontour.io/examples/proxydemo/02-proxy-basic.yaml
echo "172.18.0.7 local.projectcontour.io" | sudo tee -a /etc/hosts
cat /etc/hosts
curl http://local.projectcontour.io
curl http://local.projectcontour.io/secure
#######
Phase 1
#######
# Install an NTP Server with Chrony on Ubuntu 20.04
sudo timedatectl set-timezone Asia/Taipei
sudo apt update
sudo apt install chrony -y
sudo systemctl start chronyd
sudo systemctl status chronyd
sudo timedatectl set-ntp true
sudo systemctl restart chronyd
chronyc activity
# https://docs.docker.com/engine/install/ubuntu/
# Update the apt package index and install packages to allow apt to use a repository over HTTPS
sudo apt-get update
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
# Add Docker’s official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
# Use the following command to set up the stable repository.
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Update the apt package index, and install the latest version of Docker Engine and containerd, or go to the next step to install a specific version
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
# Add your user to the docker group
# https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user
sudo usermod -aG docker ubuntu
newgrp docker
#######
Phase 2
#######
# List of docker daemon
docker version
docker info | grep -i cgroup
# You must download and install the latest version of kubectl
curl -LO https://dl.k8s.io/release/v1.20.1/bin/linux/amd64/kubectl
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
# https://tanzucommunityedition.io/download/
# Download recent releases of VMware Tanzu Community Edition
wget https://github.com/vmware-tanzu/community-edition/releases/download/v0.9.1/tce-linux-amd64-v0.9.1.tar.gz
tar xzvf tce-linux-amd64-v0.9.1.tar.gz
cd tce-linux-amd64-v0.9.1
./install.sh
tanzu version
# Create Local Docker Clusters
docker pull kindest/haproxy:v20210715-a6da3463
docker images
CLUSTER_PLAN=dev tanzu management-cluster create mgmt-cluster -i docker -v 10
echo "CLUSTER_PLAN=dev tanzu management-cluster create --ui --bind 0.0.0.0:8080"
# Validate the management cluster started
tanzu management-cluster get
tanzu management-cluster kubeconfig get mgmt-cluster --admin
kubectl config get-contexts
kubectl get nodes
#######
Phase 3
#######
# Create your workload cluster
tanzu cluster create workload-cluster --plan dev
tanzu cluster list
tanzu cluster kubeconfig get workload-cluster --admin
kubectl config get-contexts
kubectl config use-context workload-cluster-admin@workload-cluster
kubectl get pods --all-namespaces
#######
Phase 4
#######
tanzu cluster scale workload-cluster -w2
#######
Phase 5
#######
wget https://github.com/vmware-tanzu/octant/releases/download/v0.25.0/octant_0.25.0_Linux-64bit.deb
sudo dpkg -i octant_0.25.0_Linux-64bit.deb
octant --listener-addr 0.0.0.0:7777
#######
Phase 6
#######
kubectl apply -f https://projectcontour.io/quickstart/contour.yaml
kubectl apply -f https://projectcontour.io/examples/proxydemo/01-prereq.yaml
kubectl apply -f https://projectcontour.io/examples/proxydemo/02-proxy-basic.yaml
echo "172.18.0.7 local.projectcontour.io" | sudo tee -a /etc/hosts
cat /etc/hosts
curl http://local.projectcontour.io
curl http://local.projectcontour.io/secure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment