Working with OCM

    This section will introduce how to use OCM with KubeVela.

    The installation of OCM is directly available through . There are two addons you need to install if you want to use KubeVela with OCM.

    This addon allows you to use the basic capabilities provided by OCM. For example, you can create OCM ManifestWorks to dispatch resources directly. But KubeVela will not use OCM for its application management for now.

    1. vela addon enable ocm-gateway-manager-addon

    You can use vela cluster join -t ocm command to join cluster through OCM ManagedCluster. Notice that, compared to normal vela cluster join, joining OCM ManagedCluster does not need your managed cluster APIServer to be accessible from the hub control plane. But you need to make sure your managed cluster could access the KAS (kube-apiserver) of the hub control plane.

    After that, you need to wait for some time (usually several minutes) for all the related OCM agents to be ready.

    1. # Change ocm-cluster to your cluster name.
    2. $ kubectl get managedclusteraddons -n ocm-cluster
    3. NAME AVAILABLE DEGRADED PROGRESSING
    4. cluster-proxy True
    5. managed-serviceaccount True
    6. cluster-gateway True

    Perfect! You can now use the joined OCM managed cluster in KubeVela just as a normal cluster.

    1. $ cat <<EOF | vela up -f -
    2. apiVersion: core.oam.dev/v1beta1
    3. metadata:
    4. name: example-app
    5. namespace: default
    6. spec:
    7. components:
    8. - name: hello-world
    9. image: crccheck/hello-world
    10. type: webservice
    11. - name: ocm-cluster
    12. properties:
    13. clusters: ["ocm-cluster"]
    14. type: topology
    15. EOF

    For more information about using KubeVela with OCM, you could refer to the following materials.

    Last updated on Feb 9, 2023 by dependabot[bot]