Tuesday, July 19, 2022

Kubernetes - Commands and Arguments

 If you supply a command but no args for a Container, only the supplied command is used. The default EntryPoint and the default Cmd defined in the Docker image are ignored. If you supply only args for a Container, the default Entrypoint defined in the Docker image is run with the args that you supplied.



Example

apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: null
  labels:
    run: test
  name: test
spec:
  containers:
  - image: sahan/name-printer:latest
    name: test
    command: ["date"]
    args: ["-u"]
    resources: {}
  dnsPolicy: ClusterFirst
  restartPolicy: Always
status: {}

0 comments:

Post a Comment