Breadcrumbs

K3S Single-Node Installation ( Without HA )

Purpose

The purpose of this document is to describe the additional system requirements and steps to deploy the Single-Node K3s Kubernetes Distribution.

Pre-requisites for Single-Node Installation

The prerequisites and pre-deployment phases are describe in the K3s Pre-Deployment & Installation Guide. Please complete the steps before proceeding with Single-Node Installation.



Quick Links



    Installation Steps

    The installation steps are as follows:

    Environment Customization Steps


    Click here to see customization steps.....

    Below given options can also be used for customized environment setup:

    Option

    Switch

    Default

    Description

    Default Deployment Directory of K3s

    --data-dir value, -d value

    /var/lib/rancher/k3s or ${HOME}/.rancher/k3s if not root

    Folder to hold state

    Default POD IP Assignment Range

    --cluster-cidr value

    "10.42.0.0/16"

    IPv4/IPv6 network CIDRs to use for pod IPs

    Default Service IP Assignment Range

    --service-cidr value

    "10.43.0.0/16"

    IPv4/IPv6 network CIDRs to use for service IPs

    Default local storage path for local provisioner storage class( only if you are using local-provisioner )

    --default-local-storage-path value

    /var/lib/rancher/k3s/data

    default local-provisioner data path. suitable only for local-provisioner volumes

    If any of the above option is required, add it in the next step.

    cluster-cidr and service-cidr are independently evaluated. Decide wisely well before the the cluster deployment. This option is not configurable once the cluster is deployed and workload is running.




    Step 1: Download the K3s binaries and start Installation

    Step 2: Run the below command on the master node

    Bash
    curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.24.7+k3s1 INSTALL_K3S_EXEC="--disable=traefik" sh - 
    

    K3s will be installed on the master node.

    Step 3: Bash Completion for kubectl

    1. Install bash-completion package

    Bash
    yum install bash-completion -y
    

    2. Set up the autocomplete in Bash into the current shell; bash-completion package should be installed first.

    Bash
    source <(kubectl completion bash) 
    echo "source <(kubectl completion bash)" >> ~/.bashrc 
    

    3. Also, add the alias for the short notation of kubectl

    Bash
    echo "alias k=kubectl"  >> ~/.bashrc 
    echo "complete -o default -F __start_kubectl k"  >> ~/.bashrc 
    

    4. and source your ~/.bashrc  

    Bash
    source ~/.bashrc
    

    Step 4: Install helm

    1. Add this command in ~/.bashrc file.

    Bash
    echo "export KUBECONFIG=/etc/rancher/k3s/k3s.yaml" >> ~/.bashrc
    

    2. run this in the command prompt.

    Bash
    source ~/.bashrc
    

    3. Helm is a super tool to deploy external components. to install helm on cluster execute 

    Bash
    curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 && sudo bash get_helm.sh
    


    Step 5: Clone the CIM Repo

    Bash
    git clone -b <branch-name> https://efcx:RecRpsuH34yqp56YRFUb@gitlab.expertflow.com/cim/cim-solution.git
    
    

    Replace the branch name with actual release.

    Step 6: Install Traefik

    Since we have disabled Traefik on installation, we need to install it now.

    1. Change the directory to helm charts

    Bash
    cd cim-solution/kubernetes
    

    2. Install the Traefik Helm Chart.

    Bash
    helm upgrade --install=true --namespace=traefik-ingress --wait=true  --timeout=15m0s --create-namespace --values=external/traefik/values.yaml traefik  external/traefik --debug
    


    Step 7: CIM Deployment on Kubernetes

    Please follow the steps in the document, Expertflow CX Deployment on Kubernetes to deploy Expertflow CX Solution.