Last active
January 5, 2020 12:30
-
-
Save reloni/8367063d523d3b7d555c621752369ab1 to your computer and use it in GitHub Desktop.
Kubernetes tricks
This file contains 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
Get container last termination message: | |
kubectl get pod gotest-app-morty-5d6f6667c4-8bffb -o go-template="{{range .status.containerStatuses}}{{.lastState.terminated.message}}{{end}}" | |
Get events sorted by date: | |
kubectl get event --sort-by .lastTimestamp | |
Get events sorted, filtered by deployment name: | |
kubectl get event --sort-by .lastTimestamp --field-selector involvedObject.name=go-static-files-rick | |
Get logs filtered by label (suitable for deployments): | |
kubectl logs -l app=elasticsearch | |
kubectl logs deployment/gotest-app-morty --since=10m | |
Create opaque secret: | |
kubectl create secret generic backend-user --from-literal=backend-username='backend-admin' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment