oneke_quick - OpenNebula/one-apps GitHub Wiki

Quick Start

In this section we will focus on quickly deploying OneKE using CLI commands. If you wish to install OneKE using the Sunstone web UI, please refer to the Running Kubernetes Clusters guide, which provides step-by-step instructions including screenshots.

OneKE Network Diagram

[!NOTE] In its simplest configuration, OneKE does not require any VIP definitions.

Public Network
─────────────────────────────┬────────────────────────────────────
                             β”‚ PUBLIC_IP (3.27.6.5) (ep0.eth0.vr)
                     β”Œ ─ ─ ─ β”Ό ─ ─ ─ ┐
                     β”‚  OneKE vnf    β”‚
                     β”‚       β”‚       β”‚
                     β”‚  β”Œβ”€β”€eth0──┐   β”‚
                     β”‚  β”‚        β”‚   β”‚
                     β”‚  β”‚  VM-1  β”‚   β”‚
                     β”‚  β”‚        β”‚   β”‚
                     β”‚  └──eth1β”€β”€β”˜   β”‚
                     β”‚       β”‚       β”‚
                     β”‚    10.0.0.1   β”‚
                     β”‚ (ep0.eth1.vr) β”‚
                     β”‚       β”‚       β”‚
                     β”” ─ ─ ─ β”Ό ─ ─ ─ β”˜
                             β”‚
─────────┬───────────────────┼───────────────────┬────────────────
Private Network              β”‚                   β”‚
         β”‚                   β”‚                   β”‚
 β”Œ ─ ─ ─ β”Ό ─ ─ ─ ─┐  β”Œ ─ ─ ─ β”Ό ─ ─ ─ ─┐  β”Œ ─ ─ ─ β”Ό ─ ─ ─ ─┐
 β”‚  OneKE master  β”‚  β”‚  OneKE worker  β”‚  β”‚ OneKE storage  β”‚
 β”‚       β”‚        β”‚  β”‚       β”‚        β”‚  β”‚       β”‚        β”‚
 β”‚    10.0.0.2    β”‚  β”‚    10.0.0.3    β”‚  β”‚    10.0.0.4    β”‚
 β”‚       β”‚        β”‚  β”‚       β”‚        β”‚  β”‚       β”‚        β”‚
 β”‚   β”Œβ”€β”€eth0──┐   β”‚  β”‚   β”Œβ”€β”€eth0──┐   β”‚  β”‚   β”Œβ”€β”€eth0──┐   β”‚
 β”‚   β”‚        β”‚   β”‚  β”‚   β”‚        β”‚   β”‚  β”‚   β”‚        β”‚   β”‚
 β”‚   β”‚  VM-2  β”‚   β”‚  β”‚   β”‚  VM-3  β”‚   β”‚  β”‚   β”‚  VM-4  β”‚   β”‚
 β”‚   β”‚        β”‚   β”‚  β”‚   β”‚        β”‚   β”‚  β”‚   β”‚        β”‚   β”‚
 β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚  β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚  β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
 β”” ─ ─ ─ ─ ─ ─ ─ β”€β”˜  β”” ─ ─ ─ ─ ─ ─ ─ β”€β”˜  β”” ─ ─ ─ ─ ─ ─ ─ β”€β”˜

Downloading and Deploying OneKE

  1. Download the Service OneKE 1.29 from the OpenNebula Marketplace:

    $ onemarketapp export 'Service OneKE 1.29' 'Service OneKE 1.29' --datastore 1
    IMAGE
        ID: 202
        ID: 203
        ID: 204
    VMTEMPLATE
        ID: 204
        ID: 205
        ID: 206
    SERVICE_TEMPLATE
        ID: 104
    

[!NOTE] IDs are automatically assigned and their actual values will depend on the state of the OpenNebula cluster at hand.

[!IMPORTANT] You can also use Service OneKE 1.29 Airgapped, the airgapped version that includes all the Docker images required for initial deployment, without the Internet connection.

  1. (Optional.) Adjust Flow and VM templates to your needs. (You may want to increase CPU and MEMORY for workers, add HOT_RESIZE=[...] or set up anti-affined VM groups, etc...)

    $ oneflow-template update 104
    
    $ onetemplate update 205
    

[!WARNING] The HOT_RESIZE=[...] vector cannot be added to a running VM; it can only be pre-configured in the VM template.

  1. Configure networks and components for the OneKE service. You need to select the OpenNebula public and private networks that the OneKE service will use (in the example below, VNETs 0 and 1; adjust for your installation). Additionally, select the components you want to enable for your K8s cluster.

    $ cat >/tmp/OneKE-instantiate <<'EOF'
    {
        "name": "OneKE/1",
        "networks_values": [
            {"Public": {"id": "0"}},
            {"Private": {"id": "1"}}
        ],
        "custom_attrs_values": {
            "ONEAPP_VROUTER_ETH0_VIP0": "",
            "ONEAPP_VROUTER_ETH1_VIP0": "",
    
            "ONEAPP_RKE2_SUPERVISOR_EP": "ep0.eth0.vr:9345",
            "ONEAPP_K8S_CONTROL_PLANE_EP": "ep0.eth0.vr:6443",
            "ONEAPP_K8S_EXTRA_SANS": "localhost,127.0.0.1,ep0.eth0.vr,${vnf.TEMPLATE.CONTEXT.ETH0_IP},k8s.yourdomain.it",
    
            "ONEAPP_K8S_MULTUS_ENABLED": "NO",
            "ONEAPP_K8S_MULTUS_CONFIG": "",
            "ONEAPP_K8S_CNI_PLUGIN": "cilium",
            "ONEAPP_K8S_CNI_CONFIG": "",
            "ONEAPP_K8S_CILIUM_RANGE": "",
    
            "ONEAPP_K8S_METALLB_ENABLED": "NO",
            "ONEAPP_K8S_METALLB_CONFIG": "",
            "ONEAPP_K8S_METALLB_RANGE": "",
    
            "ONEAPP_K8S_LONGHORN_ENABLED": "YES",
            "ONEAPP_STORAGE_DEVICE": "/dev/vdb",
            "ONEAPP_STORAGE_FILESYSTEM": "xfs",
    
            "ONEAPP_K8S_TRAEFIK_ENABLED": "YES",
            "ONEAPP_VNF_HAPROXY_INTERFACES": "eth0",
            "ONEAPP_VNF_HAPROXY_REFRESH_RATE": "30",
            "ONEAPP_VNF_HAPROXY_LB0_PORT": "9345",
            "ONEAPP_VNF_HAPROXY_LB1_PORT": "6443",
            "ONEAPP_VNF_HAPROXY_LB2_PORT": "443",
            "ONEAPP_VNF_HAPROXY_LB3_PORT": "80",
    
            "ONEAPP_VNF_DNS_ENABLED": "YES",
            "ONEAPP_VNF_DNS_INTERFACES": "eth1",
            "ONEAPP_VNF_DNS_NAMESERVERS": "1.1.1.1,8.8.8.8",
            "ONEAPP_VNF_NAT4_ENABLED": "YES",
            "ONEAPP_VNF_NAT4_INTERFACES_OUT": "eth0",
            "ONEAPP_VNF_ROUTER4_ENABLED": "YES",
            "ONEAPP_VNF_ROUTER4_INTERFACES": "eth0,eth1"
        }
    }
    EOF
    
  2. Instantiate the Flow service.

    $ oneflow-template instantiate 'Service OneKE 1.29' /tmp/OneKE-instantiate
    ID: 105
    

    After successful deployment, the Flow service should be appear in the RUNNING state:

    $ oneflow list
      ID USER     GROUP    NAME                           STARTTIME STAT
     105 oneadmin oneadmin Service OneKE 1.29        05/13 12:34:56 RUNNING
    

    All VMs also display the RUNNING state:

    $ onevm list -f NAME~'service_105' -l NAME,STAT
    NAME                    ... STAT
    storage_0_(service_105) ... runn
    worker_0_(service_105)  ... runn
    master_0_(service_105)  ... runn
    vnf_0_(service_105)     ... runn
    

Accessing the Cluster

Please refer to the dedicated sections in Operating OneKE.