Version: v1.0

Cloud Volumes

This section introduces how to attach cloud volumes to the component. For example, AWS ElasticBlockStore, Azure Disk, Alibaba Cloud OSS, etc.

Cloud volumes are not built-in capabilities in KubeVela so you need to enable these traits first. Let’s use AWS EBS as example.

Install and check the TraitDefinition for AWS EBS volume trait.

  1. $ kubectl apply -f https://raw.githubusercontent.com/oam-dev/kubevela/master/docs/examples/app-with-volumes/td-awsEBS.yaml
  1. $ kubectl vela show aws-ebs-volume
  2. +-----------+----------------------------------------------------------------+--------+----------+---------+
  3. | NAME | DESCRIPTION | TYPE | REQUIRED | DEFAULT |
  4. +-----------+----------------------------------------------------------------+--------+----------+---------+
  5. | name | The name of volume. | string | true | |
  6. | mountPath | | string | true | |
  7. | volumeID | Unique id of the persistent disk resource. | string | true | |
  8. | fsType | Filesystem type to mount. | string | true | ext4 |
  9. | partition | Partition on the disk to mount. | int | false | |
  10. | readOnly | ReadOnly here will force the ReadOnly setting in VolumeMounts. | bool | true | false |
  11. +-----------+----------------------------------------------------------------+--------+----------+---------+

Then we can now attach a aws-ebs volume to a component.

  1. apiVersion: core.oam.dev/v1beta1
  2. kind: Application
  3. metadata:
  4. name: app-worker
  5. spec:
  6. components:
  7. - name: myworker
  8. type: worker
  9. properties:
  10. image: "busybox"
  11. cmd:
  12. - sleep
  13. - "1000"
  14. traits:
  15. - type: aws-ebs-volume
  16. properties:
  17. name: "my-ebs"
  18. mountPath: "/myebs"
  19. volumeID: "my-ebs-id"