Skip to content

Instantly share code, notes, and snippets.

Avatar

Tommy Falgout lastcoolnameleft

View GitHub Profile
@lastcoolnameleft
lastcoolnameleft / azk.zsh
Last active Sep 15, 2021
Azure AKS Run Command (for private clusters)
View azk.zsh
# Tested in zsh & bash
# This function is designed for Private Clusters with Azure CLI AKS Run Command
# https://docs.microsoft.com/en-us/azure/aks/private-clusters#use-aks-run-command
# It assumes your current context is the private cluster and parses that data from the context data
# Prerequisite: Your private cluster is the Kube config current-context (e.g. az aks get-credentials)
# Usage: azk <command>
# Example: azk kubectl get pods -n kube-system
function azk() {
AZK_CURRENT_CONTEXT=$(kubectl config current-context)
View Validation
thfalgou@kernel-addon-2-md-0-cvx9n:~$ ls /sys/fs/cgroup/cpu/cpu.rt_period_us
/sys/fs/cgroup/cpu/cpu.rt_period_us
thfalgou@kernel-addon-2-md-0-cvx9n:~$ ls /sys/fs/cgroup/cpu/cpu.rt_runtime_us
/sys/fs/cgroup/cpu/cpu.rt_runtime_us
thfalgou@kernel-addon-2-md-0-cvx9n:~$ grep CONFIG_RT_GROUP_SCHED /boot/config-*
/boot/config-5.4.0-1051-azure:# CONFIG_RT_GROUP_SCHED is not set
/boot/config-5.4.0-1053-azure:CONFIG_RT_GROUP_SCHED=y
View kubernetes-dashboard
helm upgrade -i kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard --debug \
--set service.type=ClusterIP \
--set ingress.enabled=true \
--set "ingress.paths[0]=/\(\.\*\)" \
--set "ingress.hosts[0]=$APP_HOSTNAME" \
--set "ingress.tls[0].secretName=$APP_HOSTNAME-tls" \
--set "ingress.tls[0].hosts[0]=$APP_HOSTNAME" \
--set ingress.annotations."kubernetes\.io/ingress\.class"=nginx \
--set ingress.annotations."cert-manager\.io/cluster-issuer"=letsencrypt-prod \
--set ingress.annotations."nginx\.ingress\.kubernetes\.io/rewrite-target"="/\$1" \
@lastcoolnameleft
lastcoolnameleft / ingress.yaml
Last active Jun 11, 2020
Combining APIM + AKS
View ingress.yaml
## Overview
There are 3 options listed here: https://docs.microsoft.com/en-us/azure/api-management/api-management-kubernetes
* APIM + Public AKS Service, no shared Vnet
* APIM + Public AKS Ingress, no shared Vnet
* APIM + Private AKS in same Vnet, no ingress
A missing scenario is:
* APIM + Private AKS in same Subnet, with ingress
@lastcoolnameleft
lastcoolnameleft / walkthrough.md
Last active Oct 24, 2019
Kubernetes Fundamentals Demo
View walkthrough.md

Create Cluster

RG=dol-demo
K8S_NAME=dol-demo

az group create -n $RG -l southcentralus
az aks create -g $RG -n $K8S_NAME --enable-vmss
View function.sh
gen_random() {
NUM=$1
if [ $(($NUM%1000000)) -eq 0 ]; then
echo $NUM
fi
RAND=$(head /dev/urandom | tr -dc 'A-Za-z0-9!"#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~\n\t' | head -c100)
echo "$RAND" | gcc -x c - > /dev/null 2>&1
RESULT=$?
if [ $RESULT -eq 0 ]; then
echo 'SUCCESSFULLY COMPILED!' $NUM
@lastcoolnameleft
lastcoolnameleft / code-gen.sh
Created Oct 18, 2019
random-code-generator
View code-gen.sh
#!/bin/sh
a=0
while [ $a -lt 1000 ]
do
# echo $a
a=`expr $a + 1`
View gist:ddf8117be36bdd7a4988ddc66a911114
bash-3.2$ kubectl get pods --namespace voting -w
NAME READY STATUS RESTARTS AGE
voting-analytics-1-0-79fbdb99f9-b6v8c 2/2 Running 0 15m
voting-analytics-1-1-77b6987669-tw9k4 2/2 Running 0 9m50s
voting-analytics-2-0-688f654c6-rdgkf 0/2 PodInitializing 0 8s
voting-app-1-0-ffb8c5dbf-26sn6 2/2 Running 0 15m
voting-app-1-0-ffb8c5dbf-gxl6n 2/2 Running 0 15m
voting-app-1-0-ffb8c5dbf-lsqfn 2/2 Running 0 15m
voting-app-2-0-5cf65b7ccb-cwn65 0/2 PodInitializing 0 7s
voting-app-2-0-5cf65b7ccb-hmrpv 0/2 PodInitializing 0 7s
@lastcoolnameleft
lastcoolnameleft / Overview.md
Last active Oct 6, 2019
Makerspace Management Software
View Overview.md

Options:

  • OneSiren - No software to download. No real way to evaluate
  • Fabman -
    • Pro: comprehensive.
    • Con:
      • Paid (€79/ month) + 1% transaction fee on top of Stripe.
      • They want you to buy their own hardware.
View coredns-custom.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: coredns-custom
namespace: kube-system
data:
test.server: |
lastcoolnameleft.com:53 {
log
errors