Version: v1.8

Crossplane

The guide Deploy Cloud Services shows how to provision cloud resources by Terraform in CLI and VelaUX. This tutorial will talk about how to provision Cloud Resources by Crossplane.

Let’s take cloud provider AWS as an example.

  1. vela addon enable crossplane-aws

Apply the application below. You can get AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY per https://aws.amazon.com/blogs/security/wheres-my-secret-access-key/.

  1. apiVersion: core.oam.dev/v1beta1
  2. kind: Application
  3. metadata:
  4. name: aws
  5. namespace: vela-system
  6. spec:
  7. components:
  8. - name: aws
  9. type: crossplane-aws
  10. properties:
  11. name: aws
  12. AWS_ACCESS_KEY_ID: xxx
  13. AWS_SECRET_ACCESS_KEY: yyy

Let’s provision a S3 bucket. Please apply the application below.

  1. apiVersion: core.oam.dev/v1beta1
  2. kind: Application
  3. metadata:
  4. name: s3-poc
  5. spec:
  6. components:
  7. - name: dev
  8. type: crossplane-aws-s3
  9. properties:
  10. name: kubevela-test-0714
  11. acl: private
  12. locationConstraint: us-east-1

After the application gets running, you can check the bucket by AWS cli or console.

  1. $ vela ls
  2. APP COMPONENT TYPE TRAITS PHASE HEALTHY STATUS CREATED-TIME
  3. s3-poc dev crossplane-aws-s3 running healthy 2022-06-16 15:37:15 +0800 CST
  4. $ aws s3 ls
  5. 2022-06-16 15:37:17 kubevela-test-0714

All Crossplane cloud resources are defined as ComponentDefinitions and are about to be delivered in Crossplane provider addons, like crossplane-aws. If your requirements are not met by the addons, you can define your own component type per the instructions on how to define customized component.

Last updated on May 6, 2023 by Tianxin Dong