ASE-K3s

Last modified by Christian Reiber on 2021/09/24 19:25

 

Purpose

This software stack provides K3S, a fully compliant production-grade Kubernetes (K8S) Application Server (ASE). K3S is NOT intended for true server clustering, but to have Kubernetes functionality available with a minimum of required resources. This stack actually runs a single Kubernetes control plane (server, aka node0), three Kubernetes worker nodes (aka node[012]), a reverse proxy (aka proxy) and an NFS server (aka storage) -- each in their own Docker container.As Kubernetes system base functionality the CoreDNS name resolution service, the Traefik ingress controller, the Maesh Service Mesh Interface (SMI), the NFS Container Storage Interface (CSI) provisioner, and both the Kubernetes Dashboard (runs inside cluster) and Kubernator (runs outside cluster) user interfaces are provided out-of-the-box.

Properties

 Stack-Description  K3S Kubernetes Application Server (ASE)    
 Stack-Image        docker.msg.team/ps/docker-stack-ase-k3s   
 Stack-Version      1.23.6 
 Stack-Release      20220609 
 Product-Name  K3S 
 Product-Vendor  Rancher Labs, Inc. 
 Product-Contact  https://k3s.io/ 
 Product-Model  Open Source 
 Product-License  Apache 
 Product-Limits  none 
Implementation Base  GO
Execution Base       Apache WebServer 
Initial Start Time   00:00:15
Documentation       https://rancher.com/docs/k3s/latest/en/

Topology

The stack consists of 6 containers:

  • ase-k3s-node 1...3:  there are 3 node container running
  • ase-k3s-proxy: you have a proxy service running in one container
  • ase-k3s-server: the server is running in one container
  • ase-k3s-storage: you have a storage container

Configuration

Variable Name       Default Meaning  

First Steps

Install k3s

docker-stack configure params ase-k3s \
    K3S_CLUSTER_SECRET=$(apg -n1 -a0 -m32 -x32 -MCL) \
    K3S_PASSWD_ADMIN=$(apg -n1 -a0 -m32 -x32 -MCL) \
    K3S_PASSWD_SYSTEM=$(apg -n1 -a0 -m32 -x32 -MCL)
docker-stack install ase-k3s

Install k8s-util

git clone https://github.com/rse/k8s-util
( cd k8s-util && make install )

Cleanup (ignore errors)

rm -rf /.k8s-util.d
source <(k8s-util env)

Create new environment and download local clients

k8s-util setup

Create dummy empty kube config and configure to connect local cluster

k8s-util kubeconfig | k8s-util configure-k8s default -
kubectl --kubeconfig=$HOME/.k8s-util.d/etc/k8s/default config set-cluster local --server=https://localhost:6443 --insecure-skip-tls-verify

Retrieve bootstrap config from the local cluster with local admin user

docker-stack exec ase-k3s kubeconfig admin admin | k8s-util configure-k8s admin -

Overwrite URL with cluster connect URL

kubectl --kubeconfig=$HOME/.k8s-util.d/etc/k8s/admin config set-cluster local --server=https://localhost:6443 --insecure-skip-tls-verify

Activate admin environment

source <(k8s-util env)
kubensx use -f -n default
kubensx use -f -c local

Verify access

kubectl version

Create an own admin user managed by kubernetes

k8s-util cluster-admin kube-system root create

Switch to the created admin user

k8s-util kubeconfig kube-system root root | k8s-util configure-k8s root -
source <(k8s-util env)
kubensx use -f -u root

Verify access

kubectl version

Administration Commands

Command Arguments Function  
docker-stack exec ase-k3s kubeconfig  
docker-stack exec ase-k3s k3s-passwd  

Related Documents

 

Tags:
Created by Robert Pele on 2021/02/01 07:10

Navigation