K8s
- View logs since
- Given timestamp
k logs --since-time='2023-05-14T00:00:00Z' <pod_name>
- Last n hours
k logs --since=24h <pod_name>
- Last n lines
k logs --tail=100 <pod_name>
- Given timestamp
- Get password from deployment secrets
1 2 3
k get deployments -> k describe deployment my-deployment k get secret db-password -o yaml echo <thepassword> | base64 -d
k describe secret <secret>
- Switch namespace
k config set-context --current --namespace=dev
- Show config (namespace etc.)
k config view
- Print only namespace
k config view --minify --output 'jsonpath={..namespace}'; echo
- Show deployment details
k describe deployment <deployment>
- Show information about pod (e.g. latest failures)
k descripe pod <pod>