Local Up OpenYurt

    Then you can use to interact with your OpenYurt cluster.

    In summary, the local_up_openyurt.sh will use the local files under the openyurt work path to set up the cluster. And you can specify the behavior of the shell through setting environment variables.

    First, it will set up a docker container to build required binaries and images. The Arch and OS platform of built binaries and images is the same as your local host. For instance, if your local host is linux/amd64, then only binaries for linux/amd64 will be built. Built binaries and images will be saved under _output directory.

    Note:

    1. NODES_NUM should not be less than 2. Finally, the cluster will contains one control-plane node and NODES_NUM-1 woker nodes. The default NODES_NUM is 2.

    Third, yurtctl will be used to convert the Kubernetes cluster into OpenYurt cluter. It will use images built earlier to deploy OpenYurt components, including yurthub, yurt-controller-manager, yurt-tunnel-server and yurt-tunnel-agent. You can disable through export YURTTUNNEL=disable.

    By now, you’ve got the OpenYurt cluster at your local host and you can interact with it using kubectl. kind will automatically stored the kubeconfig at your KUBECONFIG path (default path is ${HOME}/.kube/config). If you already have the KUBECONFIG to interact with other clusters, kind will add a new context of openyurt cluster into the KUBECONFIG and automatically switch to it. You can manually switch back to the previous context using command kubectl config use-context ${PREVIOUS_CONTEXT_NAME}. For more details, you can see the documentation. You can store the kubeconfig at another path through setting .

    Reference gives descriptions of all used environment variables.

    KIND_KUBECONFIG
    KIND_KUBECONFIG represents the path to store the kubeconfig file of the cluster which is created by this shell. The default value is “$HOME/.kube/config”.

    NODES_NUM
    NODES_NUM represents the number of nodes to set up in the new-created cluster. There are one control-plane node and NODES_NUM-1 worker nodes. Thus, NODES_NUM must not be less than 2. The default value is 2.

    KUBERNETESVERSION
    KUBERNETESVERSION declares the kubernetes version the cluster will use. The format is “1.XX”. Now only 1.18, 1.19 and 1.20 are supported. The default value is 1.20.

    TIMEOUT
    TIMEOUT represents the time to wait for the kind control-plane, yurt-tunnel-server and yurt-tunnel-agent to be ready. If they are not ready after the duration, the shell will exit. The default value is 120s.