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.
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.
# Change ocm-cluster to your cluster name.
$ kubectl get managedclusteraddons -n ocm-cluster
NAME AVAILABLE DEGRADED PROGRESSING
cluster-proxy True
cluster-gateway True
Now you can validate everything is ready through .
$ cat <<EOF | vela up -f -
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: example-app
namespace: default
spec:
components:
- name: hello-world
image: crccheck/hello-world
type: webservice
policies:
- name: ocm-cluster
properties:
clusters: ["ocm-cluster"]
type: topology
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.