Skip to content

Instantly share code, notes, and snippets.

@rsmitty
rsmitty / create-sa.yaml
Created April 23, 2024 13:43
Create a service account for use outside of omni context
## Create service account
$ kubectl -n kube-system create serviceaccount <user-name>
## Bind the service account to the cluster-admin role
$ kubectl create clusterrolebinding <user-name> --clusterrole=cluster-admin --serviceaccount=kube-system:<user-name>
## Create a token for the service account
$ kubectl create token <user-name> -n kube-system
## Create a kubeconfig with this new token
@rsmitty
rsmitty / gcp-configpatches.yaml
Last active October 12, 2023 17:12
Omni + GCP Fun
cluster:
externalCloudProvider:
enabled: true
manifests:
- https://raw.githubusercontent.com/siderolabs/talos/master/website/content/v1.5/talos-guides/install/cloud-platforms/gcp/gcp-ccm.yaml
extraManifests:
- https://gist.githubusercontent.com/rsmitty/22fd1e51ad47254da945ddb8f6efc75c/raw/247f3e8f4c907e58049a2a8d4bde1edf0e5be8d3/gcp-csi.yaml
machine:
kubelet:
extraMounts:
@rsmitty
rsmitty / bonding.md
Created September 26, 2023 15:42
Adventures with Bonding in Talos v1.5.3

Booted the bare Talos 1.5.3 ISO in a VMWare Workstation VM configured for two NICs bridged directly to home network. The way VMWare creates NICs does not appear to allow for 802.3ad bond mode, so I tested with active-backup.

Prior to any configuration, two NICs are shown each with separate IPs:

$ talosctl get links -n 192.168.1.108 --insecure
NODE   NAMESPACE   TYPE         ID            VERSION   TYPE       KIND     HW ADDR                                           OPER STATE   LINK STATE
       network     LinkStatus   bond0         1         ether      bond     5e:4a:f6:ca:d9:60                                 down         false
       network     LinkStatus   dummy0        1         ether      dummy    76:f9:21:3a:30:79                                 down         false
       network     LinkStatus   eno16777736   4         ether               00:0c:29:23:30:1b                                 up           true
---
# Source: calico/templates/calico-kube-controllers.yaml
# This manifest creates a Pod Disruption Budget for Controller to allow K8s Cluster Autoscaler to evict
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: calico-kube-controllers
namespace: kube-system
labels:
@rsmitty
rsmitty / vsphere.sh
Created January 6, 2022 18:12
A little script to automate creation of talos clusters in vsphere
#!/bin/bash
set -e
## The following commented environment variables should be set
## before running this script
# export GOVC_USERNAME='administrator@vsphere.local'
# export GOVC_PASSWORD='xxx'
# export GOVC_INSECURE=true
@rsmitty
rsmitty / ppl.md
Last active July 22, 2021 18:04
A bastardized PPL that I adapted from reddit.

My "Dude, I Don't Have That Much Equipment In My Homegym" Program

Here's a short write-up of the PPL that I've been running. It's loosely based off of this reddit post. But you know, I'm not in a gym and I don't have access to all this shit that it mentions. So here we are.

Context

This program goes Push/Pull/Legs, in that order, and then repeats. I've done it anywhere from 3-6 times a week and it's worked out well. As the weight gets heavier, doing some of these (especially legs) twice a week gets pretty brutal.

You'll also notice that the heavy exercises below are 3x5+. This is explained in that reddit post, but essentially it means you go to failure on the last set if you've got more than 5 in the tank. It's a nice way to pick up some extra reps when you're feeling good.

---
# Source: calico/templates/calico-config.yaml
# This ConfigMap is used to configure a self-hosted Calico installation.
kind: ConfigMap
apiVersion: v1
metadata:
name: calico-config
namespace: kube-system
data:
# Typha is disabled.
@rsmitty
rsmitty / aa-cloudconf.yaml
Last active December 2, 2020 17:31
cloudconf.yaml
apiVersion: v1
kind: Secret
metadata:
name: cloud-config
namespace: kube-system
type: Opaque
data:
cloud.conf: W0dsb2JhbF0KYXV0aC11cmw9aHR0cDovLzE5Mi4xNjguMjU0LjIvaWRlbnRpdHkKI1RpcDogWW91IGNhbiBhbHNvIHVzZSBBcHBsaWNhdGlvbiBDcmVkZW50aWFsIElEIGFuZCBTZWNyZXQgaW4gcGxhY2Ugb2YgdXNlcm5hbWUsIHBhc3N3b3JkLCB0ZW5hbnQtaWQsIGFuZCBkb21haW4taWQuCiNhcHBsaWNhdGlvbi1jcmVkZW50aWFsLWlkPQojYXBwbGljYXRpb24tY3JlZGVudGlhbC1zZWNyZXQ9CnVzZXJuYW1lPWFkbWluCiMgdXNlci1pZD0KcGFzc3dvcmQ9c3VwZXJzZWNyZXQKcmVnaW9uPVJlZ2lvbk9uZQp0ZW5hbnQtaWQ9ZWJmNDNmYzQwYzRkNDNlODk4NTA0YTc3ODY5YzRhMWUKZG9tYWluLWlkPWRlZmF1bHQKCltMb2FkQmFsYW5jZXJdCnVzZS1vY3RhdmlhPXRydWUKc3VibmV0LWlkPWFjY2VlMDljLTYwMWYtNGQ4Mi1iYmU0LWUzNTY5Njk3Y2VlYwpmbG9hdGluZy1uZXR3b3JrLWlkPTFhMjJhYmQxLTQxOGYtNDFhOC05OWQxLTQyZDY3MmJjMTA3MgoKW0Jsb2NrU3RvcmFnZV0KYnMtdmVyc2lvbj12Mgo=
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: kube-vip-ds
namespace: kube-system
spec:
selector:
matchLabels:
name: kube-vip-ds
template: