kubernetes-client-go-sample

command module
v0.0.0-...-73eeab2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL