For demo purpose, this tutorial introduces how to setup KubeGateway on local Kubernetes by kind
, and we will use the kind cluster as upstream cluster.
Please install the following tools:
Build the environment locally by running the script
bash hack/local-up.sh
The script performs the following tasks:
- create a local kubernetes cluster named
kubegateway
bykind
- generating
- generate tls key and cert for kube-gateway control plane server, and create a associated secret
- generate tls key and cert for kube-gateway to connect to upstream kube-apiserver
- generate tls key and cert for client to connect to kube-gateway control plane
- configure contexts of kubectl
- create a new context named
gateway-control-plane
- create a new context named
gateway-proxy
- create a new context named
- compile and build image
- run kube-gateway on local kubernetes cluster and create a new UpstreamCluster on it
After script running completed, then
- you can comunicate with kube-gateway control plane by using
kubectl --context gateway-control-plane
- you can comunicate with kube-apiserver through kube-gateway proxy by using
kubectl --context gateway-proxy
- you can comunicate with kube-apiserver directly by using
kubectl --context kind-kubegateway
- make sure local port 8443 is not occupied
- please specify the domain name to
localhost
when connecting to kube-apiserver through kube-gateway proxy - for demo purpose, default user has super privilege. you can generate new user tls key and cert by using
ca.key
andca.crt
underoutput/upstream