github.com/oam-dev/kubevela@v1.9.11/references/docgen/def-doc/trait/env.eg.md (about)

     1  ```yaml
     2  apiVersion: core.oam.dev/v1beta1
     3  kind: Application
     4  metadata:
     5    name: busybox
     6  spec:
     7    components:
     8      - name: busybox
     9        type: webservice
    10        properties:
    11          image: busybox
    12          cmd: ["sleep", "86400"]
    13        traits:
    14          - type: sidecar
    15            properties:
    16              name: sidecar-nginx
    17              image: nginx
    18          - type: env
    19            properties:
    20              # you can use env to control multiple containers by filling `containers`
    21              # NOTE: in containers, you must set the container name for each container
    22              containers:
    23                - containerName: busybox
    24                  env:
    25                    key_for_busybox_first: value_first
    26                    key_for_busybox_second: value_second
    27                - containerName: sidecar-nginx
    28                  env:
    29                    key_for_nginx_first: value_first
    30                    key_for_nginx_second: value_second
    31  ```
    32  
    33  ```yaml
    34  apiVersion: core.oam.dev/v1beta1
    35  kind: Application
    36  metadata:
    37    name: busybox
    38  spec:
    39    components:
    40      - name: busybox
    41        type: webservice
    42        properties:
    43          image: busybox
    44          cmd: ["sleep", "86400"]
    45        traits:
    46          - type: sidecar
    47            properties:
    48              name: sidecar-nginx
    49              image: nginx
    50          - type: env
    51            properties:
    52              # you can use env to control one container, if containerName not specified, it will patch on the first index container 
    53              containerName: busybox
    54              env:
    55                key_for_busybox_first: value_first
    56                key_for_busybox_second: value_second
    57  ```