Skip to content

Instantly share code, notes, and snippets.

@smijar
smijar / k3d-install-dashboard.md
Created April 22, 2020 00:50
k3d-install-dashboard

ref

https://rancher.com/docs/k3s/latest/en/installation/kube-dashboard/

install

Deploying the Kubernetes Dashboard

GITHUB_URL=https://github.com/kubernetes/dashboard/releases
VERSION_KUBE_DASHBOARD=$(curl -w '%{url_effective}' -I -L -s -S ${GITHUB_URL}/latest -o /dev/null | sed -e 's|.*/||')
kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/${VERSION_KUBE_DASHBOARD}/aio/deploy/recommended.yaml
@smijar
smijar / osx-port-listening.md
Created April 23, 2020 04:54
OS X process on which port
lsof -iTCP -sTCP:LISTEN -n -P
# utility function
listening() {
    if [ $# -eq 0 ]; then
        sudo lsof -iTCP -sTCP:LISTEN -n -P
 elif [ $# -eq 1 ]; then
@smijar
smijar / wsl2-cfg-ubuntu.json
Created May 29, 2020 17:12
wsl2 config for ubuntu
// from: https://wespeter.com/posts/how-to-set-windows-terminal-starting-directory/
// add a starting folder for wsl2 working directory, so that it loads .bash_profile and .bashrc properly
// rather than starting in the windows home folder
// This file was initially generated by Windows Terminal 0.11.1333.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
@smijar
smijar / dir-path-ubuntu-wsl2.txt
Created May 29, 2020 17:17
directory path for wsl2 ubuntu
dir \\wsl$\Ubuntu
@smijar
smijar / Makefile-k3s
Last active April 20, 2021 19:22
Makefile for simplified k3s deploy on local
create_dev_cluster:
k3d create --name dev --api-port 6443 --publish 8081:80 --workers 2
# add the metrics-server
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.4.2/components.yaml
list:
k3d list
switch_dev:
@smijar
smijar / Vagrantfile-vbox-fedora-cloud-dev-tools
Last active March 13, 2022 01:38
Vagrant Fedora box with docker, vagrant/libvirtd provider, k3s, kind, minikube, java, maven, pyenv, golang
#-------------------------------------------------------------
# Fedora34 based Vagrant box
# --------------------------
# This is a Vagrantfile that installs azure, aws, gcloud CLIs
# along with pyenv, sdkman (for java), golang, nodejs
# minikube, kind, k3s
#-------------------------------------------------------------
vm_script = <<-SHELL
# sudo -i
# echo "nameserver 8.8.8.8" | sudo tee -a /etc/resolv.conf
@smijar
smijar / K3s multi-node cluster with Vagrant
Last active October 19, 2022 15:32
Vagrant helper script for standing up the server and then the agent nodes
# Name:./up.sh
#!/bin/bash
# name this up.sh
set -euxo pipefail
# first, bring up the server
vagrant up server
sleep 10
# ref: https://fedoramagazine.org/vagrant-qemukvm-fedora-devops-sysadmin/
# install
```shell
sudo dnf install qemu-kvm libvirt libguestfs-tools virt-install rsync
or
$ sudo dnf install vagrant-libvirt
$ sudo dnf install @vagrant
# ref
# https://computingforgeeks.com/how-to-install-virtualbox-on-fedora-linux/
# tweak below for Mac OS X
# https://stefanwrobel.com/how-to-make-vagrant-performance-not-suck
# vagrantfile
```shell
testbox_script = <<-SHELL
#!/bin/bash
set -euxo pipefail
# ref
read: https://github.com/vagrant-libvirt/vagrant-libvirt
install: https://fedoramagazine.org/vagrant-qemukvm-fedora-devops-sysadmin/
nested: https://adrianriobo.github.io/virtualization/testing/environment/2020/10/13/vagrant-nested-virtualization.html
$ cat Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# sudo virsh net-list --all