Skip to content

Instantly share code, notes, and snippets.

@leblancd
leblancd / gist:62ad517a01049ba9c614af4b500077f3
Last active April 18, 2018 21:02
Testing GCE DinD IPv6 CI Prow Container
Set up a GCE account, and create a json service account key, and store in /etc/service-account/service-account.json
========================================================
Set up a GCE bucket (I used "gs://my-kubernetes-jenkins")
========================================================
Patch in the following temporary change before building Prow container:
cd $GOPATH/src/k8s.io/test-infra
@leblancd
leblancd / gist:f596e4b34f4768efa7748d3cca4a062e
Created January 26, 2018 16:03
kubernetes-anywhere with kubeadm fix: Successful kubelet / kubeadm install
Jan 24 00:43:48 e2e-27d34e4a94-master startup-script: INFO startup-script: + mkdir -p /opt/cni/bin
Jan 24 00:43:48 e2e-27d34e4a94-master startup-script: INFO startup-script: + dpkg -i /tmp/k8s-debs/kubelet.deb /tmp/k8s-debs/kubeadm.deb /tmp/k8s-debs/kubectl.deb /tmp/k8s-debs/kubernetes-cni.deb
Jan 24 00:43:49 e2e-27d34e4a94-master startup-script: INFO startup-script: Selecting previously unselected package kubelet.
Jan 24 00:43:49 e2e-27d34e4a94-master startup-script: INFO startup-script: (Reading database ... 67978 files and directories currently installed.)
Jan 24 00:43:49 e2e-27d34e4a94-master startup-script: INFO startup-script: Preparing to unpack /tmp/k8s-debs/kubelet.deb ...
Jan 24 00:43:49 e2e-27d34e4a94-master startup-script: INFO startup-script: Unpacking kubelet (1.10.0~alpha.1.1158+ddea2dd56ff761) ...
Jan 24 00:43:51 e2e-27d34e4a94-master startup-script: INFO startup-script: Selecting previously unselected package kubeadm.
Jan 24 00:43:51 e2e-27d34e4a94-master startup-script: INFO startup-script:
@leblancd
leblancd / gist:1c823fa24ecafdc4ee86286126e45384
Created September 27, 2017 20:53
conn-track settings on IPv6 setup on Minion 1
[root@kube-minion-1 ~]# sysctl --all | grep conntrack
net.netfilter.nf_conntrack_acct = 0
net.netfilter.nf_conntrack_buckets = 32768
net.netfilter.nf_conntrack_checksum = 1
net.netfilter.nf_conntrack_count = 53
net.netfilter.nf_conntrack_events = 1
net.netfilter.nf_conntrack_events_retry_timeout = 15
net.netfilter.nf_conntrack_expect_max = 256
net.netfilter.nf_conntrack_frag6_high_thresh = 4194304
net.netfilter.nf_conntrack_frag6_low_thresh = 3145728
@leblancd
leblancd / kube-proxy logs, IPv6, Minion 1
Created September 27, 2017 20:52
Kube-proxy logs from IPv6 setup, minion 1
[root@kube-minion-1 ~]# docker logs 5099374de8a3
I0927 20:03:04.902892 1 feature_gate.go:156] feature gates: map[]
time="2017-09-27T20:03:04Z" level=warning msg="Running modprobe ip_vs failed with message: `modprobe: ERROR: ../libkmod/libkmod.c:557 kmod_search_moddep() could not open moddep file '/lib/modules/3.10.0-514.26.2.el7.x86_64/modules.dep.bin'`, error: exit status 1"
time="2017-09-27T20:03:04Z" level=error msg="Could not get ipvs family information from the kernel. It is possible that ipvs is not enabled in your kernel. Native loadbalancing will not work until this is fixed."
W0927 20:03:04.944810 1 server.go:817] Flag proxy-mode="" unknown, assuming iptables proxy
I0927 20:03:04.950771 1 server.go:496] Using iptables Proxier.
W0927 20:03:04.950930 1 proxier.go:489] clusterCIDR not specified, unable to distinguish between internal and external traffic
I0927 20:03:04.951275 1 server.go:531] Tearing down inactive rules.
E0927 20:03:05.028433 1 proxier.go:699] Failed
@leblancd
leblancd / gist:472fac6ca89e79b72712bed3a7834d7d
Created August 28, 2017 19:59
~/.cache/bazel/_bazel_openstack/af47442b3010651ec1a7861f7dccb62e/external/io_bazel_rules_go/go/private/library.bzl
# Copyright 2014 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@leblancd
leblancd / gist:0b4ae3b6203bd1c04c12c3f0a51fd06b
Created August 24, 2017 16:32
Rebased diffs for PR #48551 (not including unit tests)
diff --git a/pkg/proxy/iptables/proxier.go b/pkg/proxy/iptables/proxier.go
index 6f2e666..f023041 100644
--- a/pkg/proxy/iptables/proxier.go
+++ b/pkg/proxy/iptables/proxier.go
@@ -27,6 +27,7 @@ import (
"fmt"
"net"
"reflect"
+ "regexp"
"strconv"
@leblancd
leblancd / gist:d7daa5d665da28990c974daaf8f384b4
Created June 21, 2017 19:52
Script to clone a containernetworking/plugins fork
#!/bin/bash
working_dir=$GOPATH/src/github.com/containernetworking
user=leblancd
repo=plugins
upstream_repo=containernetworking/plugins
mkdir -p $working_dir
cd $working_dir
git clone https://github.com/$user/$repo.git
@leblancd
leblancd / gist:43d527ab9d98625ca46c14a014005bd5
Created June 21, 2017 19:29
Dual-Stack CNI bridge plugin configuration
{
"cniVersion": "0.3.0",
"name": "mynet",
"type": "bridge",
"bridge": "cbr0",
"isDefaultGateway": true,
"ipMasq": false,
"ipam": {
"type": "host-local",
"ranges": [
@leblancd
leblancd / gist:e550d41cad5a1c0ecb81837dfbc93cc5
Created April 14, 2017 19:22
IPv6 Neighbor Discovery cache resiliency to IPv6 unicast addresses getting recycled
Here is a trace showing that the IPv6 Neighbor Discovery process is resilient to IPv6 unicast addresses being recycled,
because of the use of the "override" flag ("ovr", or "o-bit") in IPv6 Neighbor Advertisements.
In the tshark trace below, a kubernetes pod with IPv6 address 2001:101::2 is trying to ping a pod at 2001:101::3.
However, the previous pod that had been assigned the address 2001:101::3 has just been deleted, and a new pod was brought
up using the same address. After several seconds of ping failure (trying to ping the now-deleted pod), the ping requestor
sends a Neighbor Solicitation for 2001:101::3. The new pod with the this address then responds with a Neighbor Advertisement
with the "ovr" (override) flag set (line 15 in the tshark output) indicating that any Neighbor Discovery cache entries for
this address should be overwritten with the new pods link layer address.
[kube@kube-minion-1 ~]$ sudo tshark -i cbr0
openstack@bxb-ds-60:~/netplugin$ make k8s-cluster
cd vagrant/k8s/ && ./setup_cluster.sh
~/netplugin/vagrant/k8s ~/netplugin/vagrant/k8s
k8s-v1.2.3/kubernetes.tar.gz found, not fetching.
kubernetes/server/kubernetes-server-linux-amd64.tar.gz
kubernetes/
kubernetes/LICENSES
kubernetes/server/
kubernetes/server/bin/
kubernetes/server/bin/linkcheck