modified: README.md
This commit is contained in:
@@ -12,6 +12,7 @@ Kubernetes is an open‑source platform that automates the deployment, scaling,
|
||||
- [OOMKilled](#oomkilled)
|
||||
- [Attach to an pod](#attach-to-an-pod)
|
||||
- [Run command on pod](#run-command-on-pod)
|
||||
- [Container TTY](#container-tty)
|
||||
- [Persistent volumes](#persistent-volumes)
|
||||
- [create PersistentVolumes - host path](#create-persistentvolumes---host-path)
|
||||
- [find persistent volume used pvc](#find-persistent-volume-used-pvc)
|
||||
@@ -274,6 +275,20 @@ POD_NAME=$(kubectl get pod -l app=$MY_APP_NAME -n $NAMESPACE -o jsonpath='{.item
|
||||
kubectl exec -n $NAMESPACE -it ${POD_NAME} -- sh
|
||||
```
|
||||
|
||||
### Container TTY
|
||||
|
||||
```yaml
|
||||
...
|
||||
command: ["bash", "-c"]
|
||||
tty: true
|
||||
args:
|
||||
- |
|
||||
while true; do
|
||||
sleep 100
|
||||
done
|
||||
...
|
||||
```
|
||||
|
||||
``` bash
|
||||
# bash
|
||||
POD_NAME=$(kubectl get pod -l app=myAppName -n appNamespace -o jsonpath='{.items[0].metadata.name}')
|
||||
|
||||
Reference in New Issue
Block a user