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.

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

    Enabling the second addon will allow you to let KubeVela use the underlying OCM managed clusters through cluster gateway.

    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.

    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. cluster-gateway True

    Now you can validate everything is ready through .

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

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

    • The OCM project.
    • ocm-hub-control-plane The KubeVela addon of ocm-hub-control-plane.
    • . The demo of KubeVela working with OCM.