Work In Progress
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