Skip to content

xujihui1985/kubelab

Repository files navigation

Setup kubernetes cluster

Prerequisites

run script

  • provision instance and network
cd provision

./networking.sh

./nodes.sh
  • generate cert
cd cert

./generate.sh
  • generate kubeconfig
cd kubeconfig

./generate-kubeconfig.sh
  • distribute to instance
cd provision

./distribute.sh
  • provision etcd
cd etcd

./bootstrap-etcd.sh
  • provision controller components
cd controller

./bootstrap-controller.sh

  • provision loadbalancer for api server
cd api-loadbalancer

./bootstrap-apilb.sh
  • provision worker components
cd worker

./bootstrap-worker.sh
  • setup network
cd network

./setup.sh
  • setup client
cd client

./setup.sh
  • provision dns addon
cd addon

./setup-dnsaddon.sh

validate

cd client

# create a deployment for nginx
kubectl --kubeconfig kubelab.kubeconfig run nginx --image=nginx

# get pod name
POD_NAME=$(kubectl --kubeconfig kubelab.kubeconfig get pods -l run=nginx -o jsonpath="{.items[0].metadata.name}")

# port forward
kubectl --kubeconfig kubelab.kubeconfig port-forward $POD_NAME 8080:80

open http://127.0.0.1:8080

cleanup

after finish the lab, cleanup the resource

cd cleanup

./cleanup-instances.sh
./cleanup-network.sh

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published