How to pass command line arguments in kubernetes?

后端 未结 1 1399
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-07 18:03

Need to pass command line arguments for the docker containers appContainer1 & appContainer2 in the pod.yaml.

pod.yaml

apiVersion: v1
kind: Pod
metada         


        
相关标签:
1条回答
  • 2021-02-07 18:39

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

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

    You can use command line arguments:

    - name: appContainer1 
      image: gcr.io/mybucket/appContainerImage1 
      ports:
        - containerPort: 8080
      args:
        - foo
        - bar
        - "String containing:colons:"
    
    0 讨论(0)
提交回复
热议问题