Deploying a load-balanced HTTP application using Go
Now that we understand a bit more about the Kubernetes API and the resources exposed by the API, we can move away from kubectl
toward using Go.
In this section, we will use Go to do many of the same things we did in the previous section using kubectl
. We will authenticate using our default context and create a namespace. However, we will not stop there. We will deploy a load-balanced HTTP application to our cluster and watch the logs stream to STDOUT as we make requests to the service.
The code for this section can be found at https://github.com/PacktPublishing/Go-for-DevOps/tree/rev0/chapter/14/workloads. The demo we are about to walk through can be executed with the following commands:
$ kind create cluster --name workloads --config kind-config.yaml $ kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml $ kubectl wait --namespace ingress-nginx \ ...