Skip to content

Instantly share code, notes, and snippets.

View bzub's full-sized avatar

bzub bzub

View GitHub Profile
@bzub
bzub / Notes.md
Created August 6, 2017 20:35
kube-router - Watcher Refactoring
@bzub
bzub / e2e.sh
Last active July 31, 2017 15:43
Bootkube e2e tests with kube-router + kube-metal
#!/usr/bin/env sh
set -e
[ -z "${KUBECONFIG}" ] && KUBECONFIG="${PWD}/assets/auth/kubeconfig"
SUDO="sudo UNIFIED_CGROUP_HIERARCHY=0"
${SUDO} rkt --insecure-options=image run \
--interactive \
@bzub
bzub / 00-results-output.txt
Last active July 29, 2017 09:06
networkpolicy test script for github.com/cloudnativelabs/kube-router/issues/85
###
### Stage 00-new-cluster complete. Logging to /tmp/np-test-logs/00-new-cluster.\{iptables,ipset\}
###
networkpolicy "test-network-policy" created
###
### Stage 01-np-created complete. Logging to /tmp/np-test-logs/01-np-created.\{iptables,ipset\}
###
deployment "test-np-server" created
service "test-np-server" exposed
###
@bzub
bzub / kube-router-cfg.yaml
Last active January 19, 2022 20:52
kubeadm kube-router troubleshooting
apiVersion: v1
kind: ConfigMap
metadata:
name: kube-router-cfg
namespace: kube-system
labels:
tier: node
k8s-app: kube-router
data:
cni-conf.json: |
@bzub
bzub / binding-service-ips-in-k8s-pods.md
Last active April 24, 2017 01:28
Bind Kubernetes Pod To Static Service IP Using socat (Rook & Ceph Example)

This workaround solves many issues where software in a Kubernetes pod expects a static, rarely changed IP address. Since we bind to a Kubernetes Service IP, it comes with many benefits such as automatic DNS entries within the cluster, health checking automation, and abstraction of network details. In fact these features of Services are used in the pod examples here to avoid hard-coding IP addresses and ports into the pod definitions.

TODO: More details.

Results

    cluster 9ece8946-1b9d-4bb5-8d51-34c968119795
@bzub
bzub / bgp-matchbox.md
Last active April 13, 2017 18:03
BGP Routed VIPs via Matchbox + Calico/Kubernetes Integration

Container Linux Config / Ignition

Here's the relevant bits that configure IPs on loopback via systemd-networkd. They are the same on all my nodes, so no variables.

networkd:
  units:
    - name: 00-vip-lo.network
      contents: |
        [Match]
        Name=lo
        [Network]
@bzub
bzub / kube-flannel-cfg.yaml
Created April 6, 2017 03:04
Calico + Bootkube Example
# This ConfigMap is used to configure a self-hosted Calico installation.
kind: ConfigMap
apiVersion: v1
metadata:
name: calico-config
namespace: kube-system
data:
# Configure this with the location of your etcd cluster.
etcd_endpoints: "http://kube-etcd:2379"
@bzub
bzub / notes.md
Last active March 28, 2017 01:21
Rook DataPolicy Prototype

TODO

  • Define defaults and override rules.
    • Should there be a "default" DataPolicy that is assumed unless overridden?
    • The DataPolicies, DataEndpoints, and StorageNodes lists are ordered. How can we use that ordering to make predictable results from selections?
      • Proposal for StorageNodes: The last group of selectors (all must match) to match a host is what applies.
      • Proposal for DataPolicies: The last policy to match a device or directory is what applies.
      • Proposal for DataEndpoints: Inclusive match. If any one rule describes a device or directory then it's added to the group.
  • Seems like it could be possible to combine DataPolicies and DataEndpoints into one resource type.

Hopefully there are few flaws in the logic and this proposal is a good compromise between simplicity and power.

@bzub
bzub / rook-osd-ds.yaml
Last active March 23, 2017 20:00
Modified Rook OSD DaemonSet
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
labels:
app: rook
role: osd
rook_cluster: rookcluster
name: osd
spec:
selector: