This is a kubernetes client-go library project which can is used to query about k8s resources such as pods or deployments.
-
Use the compiled binary and the given Dockerfile to generate a docker image.
-
Now, push to docker image to your container registery such as docker hub.
-
Start a kubernetes cluster using any k8s single-node distribution. Eg - kind
-
Start this application as a pod.
kubectl run clientgoapp --image=[IMAGE FROM YOUR CONTAINER REGISTERY]
. You may also run this as a deployment. -
Assign role to the default service account in order for the apps to list resources.
kubectl create role poddeploy --resources pods, deployments --verb list
kubectl create rolebinding poddeploy --role poddeploy --serviceaccount default:default
kubectl logs [POD-NAME]
to get the results from the mod.