Skip to content

bzon/k8s-client-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pod Reader, an In-Cluster Kubernetes Client Example

Reference: https://github.com/kubernetes/client-go/tree/master/examples/in-cluster-client-configuration

Demo

Build the app and push the docker image.

make build
make push

Create the RBAC resources.

kubectl apply -f rbac.yaml

Run the pod-reader app

kubectl run pod-reader --image=bzon/k8s-client-example --serviceaccount=pod-reader --namespace=default
kubectl logs -f pod-reader-6dd9bf767d-5tt85
There are 115 pods in the cluster
There are 115 pods in the cluster
There are 114 pods in the cluster
There are 114 pods in the cluster

Releases

No releases published

Packages

No packages published