Skip to content

Instantly share code, notes, and snippets.

@lalyos
lalyos / README.md
Last active July 31, 2019 20:53
k8s basic auth for nginx ingress
apiVersion: apps/v1
kind: Deployment
metadata:
name: bad-app
spec:
replicas: 0
selector:
matchLabels:
app: bad
template:
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
app: lunch
name: lunch
spec:
type: NodePort
ports:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: web
spec:
rules:
- host: web.$NS.ing.k8z.eu
http:
paths:
- backend:
@lalyos
lalyos / list-fonts.md
Last active June 20, 2019 15:09
mac osx list fonts from cli

listing osx fonts from cli:

curl -LO https://gist.githubusercontent.com/lalyos/eca62800093d9352474ad5140f6d1f0f/raw/list-fonts.swift
chmod +x list-fonts.swift
./list-fonts.swift

tldr; installing fonts via brew:

@lalyos
lalyos / docker-compose.yml
Created May 13, 2019 15:25
2 node k3s cluster
version: '3'
services:
server:
# v0.2.0-rc5
# v0.1.0-rc1
image: rancher/k3s:v0.5.0
command: server --disable-agent
environment:
- K3S_CLUSTER_SECRET=somethingtotallyrandom
- K3S_KUBECONFIG_OUTPUT=/output/kubeconfig.yaml
@lalyos
lalyos / README.md
Last active May 7, 2019 10:27
craft lunch

bla bla

kubectl apply ...

Copyright 2019

@lalyos
lalyos / compile-kubectl.ms
Created May 6, 2019 17:25
compile kubectl from source
## compile kubectl
./hack/build-go.sh
./hack/build-go.sh cmd/kubectl
KUBE_VERBOSE=9 V=9 make --no-print-directory -C ./hack/.. all WHAT=cmd/kubectl
./hack/make-rules/build.sh cmd/kubectl
@lalyos
lalyos / compose-on-kubernetes.md
Last active December 6, 2018 11:11
compose-on-kubernetes running on GKE

Docker just opensourced compose-on-kubernetes (COK for short), and I wanted to run on GKE. This is the jurney:

Architecture

You will be able to use plain-old-compose files against k8s. Actually the docker-compose.yml have to be transformed to a Stack CustomResourceDefinition, and than a controller will take care of creating the all the necesseary k8s resources (deployments, services)

You can create those CRDs in 2 ways: