Skip to content

Instantly share code, notes, and snippets.

View yanniszark's full-sized avatar
🤹‍♂️
overcommitting

Yannis Zarkadas yanniszark

🤹‍♂️
overcommitting
View GitHub Profile
@yanniszark
yanniszark / ldap.yaml
Created June 13, 2019 13:20
Sample LDAP Server + phpLDAPadmin
apiVersion: v1
kind: Service
metadata:
labels:
app: ldap
name: ldap-service
namespace: kubeflow
spec:
type: ClusterIP
clusterIP: None
@yanniszark
yanniszark / ldap-seed.ldif
Created June 13, 2019 13:22
LDAP Seed File
# This already exists.
# If it doesn't, uncomment this.
#dn: dc=arrikto,dc=com
#objectClass: dcObject
#objectClass: organization
#o: Arrikto
#dc: arrikto
dn: ou=People,dc=arrikto,dc=com
objectClass: organizationalUnit
@yanniszark
yanniszark / dex-config-ldap-partial.yaml
Created June 13, 2019 13:38
Dex LDAP Connector Config
connectors:
- type: ldap
# Required field for connector id.
id: ldap
# Required field for connector name.
name: LDAP
config:
# Host and optional port of the LDAP server in the form "host:port".
# If the port is not supplied, it will be guessed based on "insecureNoSSL",
# and "startTLS" flags. 389 for insecure or StartTLS connections, 636
@yanniszark
yanniszark / envoyfilter.yaml
Created July 18, 2019 14:59
Envoy Filter ext_authz example
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: authn-filter
spec:
workloadLabels:
istio: ingressgateway
filters:
- filterConfig:
httpService:
@yanniszark
yanniszark / kfdef.yaml
Last active September 4, 2019 17:40
kfdef example
apiVersion: kubeflow.org/v1alpha1
kind: KfDef
spec:
applications:
- name:
kustomizeConfig:
name: jupyter-web-app
overlays:
- istio
repoRef:
# This is the config to install Kubeflow on an existing K8s cluster, with support
# for multi-user and LDAP auth using Dex.
apiVersion: kfdef.apps.kubeflow.org/v1alpha1
kind: KfDef
metadata:
name: demo
namespace: kubeflow
spec:
applications:
@yanniszark
yanniszark / cpu_manager.sh
Created December 2, 2019 17:58
GKE CPU Pinning Script - Run this as a DaemonSet
#!/bin/bash
HOSTFS="/mnt/hostfs"
function sleep_forever() {
while true; do sleep 100; done
}
function setup_kubectl() {
# Setup kubectl
@yanniszark
yanniszark / cass-stress-gen.py
Created December 6, 2019 10:41
Cassandra Stress Job Generating Script
#!/usr/bin/env python3
import argparse
import sys
import os
template = """
apiVersion: batch/v1
kind: Job
metadata:
name: {d.name}-{}
@yanniszark
yanniszark / update-k8s-deps.py
Created March 14, 2020 14:27
Update K8s dependencies - Go Modules Enabled
#!/usr/bin/env python3
import os
import sys
from subprocess import run
deps = [
"k8s.io/api@kubernetes-{version}",
"k8s.io/apiextensions@kubernetes-{version}",
"k8s.io/apimachinery@kubernetes-{version}",
@yanniszark
yanniszark / split_yaml.go
Created April 15, 2020 11:54
Golang: Multiple YAML Documents / Split YAML
import goyaml "github.com/go-yaml/yaml"
func SplitYAML(resources []byte) ([][]byte, error) {
dec := goyaml.NewDecoder(bytes.NewReader(resources))
var res [][]byte
for {
var value interface{}
err := dec.Decode(&value)