Skip to content

Instantly share code, notes, and snippets.

@armenr
Last active December 1, 2021 04:20
Show Gist options
  • Save armenr/d6ffda89c84850c4cc4d9412c0030428 to your computer and use it in GitHub Desktop.
Save armenr/d6ffda89c84850c4cc4d9412c0030428 to your computer and use it in GitHub Desktop.
A small, lightweight, m1-friendly, fully-portable (yay Docker) kubernetes setup & some goodies

Kube Productivity teengz

Kubernetes management

  • https://k8slens.dev/ -- LENS is like a full-blown IDE for Kubernetes. Hook up any of your kubectl contexts or files to it and you're off to the races!
  • https://octant.dev/ -- Octant is like Lens, but different. In some ways, better, albeit it feels slightly slower...but it's dope also!
  • https://k9scli.io/ -- Manage your kube clusters in style via one of the coolest, most-bad ass CLIs ever

Debugging/Observing

  • https://github.com/boz/kail -- VIEW A LIVE TAIL OF ALL (or some filtered set) of services, pods, deployments, nodes, etc... with just one, simple, cli command

Local Kubernets

  • https://k3d.io/ -- a lightweight k3s wrapper for quickly spinning up local k3s clusters
## Run me: k3d cluster create --config k3d-local.yaml --wait
## End me: k3d cluster delete localk3s
apiVersion: k3d.io/v1alpha3
kind: Simple
name: localk3s
servers: 3
agents: 3
# kubeAPI: # same as `--api-port myhost.my.domain:6445` (where the name would resolve to 127.0.0.1)
# host: "kubernetes.docker.internal" # important for the `server` setting in the kubeconfig
# hostIP: "localhost" # where the Kubernetes API will be listening on
# hostPort: "6445" # where the Kubernetes API listening port will be mapped to on your host system
image: rancher/k3s:v1.21.7-k3s1 # LATEST Kubernetes 1.22 release is v1.22.4+k3s1
ports:
- port: 80:80 # same as `--port '8080:80@loadbalancer'`
nodeFilters:
- loadbalancer
- port: 443:443 # same as `--port '8080:80@loadbalancer'`
nodeFilters:
- loadbalancer
- port: 5672:5672 # RabbitMQ AMQP port
nodeFilters:
- loadbalancer
- port: 15672:15672 # RabbitMQ Management interface
nodeFilters:
- loadbalancer
- port: 6379:6379 # redis-cli -h redis-sentinel -p 6379 # Read only operations
nodeFilters:
- loadbalancer
- port: 26379:26379 # redis-cli -h redis-sentinel -p 26379 # Sentinel access
nodeFilters:
- loadbalancer
options:
k3d: # k3d runtime settings
wait: true # wait for cluster to be usable before returining; same as `--wait` (default: true)
disableLoadbalancer: false # same as `--no-lb`
k3s: # options passed on to K3s itself
extraArgs: # additional arguments passed to the `k3s server|agent` command; same as `--k3s-arg`
- arg: --tls-san=kube.armenr.ngrok.io
nodeFilters:
- server:*
# options:
# k3s:
# extraServerArgs:
# - --no-deploy=traefik
#!/bin/bash
# This will run a single-node, fully-portable, dockerized Rancher server
# You can "Import" your local k3d cluster to THIS rancher host through the rancher UI on https/4430 of localhost
docker run -d \
--name rancher-local \
--restart=unless-stopped \
--env CATTLE_K3S_VERSION=v1.21.7+k3s1 \
--publish 8080:80 \ # bind container port 80 to localhost:8080
--publish 4430:443 \ # bind container port 443 to localhost:4430
--mount type=bind,source="$(pwd)"/volumes/rancher,target=/var/lib/rancher \
--privileged \
rancher/rancher:latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment