Skip to content

kengz/k0s-cluster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

K0s cluster

Private Kubernetes cluster setup on a home lab using k0sctl and Helm charts.

Installation

First install the prerequisites:

# install kubectl, helm
brew install kubectl helm
# install k0sctl for cluster setup
brew install k0sproject/tap/k0sctl

Usage

Setup K8s Cluster

See detailed blog post Setup a private Kubernetes cluster with k0sctl

Inspect/configure ./cluster/k0sctl.yaml and run:

k0sctl apply --config cluster/k0sctl.yaml
# save kubeconfig
k0sctl kubeconfig --config cluster/k0sctl.yaml > ~/.kube/config && chmod go-r ~/.kube/config
k get nodes
# make openebs-hostpath the default storage class
kubectl patch storageclass openebs-hostpath -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'

To reset:

k0sctl reset --config cluster/k0sctl.yaml

It's common to encounter host key mismatch: knownhosts: key mismatch error. In that case, remove the host entries in ~/.ssh/known_hosts and retry.

Install Cluster Addons

See detailed blog post Setting up Kubernetes Addons.

Install the cluster components with Helm:

bash ./cluster/cluster-addons.sh

Additionally, install Lens for GUI monitoring and access to the cluster. Get a free license to use.

Accessing Dashboards

See more on blog post Setting up Kubernetes Addons.

Troubleshoot

  • delete pod stuck in terminating state:
    kubectl delete pod --grace-period=0 --force <PODNAME>
  • decode secret:
    kubectl get secret <SECRETNAME> -n <NAMESPACE> -o jsonpath="{.data.admin-password}" | base64 --decode ; echo

About

Private Kubernetes cluster setup on a home lab using k0sctl and Helm charts.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages