Kubernetes execute command using exec command

Опубликовано: 11 Октябрь 2024
на канале: SMAC Academy
2,981
6

Execute commands using kubectl exec command inside a container in pods

Commands Used:

kubectl apply -f https://k8s.io/examples/application/s...

kubectl get pod shell-demo

kubectl exec shell-demo -- ls /
kubectl exec shell-demo -- cat /usr/share/nginx/html/index.html
kubectl exec shell-demo -- apt-get install curl
kubectl exec shell-demo -- bash -c "echo Hello shell demo _ /usr/share/nginx/html/index.html"

kubectl exec shell-demo -- cat /usr/share/nginx/html/index.html

kubectl exec shell-demo -- curl http://localhost/