WKS on GCE¶
Prerequisites¶
-
Install:
-
If you have never used direnv, you need to set it up. It hooks itself into your shell to set/unset environment variables when you enter or leave a directory.
eval "$(direnv hook bash)"
-
Create an
.envrc
file with, for example, the following content (or change to appropriate values where relevant):export project="wks-tests" export zone="europe-west1-b" export user="$(whoami)" export network="${user}-demo" export image_project="centos-cloud" export image_family="centos-7" export network_interface="eth0"
(see also: GCP images) and run:
direnv allow
Create the WKS cluster¶
-
Create the GCE network and instances:
./create-network.sh && ./create-instances.sh
Note: In case cluster capacity for number of instances is reached, try using another zone in
.envrc
. -
Generate
machines.yaml
:./generate-machines-manifest.sh
-
Create & configure the WKS cluster:
wksctl apply
-
Generate the kubeconfig file
wksctl kubeconfig
This will print a line to the console similar to
$ export KUBECONFIG=/[path to kubeconfig file]
. Copy that line and paste it into any terminal you are usingkubectl
in. -
Ensure that everything's working:
kubectl get namespaces
should return something like
NAME STATUS AGE default Active 1m59s kube-public Active 1m59s kube-system Active 1m59s system Active 1m54s
Delete the WKS cluster¶
To delete your WKS cluster, run:
./delete-instances.sh && ./delete-network.sh