https://github.com/bzon/k8s-client-example
https://github.com/bzon/k8s-client-example
go golang kubernetes kubernetes-client
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/bzon/k8s-client-example
- Owner: bzon
- Created: 2018-08-30T11:23:49.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-30T11:25:28.000Z (almost 8 years ago)
- Last Synced: 2025-01-22T08:28:36.216Z (over 1 year ago)
- Topics: go, golang, kubernetes, kubernetes-client
- Language: Go
- Homepage:
- Size: 7.84 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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.
```bash
make build
make push
```
Create the RBAC resources.
```bash
kubectl apply -f rbac.yaml
```
Run the pod-reader app
```bash
kubectl run pod-reader --image=bzon/k8s-client-example --serviceaccount=pod-reader --namespace=default
```
```bash
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
```