Skip to content

Manage multicloud custom resources

Follow the steps below to create a multicloud custom resource (CRD).

  1. In the left navigation bar, click multicloud Custom Resources to enter the custom resource page, and click the YAML Create button in the upper right corner.

  2. On the YAML Creation page, fill in the YAML statement and click OK. Download and import features are also supported.

  3. Return to the custom resource list page, and you can view the custom resource named crontabs.stable.example.com just created.

  4. Click the name to enter the custom resource details page, where you can edit the YAML information to update the custom resource.

Custom resource example:

CRD example

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: crontabs.stable.example.com
spec:
  group: stable.example.com
  versions:
    - name: v1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          properties:
            spec:
              type: object
              properties:
                cronSpec:
                  type: string
                image:
                  type: string
                replicas:
                  type: integer
  scope: Namespaced
  names:
    plural: crontabs
    singular: crontab
    kind: CronTab
    shortNames:
    - ct

Create CR instance via YAML

  1. Enter the custom resource details, click the YAML Create button on the right side of the CR list.

  2. On the YAML Creation page, first fill in the YAML information of the CR, which supports download and import features.

  3. Fill in the deployment strategy again to specify which clusters you want to distribute to. Note that the YAML information of the deployment strategy needs to be filled in according to the information of the resources to be propagated: The four parameters apiVersion, kind, namespace, and name in resourceSelector of spec need to be consistent with the resources to be propagated. If there is no differentiation requirement, the differentiation strategy can be left blank.

  4. Return to the CR instance list page, and you can view the newly created CR instance named my-new-cron-obiext.

CR Example:

CR example

apiVersion: "stable.example.com/v1"
kind: CronTab
metadata:
  name: my-new-cron-object
spec:
  cronSpec: "* * * * */5"
  image: my-awesome-cron-image

Comments