A Go module for deploying to Kubernetes and retrieving status of that deploy. Useful for deploy bots.
Перейти к файлу
Brian Gershon 5d33c002b8
Filtering PodList results by deployment name. (#1)
2019-02-25 14:42:10 -08:00
deploy Filtering PodList results by deployment name. (#1) 2019-02-25 14:42:10 -08:00
.env-sample Create sample app to demonstrate features. 2018-10-01 14:49:59 -07:00
.gitignore Create sample app to demonstrate features. 2018-10-01 14:49:59 -07:00
.travis.yml Add TravisCI 2018-10-05 17:23:24 -07:00
LICENSE Initial commit 2018-09-28 17:02:59 -07:00
README.md Filtering PodList results by deployment name. (#1) 2019-02-25 14:42:10 -08:00
main.go Simplify cluster config in sample app by grouping 2018-10-05 17:01:00 -07:00

README.md

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 ./...