Skip to content

Commands and Arguments for containers in kubernates

In docker container

For container created with below docker file

FROM ubuntu
ENTRYPOINT ["/bin/bash"]
CMD ["hello", "world"]

Same in Kubernetes

apiVersion: v1
kind: Pod
metadata:
  name: testpod
spec:
  containers:
    - name: test-container
      image: ubuntu-hello
      command: ["/bin/bash"]
      args: ["hello", "world"]

or

kubectl run ping-pod --image=busybox:latest --command -- ping "-c" "30"  "google.com"