k8s_minikube - henk52/knowledgesharing GitHub Wiki

MiniCube

Introduction

References

  • Mastering Kubernetes 3rd ed, 2020, Cigi Sayfan,
  • Hec18 - Kubernetes for developers by Joseph Heck
  • minikube documentation

Overview

minikube is a single-node cluster.

Operations

  • minikube dashboard
  • minikube delete
  • minikube delete --all --purge
  • minikube start
  • minikube status
  • minikube stop
  • minikube service
    • minikube service flask --url
      • Show the full path to accessing a service that has been speced using 'nodePort'(Hec18,p80)
  • minikube service list

Installation

See: Minikube start

Fresh installation

  1. cd ~/Downloads
  2. curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
  3. sudo install minikube-linux-amd64 /usr/local/bin/minikube
  4. minikube start
  5. minikube addons enable ingress
  6. minikube addons enable dashboard

Update

See: how-to-update-minikube-latest-version

See: Set-up haproxy and minikube with passthrough in UnixGeneralTools.md

Using minikube

deploying a local container

See:

  1. minikube start
  2. minikube dashboard
  3. eval $(minikube -p minikube docker-env)
  4. cd ~/training/k8s/medium-rust-dockerize
  5. docker build -t rust-web-alpine .
  6. docker images
  7. minikube image ls --format table
  8. kubectl run rust-web-alpine --image=rust-web-alpine:latest --port=3030 --save-config --image-pull-policy=Never
  9. kubectl get pods --namespace=default

Troubleshooting

Please run minikube logs --file=logs.txt and attach logs.txt to the GitHub issue.

Minkube installation

The recommended driver is "systemd"

 stderr:
   [WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/

kubelet service is not enabled, please run 'systemctl enable kubelet.service'

Just run it

  [WARNING Service-Kubelet]: kubelet service is not enabled, please run 'systemctl enable kubelet.service'

failed to load certificate: the certificate has expired

  1. minikube delete
  2. minikube start
error execution phase certs/apiserver-kubelet-client: failed to write or validate certificate "apiserver-kubelet-client": failure loading apiserver-kubelet-client certificate: failed to load certificate: the certificate has expired