Skip to content

rootsongjc/kubernetes-client-go-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Kubernetes client-go sample

This is a simple code sample for using kubernetes client-go package.

You can use this code to update a specify deployment's application image (More than one container in a pod).

Build

go build main.go

Usage

Usage of ./main:
  -app string
    	application name (default "app")
  -deployment string
    	deployment name
  -image string
    	new image name
  -kubeconfig string
    	(optional) absolute path to the kubeconfig file (default "/Users/jimmy/.kube/config")
  • -image: new image name
  • -deployment: deployment name
  • -app: (optional) application container name (default: app)
  • -kubeconfig: (optional) absolute path to the kubeconfig file (default "$HOME/.kube/config")

Example

./update-deployment-image -image test:Build_8 -deployment filebeat-test
Found deployment
name -> filebeat-test
Old image -> test:Build_7
New image -> test:Build_8

About

Kubernetes client-go sample

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages