Skip to content

Instantly share code, notes, and snippets.

View danehans's full-sized avatar

Daneyon Hansen danehans

View GitHub Profile
@danehans
danehans / coreos_bond0
Created January 27, 2017 19:00
CoreOS Bond0 cloud-config
write_files:
- path: /etc/modprobe.d/bonding.conf
content: |
# Prevent kernel from automatically creating bond0 when the module is loaded.
# This allows systemd-networkd to create and apply options to bond0.
options bonding max_bonds=0
- path: /etc/systemd/network/10-eth.network
permissions: 0644
owner: root
content: |
# etcd clustering:
https://coreos.com/os/docs/latest/cluster-discovery.html
# Getting the etcd version. The etcd version of a specific instance can be obtained from the /version endpoint.
curl -L http://127.0.0.1:4001/version
# Starting etcd manually with add’l flags:
./etcd --name 10.0.0.5 \
@danehans
danehans / 10-ipvlan.conf
Last active February 3, 2017 22:34
k8s cni ipvlan
$ cat /etc/kubernetes/cni/net.d/10-ipvlan.conf
{
"cniVersion": "0.2.0",
"name": "ipvlan-net",
"type": "ipvlan",
"master": "mgt",
"ipam": {
"type": "host-local",
"subnet": "10.30.118.136/29",
"rangeStart": "10.30.118.141",
Provisioning to use Calico
1/20/2017
First, tearing down the cluster, by doing this on each node:
kubeadm reset
rm -rf .kube
systemctl start kubelet.service
Did yum -y update on all nodes as well. Downloaded http://docs.projectcalico.org/v1.6/getting-started/kubernetes/installation/hosted/kubeadm/calico.yaml and then ran "kubectl create -f calico.yaml".
Starting up cluster (with just the master node).
@danehans
danehans / notes
Created February 8, 2017 02:33
kubelet guts
/usr/bin/kubelet --pod-manifest-path=/etc/kubernetes/manifests
@danehans
danehans / docker container net settings
Last active February 8, 2017 19:21
k8s v6 intro code review
# from node running docker (k8s node)
docker ps | grep web
"NetworkSettings": {
"Bridge": "",
"SandboxID": "",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": null,
______________________________________________________________
k8s+contiv BGP peering setup
Status:
- able to peer with ASR1K route-reflector
- able to see reflected routes in k8s netctl bgp output
- NOT able to see k8s pod routes in ASR1K
-------------------------------------------------------
// GenerateHardwareAddr generates 48 bit virtual mac addresses based on the IP4 or IPv6 input.
func GenerateHardwareAddr(ip net.IP, prefix []byte) (net.HardwareAddr, error) {
switch {
case (ip.To4() || ip.To16()) == nil:
return nil, SupportIpErr{msg: "GenerateHardwareAddr requires an IPv4 or IPv6 address as input"}
case len(prefix) != len(PrivateMACPrefix):
return nil, InvalidPrefixLengthErr{msg: fmt.Sprintf(
"Prefix has length %d instead of %d", len(prefix), len(PrivateMACPrefix)),
@danehans
danehans / web-app-extip.yaml
Created March 27, 2017 23:04
k8s extIP example manifest
apiVersion: v1
kind: Service
metadata:
labels:
name: web
role: service
name: web
spec:
#type: NodePort
ports:
@danehans
danehans / gist:4d87dfa744d058c27be91a95d5ef3a99
Created April 12, 2017 18:19
k8s_unit_test_fail_cent7_local_docker
$ build/run.sh make test
<SNIP>
ok k8s.io/kubernetes/pkg/controller/namespace/deletion 0.070s
E0412 18:15:20.929533 21693 range_allocator.go:234] Node node0 already has allocated CIDR 127.123.234.0/30. Releasing assigned one if different.
E0412 18:15:21.071332 21693 test_utils.go:361] Encoutered error while getting reference: selfLink was empty, can't make reference
E0412 18:15:21.071799 21693 test_utils.go:361] Encoutered error while getting reference: selfLink was empty, can't make reference
E0412 18:15:21.072141 21693 test_utils.go:361] Encoutered error while getting reference: selfLink was empty, can't make reference
E0412 18:15:22.778378 21693 test_utils.go:361] Encoutered error while getting reference: selfLink was empty, can't make reference
E0412 18:15:23.932462 21693 test_utils.go:361] Encoutered error while getting reference: selfLink was empty, can't make reference
E0412 18:15:24.535603 21693 test_utils.go:361] Encoutered error while getting reference: selfLink was empty, can't make