Set entrypoint-style command in YAML.
Section: Pods and Containers
Override container command and args
yaml
yaml
apiVersion: v1
kind: Pod
metadata:
name: args-demo
spec:
containers:
- name: app
image: busybox:1.36
command: ["sh", "-c"]
args: ["echo hello && sleep 3600"]Explanation
Use `command` and `args` to define commands and arguments for a container in a Pod spec.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Pods and Containers
Set explicit environment variables
Define environment variables with `env`.
Expose named container ports
Name ports for Service targeting and probes.
Load env from ConfigMap and Secret
Import environment values into a container.