Skip to content
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.

Add support for weave-net addon. #363

Merged
merged 1 commit into from
Mar 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions phase3/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ config phase3.kube_dns
default y
help
Should we deploy kube-dns?

config phase3.weave_net
bool "Run weave-net?"
default n
help
Should we deploy weave-net? You likely only want this if using kubeadm for phase2.
endif

endmenu
1 change: 1 addition & 0 deletions phase3/all.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ function(cfg)
if_enabled("dashboard", (import "dashboard/dashboard.jsonnet")(cfg)),
if_enabled("heapster", (import "heapster/heapster.jsonnet")(cfg)),
if_enabled("kube_dns", (import "kube-dns/kube-dns.jsonnet")(cfg)),
if_enabled("weave_net", (import "weave-net/weave-net.jsonnet")(cfg)),
]))
19 changes: 19 additions & 0 deletions phase3/weave-net/weave-net-cluster-role-binding.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"kind": "ClusterRoleBinding",
"apiVersion": "rbac.authorization.k8s.io/v1beta1",
"metadata": {
"name": "weave-net"
},
"roleRef": {
"apiGroup": "rbac.authorization.k8s.io",
"kind": "ClusterRole",
"name": "weave-net"
},
"subjects": [
{
"kind": "ServiceAccount",
"name": "weave-net",
"namespace": "kube-system"
}
]
}
37 changes: 37 additions & 0 deletions phase3/weave-net/weave-net-cluster-role.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"kind": "ClusterRole",
"apiVersion": "rbac.authorization.k8s.io/v1beta1",
"metadata": {
"name": "weave-net"
},
"rules": [
{
"apiGroups": [
""
],
"resources": [
"pods",
"namespaces",
"nodes"
],
"verbs": [
"get",
"list",
"watch"
]
},
{
"apiGroups": [
"extensions"
],
"resources": [
"networkpolicies"
],
"verbs": [
"get",
"list",
"watch"
]
}
]
}
133 changes: 133 additions & 0 deletions phase3/weave-net/weave-net-daemon-set.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
{
"apiVersion": "extensions/v1beta1",
"kind": "DaemonSet",
"metadata": {
"name": "weave-net",
"namespace": "kube-system"
},
"spec": {
"template": {
"metadata": {
"labels": {
"name": "weave-net"
}
},
"spec": {
"hostNetwork": true,
"hostPID": true,
"containers": [
{
"name": "weave",
"image": "weaveworks/weave-kube:1.9.4",
"command": [
"/home/weave/launch.sh"
],
"livenessProbe": {
"initialDelaySeconds": 30,
"httpGet": {
"host": "127.0.0.1",
"path": "/status",
"port": 6784
}
},
"securityContext": {
"privileged": true
},
"volumeMounts": [
{
"name": "weavedb",
"mountPath": "/weavedb"
},
{
"name": "cni-bin",
"mountPath": "/host/opt"
},
{
"name": "cni-bin2",
"mountPath": "/host/home"
},
{
"name": "cni-conf",
"mountPath": "/host/etc"
},
{
"name": "dbus",
"mountPath": "/host/var/lib/dbus"
},
{
"name": "lib-modules",
"mountPath": "/lib/modules"
}
],
"resources": {
"requests": {
"cpu": "10m"
}
}
},
{
"name": "weave-npc",
"image": "weaveworks/weave-npc:1.9.4",
"resources": {
"requests": {
"cpu": "10m"
}
},
"securityContext": {
"privileged": true
}
}
],
"restartPolicy": "Always",
"tolerations": [
{
"key": "node-role.kubernetes.io/master",
"effect": "NoSchedule"
}
],
"serviceAccountName": "weave-net",
"securityContext": {
"seLinuxOptions": {
"type": "spc_t"
}
},
"volumes": [
{
"name": "weavedb",
"emptyDir": {}
},
{
"name": "cni-bin",
"hostPath": {
"path": "/opt"
}
},
{
"name": "cni-bin2",
"hostPath": {
"path": "/home"
}
},
{
"name": "cni-conf",
"hostPath": {
"path": "/etc"
}
},
{
"name": "dbus",
"hostPath": {
"path": "/var/lib/dbus"
}
},
{
"name": "lib-modules",
"hostPath": {
"path": "/lib/modules"
}
}
]
}
}
}
}
8 changes: 8 additions & 0 deletions phase3/weave-net/weave-net-service-account.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"apiVersion": "v1",
"kind": "ServiceAccount",
"metadata": {
"name": "weave-net",
"namespace": "kube-system"
}
}
7 changes: 7 additions & 0 deletions phase3/weave-net/weave-net.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function(cfg)
{
"weave-net-service-account.json": import "weave-net-service-account.json",
"weave-net-cluster-role.json": import "weave-net-cluster-role.json",
"weave-net-cluster-role-binding.json": import "weave-net-cluster-role-binding.json",
"weave-net-daemon-set.json": import "weave-net-daemon-set.json",
}
2 changes: 1 addition & 1 deletion util/docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -eux -o pipefail
apk add --update git build-base wget curl jq autoconf automake pkgconfig ncurses-dev libtool gperf flex bison ca-certificates python

## Install kubectl
export KUBECTL_VERSION=1.4.0
export KUBECTL_VERSION=1.6.0-beta.4
wget https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl -O /usr/local/bin/kubectl
chmod +x /usr/local/bin/kubectl

Expand Down