Last active
October 27, 2023 06:40
-
-
Save smyth64/8a32bb02a7354220234425e5a03dcffa to your computer and use it in GitHub Desktop.
Kubernetes Force Repull of Image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
kubectl patch deployment $1 -p '{"spec": {"template": {"spec":{"containers":[{"name": "'$1'", "imagePullPolicy":"Always"}]}}}}' | |
sleep 15 | |
kubectl rollout restart deployment $1 | |
sleep 15 | |
kubectl patch deployment $1 -p '{"spec": {"template": {"spec":{"containers":[{"name": "'$1'", "imagePullPolicy":"IfNotPresent"}]}}}}' | |
# Getting Started | |
# 1. sudo nano /usr/local/bin/kroll | |
# 2. paste the code | |
# 3. chmod o+x /usr/local/bin/kroll | |
# 4. Have fun! | |
# Example: | |
# kroll server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment