Skip to content

venkyvb/k8s-sharedinformer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

k8s-sharedinformer

Simple example of the client-go SharedInformer that can be used to do all kinds of fun stuff with K8S deployment events

To run the example

  1. Clone this repo - git clone https://github.com/venkyvb/k8s-sharedinformer.git
  2. cd k8s-sharedinformer
  3. Update the path to the KUBECONFIG file (assumes that this app is running outside the cluster)
  4. Do a local K8S cluster set-up either using the Docker Desktop or the much more lightweight and awesome Kind
  5. To update the go-mod dependencies run go get
  6. Run the app - go run main.go.
  7. In another terminal session run do a simple K8S deployment (the file nginx.yaml) - kubectl apply -f nginx.yaml
  8. You would be able to see the message - Pod started -> nginx-deployment-XXXXXXXXX-XXXXX in the waiting console session created in step (6)
  9. Now run kubectl delete deployment nginx-deployment in the 2nd terminal session
    1. You would be able to see the message - Pod deleted -> nginx-deployment-XXXXXXXXX-XXXXX in the waiting console session created in step (6)

Have fun !!

About

Shared informer example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages