Skip to content

Instantly share code, notes, and snippets.

@brunoborges
Last active February 14, 2022 22:12
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save brunoborges/9df576689b404aee70a8065210c77fb3 to your computer and use it in GitHub Desktop.
Save brunoborges/9df576689b404aee70a8065210c77fb3 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -x
function setenv-all-pods() {
echo
DEPLOYMENT_LIST=$(kubectl -n $1 get deployment -o jsonpath='{.items[*].metadata.name}')
echo "Set Log4J setting for all pods by overriding LOG4J_FORMAT_MSG_NO_LOOKUPS with true."
for deployment_name in $DEPLOYMENT_LIST; do
kubectl -n $1 set env deployment $deployment_name LOG4J_FORMAT_MSG_NO_LOOKUPS="true"
done
echo
}
setenv-all-pods ${NAMESPACE:-$1}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment