<p>Need to pass command line arguments for the docker containers appContainer1 &amp; appContainer2 in the pod.yaml.</p>

<p>pod.yaml</p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: microservices
  labels:
    app: apps
spec:
  containers:
    - name: appContainer1 
      image: gcr.io/mybucket/appContainerImage1 
      ports:
        - containerPort: 8080
    - name: appContainer2
      image: b.gcr.io/mybucket/appContainerImage2
      ports:
        - containerPort: 9090
</code></pre>

<p>In docker, I can pass the command line arguments via environment variable(-e)</p>

<pre><code>docker run --rm -it -p 9090:9090 -e spring.profiles.dynamic=local applicationimage1
</code></pre>

<p>Similarly, I need to pass command line arguments when the containers run inside kubernetes. </p>

<p>It sounds like you don't actually want command line arguments, but environment variables - and you can use <code>env</code> for that:</p>

<pre><code>- name: appContainer1 
  image: gcr.io/mybucket/appContainerImage1 
  ports:
    - containerPort: 8080
  env:
    - name: spring.profiles.dynamic
      value: local
</code></pre>

<p>You <em>can</em> use command line arguments:</p>

<pre><code>- name: appContainer1 
  image: gcr.io/mybucket/appContainerImage1 
  ports:
    - containerPort: 8080
  args:
    - foo
    - bar
    - "String containing:colons:"
</code></pre>
