Skip to content

Instantly share code, notes, and snippets.

View danehans's full-sized avatar

Daneyon Hansen danehans

View GitHub Profile
@danehans
danehans / code
Last active November 30, 2017 16:35
kubeadm_kube_proxy_contrack
// SetDefaults_ProxyConfiguration assigns default values for the Proxy
func SetDefaults_ProxyConfiguration(obj *MasterConfiguration) {
if obj.KubeProxy.Config == nil {
obj.KubeProxy.Config = &kubeproxyconfigv1alpha1.KubeProxyConfiguration{}
}
if obj.KubeProxy.Config.ClusterCIDR == "" && obj.Networking.PodSubnet != "" {
obj.KubeProxy.Config.ClusterCIDR = obj.Networking.PodSubnet
}
if obj.KubeProxy.Config.ClientConnection.KubeConfigFile == "" {
@danehans
danehans / log
Last active November 26, 2017 00:33
update default dind deploy for kubenet
// Here are the steps I took to update a standard dind deploy to use kubenet.
// Requires: https://github.com/kubernetes/kubernetes/pull/56245
$ sudo -E docker exec -it kube-master /bin/bash
# apt-get update && apt-get install -y vim
Hit:1 https://apt.dockerproject.org/repo ubuntu-xenial InRelease
Hit:2 http://archive.ubuntu.com/ubuntu xenial InRelease
<SNIP>
@danehans
danehans / 01_links
Last active December 7, 2017 23:21
kubecon_2017_IoK_ppt_code_blocks
@danehans
danehans / dind_gce_v6_deploy_log
Created November 9, 2017 00:26
dind_gce_v6_deploy_issue
$ sudo -E ../../github.com/Mirantis/kubeadm-dind-cluster/gce-setup-local.sh
Password:
++ uname
+ '[' Darwin = Darwin ']'
++++ readlinkf ../../github.com/Mirantis/kubeadm-dind-cluster/gce-setup-local.sh
++++ perl -MCwd -e 'print Cwd::abs_path shift' ../../github.com/Mirantis/kubeadm-dind-cluster/gce-setup-local.sh
+++ dirname /Users/daneyonhansen/code/go/src/github.com/Mirantis/kubeadm-dind-cluster/gce-setup-local.sh
++ cd /Users/daneyonhansen/code/go/src/github.com/Mirantis/kubeadm-dind-cluster
++ pwd
+ DIND_ROOT=/Users/daneyonhansen/code/go/src/github.com/Mirantis/kubeadm-dind-cluster
@danehans
danehans / systemd_unit_dropin
Created October 24, 2017 19:00
working kubelet service
root@kube-master:/# cat /lib/systemd/system/kubelet.service
[Unit]
Description=kubelet: The Kubernetes Node Agent
Documentation=http://kubernetes.io/docs/
[Service]
Environment="KUBELET_KUBECONFIG_ARGS=--kubeconfig=/etc/kubernetes/kubelet.conf --require-kubeconfig=true"
Environment="KUBELET_FEATURE_ARGS= --feature-gates=DynamicKubeletConfig=true"
Environment="KUBELET_SYSTEM_PODS_ARGS=--pod-manifest-path=/etc/kubernetes/manifests --allow-privileged=true"
Environment="KUBELET_NETWORK_ARGS=--network-plugin=cni --cni-conf-dir=/etc/cni/net.d --cni-bin-dir=/opt/cni/bin"
@danehans
danehans / log
Last active October 20, 2017 19:05
k8s clean make hyperkube
$ sudo -E build/make-clean.sh
Password:
+++ [1020 11:49:16] Verifying Prerequisites....
+++ [1020 11:49:17] Keeping container kube-build-data-f0510dd6c7-5-v1.9.1-1
+++ [1020 11:49:17] Keeping container kube-node-1
+++ [1020 11:49:17] Keeping container kube-master
+++ [1020 11:49:17] Keeping container kube-build-data-c8faea261f-5-v1.9.1-1
+++ [1020 11:49:17] Keeping container kube-build-data-f0510dd6c7-5-v1.9.1-1
+++ [1020 11:49:17] Keeping container kube-node-1
+++ [1020 11:49:18] Keeping container kube-master
@danehans
danehans / kubelet.log
Created October 19, 2017 21:57
kube_master_klet logs
# journalctl -u kubelet --no-pager
-- Logs begin at Thu 2017-10-19 21:29:44 UTC, end at Thu 2017-10-19 21:50:42 UTC. --
Oct 19 21:30:02 kube-master systemd[1]: Started kubelet: The Kubernetes Node Agent.
Oct 19 21:30:02 kube-master hyperkube[790]: Flag --require-kubeconfig has been deprecated, You no longer need to use --require-kubeconfig. This will be removed in a future version. Providing --kubeconfig enables API server mode, omitting --kubeconfig enables standalone mode unless --require-kubeconfig=true is also set. In the latter case, the legacy default kubeconfig path will be used until --require-kubeconfig is removed.
Oct 19 21:30:02 kube-master hyperkube[790]: I1019 21:30:02.879791 790 server.go:182] Version: v1.9.0-alpha.1.1415+1e152dba527878
Oct 19 21:30:02 kube-master hyperkube[790]: I1019 21:30:02.879902 790 feature_gate.go:220] feature gates: &{{} map[DynamicKubeletConfig:true]}
Oct 19 21:30:02 kube-master hyperkube[790]: W1019 21:30:02.880073 790 server.go:280] --require-kubeconfig is
@danehans
danehans / new_telemetry.yaml
Created October 16, 2017 19:56
istio bookinfo telemetry manifest
# Configuration for metric instances
apiVersion: "config.istio.io/v1alpha2"
kind: metric
metadata:
name: doublerequestcount
namespace: istio-system
spec:
value: "2" # count each request twice
dimensions:
source: source.service | "unknown"
@danehans
danehans / kubeadm_conf
Created October 16, 2017 18:41
dind generated kubeadm.conf with configurable probes PR.
// Note: 10.192.0.2 is the kube-master dind0 ip address. dind0 is equivalent to eth0 on other systems.
kube-master:/# cat /etc/kubeadm.conf
apiVersion: kubeadm.k8s.io/v1alpha1
kind: MasterConfiguration
unifiedControlPlaneImage: mirantis/hypokube:final
networking:
podSubnet: "10.244.0.0/16"
apiServerExtraArgs:
etcd-servers: "http://kube-master:2379"
insecure-bind-address: "0.0.0.0"
@danehans
danehans / ISTIO_DEPLOY.md
Last active October 17, 2017 05:23
Istio Deployment Guide

Istio Deployment Guide

This guide provides instructions for deploying Istio to Google Compute Engine (GCE) using kubeadm-dind-cluster (dind).

Requirements

Setup a GCE account and follow the quick-start guide to get your GCE developer environment setup. The dind gce-setup script requires application default credentials. Export your GCE application default credentials:

export GOOGLE_APPLICATION_CREDENTIALS=/path/to/my/gce/default/application/credentials.json