github.com/oam-dev/kubevela@v1.9.11/docs/examples/app-with-volumes/td-awsEBS.yaml (about)

     1  apiVersion: core.oam.dev/v1beta1
     2  kind: TraitDefinition
     3  metadata:
     4    name: aws-ebs-volume
     5    namespace: vela-system
     6  spec:
     7    appliesToWorkloads:
     8      - deployments.apps
     9    schematic:
    10      cue:
    11        template: |
    12          patch: {
    13            spec: template: spec: {
    14              // +patchKey=name
    15              containers: [ for c in context.output.spec.template.spec.containers {
    16                {
    17                  name: c.name
    18                  // +patchKey=name
    19                  volumeMounts: [{
    20                    name:      parameter.name
    21                    mountPath: parameter.mountPath
    22                  }]
    23                }
    24              }]
    25  
    26              // +patchKey=name
    27              volumes: [{
    28                name: parameter.name
    29                awsElasticBlockStore: {
    30                  volumeID: parameter.volumeID
    31                  fsType:   parameter.fsType
    32                  if parameter.partition != _|_ {
    33                    partition: parameter.partition
    34                  }
    35                  readOnly: parameter.readOnly
    36                }
    37              }, ...]
    38            }
    39          }
    40  
    41          parameter: {
    42            // +usage=The name of volume.
    43            name:      string
    44            mountPath: string
    45            // +usage=Unique id of the persistent disk resource.
    46            volumeID: string
    47            // +usage=Filesystem type to mount.
    48            fsType: *"ext4" | string
    49            // +usage=Partition on the disk to mount.
    50            partition?: int
    51            // +usage=ReadOnly here will force the ReadOnly setting in VolumeMounts.
    52            readOnly: *false | bool
    53          }