Skip to content

Instantly share code, notes, and snippets.

@jannylund
Created August 1, 2018 16:07
Show Gist options
  • Save jannylund/97be256ab5d99175ef0c6a5398fb60ed to your computer and use it in GitHub Desktop.
Save jannylund/97be256ab5d99175ef0c6a5398fb60ed to your computer and use it in GitHub Desktop.
# Get the K8S_URL and Token from Rancher Cluster level Kubeconfig (logged in as the CI user)
export K8S_URL=https://<rancherurl>/k8s/clusters/<clusterid>
export TOKEN=<RANCHERTOKEN>
export NAMESPACE=<kubernetes-namespace>
# Typically these are identical. Check from the YAML file of your deployment.
export DEPLOYMENT=<deployment-name>
export CONTAINER=<container-name>
# The docker-image-version must be updated every time you built a new container.
export IMAGE=<docker-image>:<docker-image-version>
kubectl --server=${K8S_URL} \
--insecure-skip-tls-verify=true \
--token=${TOKEN} \
--namespace=${NAMESPACE} \
set image deployment/${DEPLOYMENT} ${CONTAINER}=${IMAGE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment