Skip to content

Instantly share code, notes, and snippets.

@dholbach
Created April 17, 2019 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dholbach/33ebd9e78a2bf9cbd81f4fc0f18990e2 to your computer and use it in GitHub Desktop.
Save dholbach/33ebd9e78a2bf9cbd81f4fc0f18990e2 to your computer and use it in GitHub Desktop.

Disable the Weave agent

Disable the Weave agent to prevent it from overwriting the adjustments you make in the next steps by running:

kubectl -n weave scale deployment/weave-agent --replicas=0

Overwrite the affected images

  1. Retrieve the Weave cloud manifests the agent would normally apply by requesting the following URL, replace <k8s-version> and <service-token> with the respective values:

    curl -o weave-cloud.json -L "https://cloud.weave.works/k8s/v<k8s-version>/weave-cloud.json?service-token=<service-token>"
  2. Change the affected images quay.io/weaveworks/watch and quay.io/weaveworks/flux, so they are pulled from docker.io. This can be done by running the following command:

    sed -i -e 's#quay.io/weaveworks/watch#docker.io/weaveworks/watch#g' -e 's#quay.io/weaveworks/flux#docker.io/weaveworks/flux#g' weave-cloud.json
  3. Apply the modified manifests to your cluster:

    kubectl apply -f weave-cloud.json

Re-enabling the Weave agent and reverting the changes

Once the issues with the images have been resolved you can simply directly apply the manifests from cloud.weave.works to your cluster and scale up the agent again:

kubectl apply -f "https://cloud.weave.works/k8s/v<k8s-version>/weave-cloud.json?service-token=<service-token>"
kubectl -n weave scale deployment/weave-agent --replicas=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment