DEV Community

Jution Candra Kirana
Jution Candra Kirana

Posted on

Kubernetes: Exec

Let's return to the docker material for a moment. In Docker, you can enter a running container using the docker exec command. Similarly, in Kubernetes, you can enter a container within a pod using the kubectl exec command.

Catatan: Since a pod can have more than one container, you can specify the container you want to enter by using the -c {container_name} option. The full command looks like this:

kubectl exec -it {nama_pod} -c {nama_container} -- /bin/sh
Enter fullscreen mode Exit fullscreen mode

So, if you want to enter the container that was created earlier, the command would be:

kubectl exec -it sample-nginx -- /bin/sh

/ # ls
bin                   home                  proc                  sys
dev                   lib                   root                  tmp
docker-entrypoint.d   media                 run                   usr
docker-entrypoint.sh  mnt                   sbin                  var
etc                   opt                   srv
/ #
Enter fullscreen mode Exit fullscreen mode

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)