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

     1  ```yaml
     2  # sample.yaml
     3  apiVersion: core.oam.dev/v1beta1
     4  kind: Application
     5  metadata:
     6    name: storage-app
     7  spec:
     8    components:
     9      - name: express-server
    10        type: webservice
    11        properties:
    12          image: oamdev/hello-world
    13          ports:
    14            - port: 8000
    15        traits:
    16          - type: storage
    17            properties:
    18              # PVC type storage
    19              pvc:
    20                - name: test1
    21                  mountPath: /test/mount/pvc
    22              # EmptyDir type storage
    23              emptyDir:
    24                - name: test1
    25                  mountPath: /test/mount/emptydir
    26              # ConfigMap type storage
    27              configMap:
    28                - name: test1
    29                  mountPath: /test/mount/cm
    30                  # Mount ConfigMap to Env
    31                  mountToEnv:
    32                    envName: TEST_ENV
    33                    configMapKey: key1
    34                  data:
    35                    key1: value1
    36                    key2: value2
    37              # Secret type storage
    38              secret:
    39                - name: test1
    40                  mountPath: /test/mount/secret
    41                  # Mount Secret to Env
    42                  mountToEnv:
    43                    envName: TEST_SECRET
    44                    secretKey: key1
    45                  data:
    46                    key1: dmFsdWUx
    47                    key2: dmFsdWUy
    48  ```