Skip to content

My kubernetes setup for an on the go developer experience

Notifications You must be signed in to change notification settings

yohanswanepoel/kube_dev_setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Captures local Kube setup for Development

The idea is to create a quick repeatable setup that will possibly be automated.

Base Requirements

  • Local storage
  • Internal registry
  • Ingress
  • Use kube as container build environment (Podman)
  • Local DNS resolution

Development Requirements

  • Auto refresh inner loop
  • Fast start templates
  • Knative - optional
  • FaaS - optional
  • Pipelines - optional
  • Operators - optional
  • Service Mesh - optional

Requirements and useful tools

  • kubectl
  • kubectx - switch context between kubernetes instances
  • kubens - easily manage namespaces
  • watch
  • tldr
  • jq

Initial Setup

Install

Installation instructions: https://minikube.sigs.k8s.io/docs/start/

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube

Initial Config

This depends on your system capabilities.

  • Driver leave as default
  • Version leave as default (latest)
  • CPU: 4
  • Memory: 20 GB
  • Disk Size: 50GB
  • Container runtime: cri-o

See how many cores you have available

# Linux
lscpu | grep CPU(s)

Set CPUs

minikube config set cpus 4

Determine available memory

#Linux
grep MemTotal /proc/meminfo

Set Memory

minikube config set memory 20g

Set Disk Size

minikube config set  disk-size 50g

Set container tuneime

minikube config set container-runtime cri-o

Start the cluster

Start the cluster

minikube start

Verify the cluster is working

kubectl get nodes
minikube status

Enable Add-ons

  • admin console: Dashboard
  • Internal registry
  • ingress
  • cluster dns: Simplifies domain name based access to cluster
  • storage

See the list of addons and their status

minikube addons list

Enable the Dashboard

minikube addons enable dashboard
# Optional
minikube addons enable metrics-server

Use the dashboard

minikube dashboard --url

Enable internal registry

minikube addons enable registry

Enable and setup ingeress DNS

https://minikube.sigs.k8s.io/docs/handbook/addons/ingress-dns/

  • Note that the cluster IP changes if you create a new one Steps:
  • Enable the ingress-dns add-on
  • Get the cluster IP
  • Create the config file
minikube addons enable ingress
minikube addons enable ingress-dns
# Get Kube IP
minikube ip

Linux: Update resolv configuration

  • Find the network for your cluster: ifconfig iprange should match minikube ip range
  • Create resolvd entry for that
# Identify network link
ifconfig 
# set search - temporary
sudo systemd-resolve --interface virbr1 --set-dns $(minikube ip) --set-domain test

echo "server=/test/$(minikube ip)" >/etc/NetworkManager/dnsmasq.d/minikube.conf
systemctl restart NetworkManager.service

Permanent fix create file: /etc/systemd/network/minikube.network

[Match]
Name=virbr1
[Network]
DNS=192.168.39.2
Domains=test

MacOS Create a file in /etc/resolver/minikube-profilename-test

domain test
nameserver 192.168.99.169
search_order 1
timeout 5

Replace 192.168.99.169 with your minikube ip and profilename is the name of the minikube profile for the corresponding ip address

Using cluster podman

minikube podman-env
eval $(minikube -p minikube podman-env)

Using cluster docker

minikube podman-env
eval $(minikube -p minikube docker-env)

getting client tools

  • kubectl
  • kubectx - switch context between kubernetes instances
  • kubens - easily manage namespaces

Optional Add-ons

About

My kubernetes setup for an on the go developer experience

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages