Skip to content

Instantly share code, notes, and snippets.

@sarjarapu
Created July 11, 2018 20:54
Show Gist options
  • Save sarjarapu/5d734363b457c095effd2ee763900f5f to your computer and use it in GitHub Desktop.
Save sarjarapu/5d734363b457c095effd2ee763900f5f to your computer and use it in GitHub Desktop.
A kubectl command to check the logs for MongoDB Enterprise Operator pod
# find the pod name for mongodb-enterprise-operator using selectors
K8_OPERATOR_POD_NAME=$(kubectl -n mongodb get pods --selector=app=mongodb-enterprise-operator --output=jsonpath='{.items[0].metadata.name}')
# display the mongodb-enterprise-operator logs from mongodb namespace
kubectl -n mongodb logs $K8_OPERATOR_POD_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment