Manually Setup

This tutorial shows how to setup OpenYurt control plane components manually. We assume you already have a Kubernetes control plane setup properly.

1. Precondition

Make sure you already have a Kubernetes control plane with at least one node. We recommend to create your Kubernetes cluster with kubeadm tool.

  1. $ kubectl get nodes
  2. NAME STATUS ROLES AGE VERSION
  3. izwz9dohcv74iegqecp4axz Ready control-plane,master 6d1h v1.22.11

2. Prerequisites for installing the OpenYurt control plane

  • The IP addresses of all nodes in the cluster must be different if Raven enables node forwarding
  • You must make the following adjustments if using docker as container runtime, which is mainly to avoid docker modifying the iptables forward chain and damaged the node forward.

    1. iptables -w -P FORWARD ACCEPT
    2. sed -i 's#^After=network-online.target firewalld.service$#After=network-online.target firewalld.service containerd.service#g' \
    3. /lib/systemd/system/docker.service
  • Domain Name resolution from pods on edge nodes will be handled by CoreDNS instance on master node or cloud node through VPN tunnel that provided by Raven, so some resolution latency or timeout will be caused by network. we recommend you to adjust CoreDNS Deployment according to CoreDNS Adjustment tutorial if you care about latency or timeout.

  • We recommend installing OpenYurt components via Helm, please make sure helm CLI is installed properly before proceeding.

3. Install OpenYurt control plane components

All the helm charts used in this tutorial can be found in openyurt-helm repo.please add the repo as follows:

  1. helm repo add openyurt https://openyurtio.github.io/openyurt-helm

You can then run helm search repo openyurt to see the charts.

3.1 Install yurt-manager

yurt-manager should be started before joining the node via the yurtadm command, because the yurthub component on the node depends on yurt-manager to approve csr. So please ensure that the yurt-manager component is running on the master node or any other node that does not have a yurthub component.

  1. helm upgrade --install yurt-manager -n kube-system openyurt/yurt-manager

Ensure that the pod and service configurations of the yurt-manager component have been created successfully:

  1. kubectl get pod -n kube-system | grep yurt-manager
  2. kubectl get svc -n kube-system | grep yurt-manager

3.2 Install yurthub artifacts

The yurthub artifacts include the yurtstaticset template, as well as the yurthub-related configmap. When installing the yurthub artifacts, we need to set the kubernetesServerAddr field to the Kubernetes server address(use kubectl config view to find). Take the Kubernetes server address of https://1.2.3.4:6443 as an example.

  1. helm upgrade --install yurt-hub -n kube-system --set kubernetesServerAddr=https://1.2.3.4:6443 openyurt/yurthub

Ensure yurthub yurtstaticset and yurthub cloud yurtstaticset have been created successfully:

  1. kubectl get yss -n kube-system

3.3 Install raven component

Raven provides network communication capabilities when the cloud and the edge are in different network areas, which include two components raven-controller-manager and raven-agent.

  1. helm upgrade --install raven-agent -n kube-system openyurt/raven-agent

Ensure that the pod of the raven agent component have been created successfully:

  1. kubectl get pod -n kube-system | grep raven-agent

4. Attention

The above operation is only for the Master node, if there are other nodes in the cluster, additional adjustment is needed, the operation method can be referred to Install OpenYurt Node on Existing K8s Nodes.