ramped-inside-the-cluster

command
v0.0.0-...-f36290b Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2018 License: MIT Imports: 16 Imported by: 0

README

asciicast

Work In Progress

MIT License GoDoc Go Report Card

Ramped Deployment

Using test-webserver as template

Branch from ../ramped for deployments from inside a cluster

Prepare update.go - i.e. use

"k8s.io/client-go/rest"
config, err := rest.InClusterConfig()

instead of

"k8s.io/client-go/tools/clientcmd"
config, err := clientcmd.BuildConfigFromFlags("", "/home/stefan/.kube/config")

build app

GOOS=linux go build -o ./app .

create Dockerfile

cat >Dockerfile <<EOF
FROM debian
COPY ["./app", "./deployment.yaml", "update.yaml", "/"]
ENTRYPOINT /app
EOF

build image

docker build -t update-in-cluster:1.0.0 .

push image as needed

create wrapper for deleting inactive job

cat >deploy.bash <<EOF
kubectl create -f update_job.yaml

while [ "$(kubectl get jobs update-job -o jsonpath='{.status.active}')" != "" ]
do
    sleep 1
    printf "."
done

kubectl delete -f update_job.yaml
EOF

chmod +x deploy.bash

run wrapper

eval $(minikube docker-env)

./deploy.bash

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