Skip to content

Instantly share code, notes, and snippets.

@killcity
killcity / kubernetes_add_service_account_kubeconfig.sh
Created March 20, 2019 18:51 — forked from innovia/kubernetes_add_service_account_kubeconfig.sh
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the user
#!/bin/bash
set -e
set -o pipefail
# Add user to k8s using service account, no RBAC (must create RBAC after this script)
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "usage: $0 <service_account_name> <namespace>"
exit 1
fi
@killcity
killcity / rancher_kuberouter_addon.yaml
Created December 11, 2019 16:29
kube-router hack for rancher
apiVersion: v1
kind: ConfigMap
metadata:
name: kube-router-cfg
namespace: kube-system
labels:
tier: node
k8s-app: kube-router
data:
cni-conf.json: |
@killcity
killcity / kube-router-talos.yaml
Last active May 13, 2021 17:02
sample kube-router config for talos - adjust args to desired blend - also match cidr block and endpoint accordingly
apiVersion: v1
kind: ConfigMap
metadata:
name: kube-router-cfg
namespace: kube-system
labels:
tier: node
k8s-app: kube-router
data:
cni-conf.json: |
@killcity
killcity / docker_swarm_with_macvlan_consul_and_autoscaling.md
Last active December 1, 2023 01:39
Docker Swarm with Macvlan, Consul and Autoscaling - http://killcity.io

UPDATE!

I have moved this to my blog. All future updates will be made here: http://killcity.io/2017/08/12/setup-docker-swarm-with-macvlan-plus-consul-and-autoscaling.html

Docker Swarm with Macvlan, Consul and Autoscaling

TL;DR:

This will get you routable containers with IPs on your existing subnets, advertising to Consul. They will also be scalable and placed across a cluster of Swarm hosts. It's assumed that you are already running Consul, so if not, there are a ton of tutorials out there. It's also assumed you know how to install Docker and various Linux kernels.

Bonus: We add an autoscaling API called Orbiter (https://gianarb.it/blog/orbiter-the-swarm-autoscaler-moves).

I just want to run containers, like now, on my existing infrastructure and networks!