Skip to content

Unity-Technologies/kubernetes-deploy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kubernetes-deploy

A Go module for deploying to Kubernetes and retrieving status of that deploy.

Useful for deploy bots.

Includes main.go sample app demonstrates its features.

Build Status

How does it work?

Calls Kubernetes API to update the image of an existing deployment and checks that new images are running successful.

Authorization for Kubernetes API via Authorization: Bearer <token> header. Offers a BearerTokenRetriever interface to provide flexibility -- either grab a long-lived token once from an environment variables, or refresh and retrieve short-lived tokens prior to each call.

NOTE that you need to have a running deployment of your app in your Kubernetes cluster first. Deploying only changes an existing deployment's image to a new Docker image.

Getting Started with Sample Program

Copy the sample .env file and fill in your values.

cp .env-sample .env

The sample main.go program supports two commands:

# list current pods in deployment
go run main.go ls     

# deploy container with this specific tag
go run main.go deploy 77d0ea51fdc30234918f2726d26479c66b7f777   

Run tests

go test ./...

About

A Go module for deploying to Kubernetes and retrieving status of that deploy. Useful for deploy bots.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages