Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Configure weave in minikube+kubernetes #3062

Closed
djshrshiv opened this issue Jul 13, 2017 · 12 comments · Fixed by kubernetes/minikube#1697
Closed

Configure weave in minikube+kubernetes #3062

djshrshiv opened this issue Jul 13, 2017 · 12 comments · Fixed by kubernetes/minikube#1697

Comments

@djshrshiv
Copy link

djshrshiv commented Jul 13, 2017

Hi,

I am trying to configure the weave net with Minikube+ Kubernetes as mentioned in https://www.weave.works/docs/net/latest/kube-addon/
I am getting following error for weave-net pod

weave-net-qn2m7               0/2       CrashLoopBackOff   4          2m
 kubectl describe pod/weave-net-qn2m7 -n kube-system
Name:		weave-net-qn2m7
Namespace:	kube-system
Node:		minikube/192.168.99.100
Start Time:	Thu, 13 Jul 2017 15:20:01 +0530
Labels:		name=weave-net
		pod-template-generation=1
Annotations:	kubernetes.io/created-by={"kind":"SerializedReference","apiVersion":"v1","reference":{"kind":"DaemonSet","namespace":"kube-system","name":"weave-net","uid":"a3a6ea3a-67b0-11e7-a9a7-080027d1715f","apiV...
Status:		Running
IP:		192.168.99.100
Created By:	DaemonSet/weave-net
Controlled By:	DaemonSet/weave-net
Containers:
  weave:
    Container ID:	docker://41a6115464c3c16c2537c9802ac763312adeff5701d6b942470b7622bca50718
    Image:		weaveworks/weave-kube:2.0.1
    Image ID:		docker://sha256:d2099d50a03bf05e7e7d7e6dacb0d226d5d27b2bcc824bc9d0318573d21919c9
    Port:		<none>
    Command:
      /home/weave/launch.sh
    State:		Waiting
      Reason:		CrashLoopBackOff
    Last State:		Terminated
      Reason:		Error
      Exit Code:	1
      Started:		Mon, 01 Jan 0001 00:00:00 +0000
      Finished:		Thu, 13 Jul 2017 15:23:36 +0530
    Ready:		False
    Restart Count:	4
    Requests:
      cpu:	10m
    Liveness:	http-get http://127.0.0.1:6784/status delay=30s timeout=1s period=10s #success=1 #failure=3
    Environment:
      HOSTNAME:	 (v1:spec.nodeName)
    Mounts:
      /host/etc from cni-conf (rw)
      /host/home from cni-bin2 (rw)
      /host/opt from cni-bin (rw)
      /host/var/lib/dbus from dbus (rw)
      /lib/modules from lib-modules (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from weave-net-token-9ckmb (ro)
      /weavedb from weavedb (rw)
  weave-npc:
    Container ID:	docker://16391334b1885e126cd0c956f3cb523de38dbdfcc55a5e7cb1aaae76eedc162c
    Image:		weaveworks/weave-npc:2.0.1
    Image ID:		docker://sha256:4f71bca714a3fc6bb6515006c8267a83215e845b3e14956986a70282313c9342
    Port:		<none>
    State:		Waiting
      Reason:		CrashLoopBackOff
    Last State:		Terminated
      Reason:		Error
      Exit Code:	1
      Started:		Mon, 01 Jan 0001 00:00:00 +0000
      Finished:		Thu, 13 Jul 2017 15:23:43 +0530
    Ready:		False
    Restart Count:	4
    Requests:
      cpu:	10m
    Environment:
      HOSTNAME:	 (v1:spec.nodeName)
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from weave-net-token-9ckmb (ro)
Conditions:
  Type		Status
  Initialized 	True 
  Ready 	False 
  PodScheduled 	True 
Volumes:
  weavedb:
    Type:	HostPath (bare host directory volume)
    Path:	/var/lib/weave
  cni-bin:
    Type:	HostPath (bare host directory volume)
    Path:	/opt
  cni-bin2:
    Type:	HostPath (bare host directory volume)
    Path:	/home
  cni-conf:
    Type:	HostPath (bare host directory volume)
    Path:	/etc
  dbus:
    Type:	HostPath (bare host directory volume)
    Path:	/var/lib/dbus
  lib-modules:
    Type:	HostPath (bare host directory volume)
    Path:	/lib/modules
  weave-net-token-9ckmb:
    Type:	Secret (a volume populated by a Secret)
    SecretName:	weave-net-token-9ckmb
    Optional:	false
QoS Class:	Burstable
Node-Selectors:	<none>
Tolerations:	:NoSchedule
		node.alpha.kubernetes.io/notReady:NoExecute
		node.alpha.kubernetes.io/unreachable:NoExecute
Events:
  FirstSeen	LastSeen	Count	From			SubObjectPath			Type		Reason		Message
  ---------	--------	-----	----			-------------			--------	------		-------
  4m		4m		1	kubelet, minikube	spec.containers{weave-npc}	Normal		Created		Created container with id f35c332add69377e70fb700c9c28d154d1086d8d8c15136ef5af270d0a09997b
  4m		4m		1	kubelet, minikube	spec.containers{weave-npc}	Normal		Started		Started container with id f35c332add69377e70fb700c9c28d154d1086d8d8c15136ef5af270d0a09997b
  3m		3m		1	kubelet, minikube	spec.containers{weave}		Normal		Created		Created container with id b7782b9d67e9765687214ad869ecf44b550975f81f658a3ae237f83aba19cb0b
  3m		3m		1	kubelet, minikube	spec.containers{weave}		Normal		Started		Started container with id b7782b9d67e9765687214ad869ecf44b550975f81f658a3ae237f83aba19cb0b
  3m		3m		1	kubelet, minikube	spec.containers{weave}		Normal		Started		Started container with id 7572307e2b1ca047984ddc93a386373001b8a7aa3b3e88745b0d6c24f6d70c42
  3m		3m		1	kubelet, minikube	spec.containers{weave}		Normal		Created		Created container with id 7572307e2b1ca047984ddc93a386373001b8a7aa3b3e88745b0d6c24f6d70c42
  3m		3m		1	kubelet, minikube	spec.containers{weave-npc}	Normal		Created		Created container with id 0f9143413b536e09d5147a182ba8b25260cbbfee40427b6ceb2f51aa265afb2b
  3m		3m		1	kubelet, minikube	spec.containers{weave-npc}	Normal		Started		Started container with id 0f9143413b536e09d5147a182ba8b25260cbbfee40427b6ceb2f51aa265afb2b
  3m		3m		1	kubelet, minikube					Warning		FailedSync	Error syncing pod, skipping: [failed to "StartContainer" for "weave" with CrashLoopBackOff: "Back-off 10s restarting failed container=weave pod=weave-net-qn2m7_kube-system(a3a94243-67b0-11e7-a9a7-080027d1715f)"
, failed to "StartContainer" for "weave-npc" with CrashLoopBackOff: "Back-off 10s restarting failed container=weave-npc pod=weave-net-qn2m7_kube-system(a3a94243-67b0-11e7-a9a7-080027d1715f)"
]
  3m	3m	1	kubelet, minikube		Warning	FailedSync	Error syncing pod, skipping: [failed to "StartContainer" for "weave-npc" with CrashLoopBackOff: "Back-off 10s restarting failed container=weave-npc pod=weave-net-qn2m7_kube-system(a3a94243-67b0-11e7-a9a7-080027d1715f)"
, failed to "StartContainer" for "weave" with CrashLoopBackOff: "Back-off 10s restarting failed container=weave pod=weave-net-qn2m7_kube-system(a3a94243-67b0-11e7-a9a7-080027d1715f)"
]
  2m	2m	1	kubelet, minikube	spec.containers{weave}		Normal	Started		Started container with id 201e2588006a9074ca931f63647a3c787d6a1e6c8c85f7683a53b670f0f8ff5a
  2m	2m	1	kubelet, minikube	spec.containers{weave}		Normal	Created		Created container with id 201e2588006a9074ca931f63647a3c787d6a1e6c8c85f7683a53b670f0f8ff5a
  2m	2m	1	kubelet, minikube	spec.containers{weave-npc}	Normal	Created		Created container with id e3cb7c111cbaf31984b661d636ef716d1899c577b7ad690acb6a35e10608f824
  2m	2m	1	kubelet, minikube	spec.containers{weave-npc}	Normal	Started		Started container with id e3cb7c111cbaf31984b661d636ef716d1899c577b7ad690acb6a35e10608f824
  2m	2m	3	kubelet, minikube					Warning	FailedSync	Error syncing pod, skipping: [failed to "StartContainer" for "weave" with CrashLoopBackOff: "Back-off 20s restarting failed container=weave pod=weave-net-qn2m7_kube-system(a3a94243-67b0-11e7-a9a7-080027d1715f)"
, failed to "StartContainer" for "weave-npc" with CrashLoopBackOff: "Back-off 20s restarting failed container=weave-npc pod=weave-net-qn2m7_kube-system(a3a94243-67b0-11e7-a9a7-080027d1715f)"
]
  2m	2m	1	kubelet, minikube	spec.containers{weave}		Normal	Started		Started container with id 4bd2dbe7f43a077bdd8dda99ab49955a0a90fc017a8c3a0e2bc37e17eb6f916c
  2m	2m	1	kubelet, minikube	spec.containers{weave}		Normal	Created		Created container with id 4bd2dbe7f43a077bdd8dda99ab49955a0a90fc017a8c3a0e2bc37e17eb6f916c
  2m	2m	1	kubelet, minikube	spec.containers{weave-npc}	Normal	Created		Created container with id d1df6fb394e7667f323f9c10ca3d857a1e458f9723fad3516717bc643f6dfb74
  2m	2m	1	kubelet, minikube	spec.containers{weave-npc}	Normal	Started		Started container with id d1df6fb394e7667f323f9c10ca3d857a1e458f9723fad3516717bc643f6dfb74
  2m	2m	2	kubelet, minikube					Warning	FailedSync	Error syncing pod, skipping: [failed to "StartContainer" for "weave-npc" with CrashLoopBackOff: "Back-off 40s restarting failed container=weave-npc pod=weave-net-qn2m7_kube-system(a3a94243-67b0-11e7-a9a7-080027d1715f)"
, failed to "StartContainer" for "weave" with CrashLoopBackOff: "Back-off 40s restarting failed container=weave pod=weave-net-qn2m7_kube-system(a3a94243-67b0-11e7-a9a7-080027d1715f)"
]
  2m	1m	3	kubelet, minikube		Warning	FailedSync	Error syncing pod, skipping: [failed to "StartContainer" for "weave" with CrashLoopBackOff: "Back-off 40s restarting failed container=weave pod=weave-net-qn2m7_kube-system(a3a94243-67b0-11e7-a9a7-080027d1715f)"
, failed to "StartContainer" for "weave-npc" with CrashLoopBackOff: "Back-off 40s restarting failed container=weave-npc pod=weave-net-qn2m7_kube-system(a3a94243-67b0-11e7-a9a7-080027d1715f)"
]
  4m	1m	5	kubelet, minikube	spec.containers{weave}		Normal	Pulling		pulling image "weaveworks/weave-kube:2.0.1"
  3m	1m	5	kubelet, minikube	spec.containers{weave}		Normal	Pulled		Successfully pulled image "weaveworks/weave-kube:2.0.1"
  1m	1m	1	kubelet, minikube	spec.containers{weave}		Normal	Started		Started container with id 41a6115464c3c16c2537c9802ac763312adeff5701d6b942470b7622bca50718
  1m	1m	1	kubelet, minikube	spec.containers{weave}		Normal	Created		Created container with id 41a6115464c3c16c2537c9802ac763312adeff5701d6b942470b7622bca50718
  5m	1m	5	kubelet, minikube	spec.containers{weave-npc}	Normal	Pulling		pulling image "weaveworks/weave-npc:2.0.1"
  4m	1m	5	kubelet, minikube	spec.containers{weave-npc}	Normal	Pulled		Successfully pulled image "weaveworks/weave-npc:2.0.1"
  1m	1m	1	kubelet, minikube	spec.containers{weave-npc}	Normal	Created		(events with common reason combined)
  1m	1m	1	kubelet, minikube	spec.containers{weave-npc}	Normal	Started		(events with common reason combined)
  1m	1m	1	kubelet, minikube					Warning	FailedSync	Error syncing pod, skipping: failed to "StartContainer" for "weave" with CrashLoopBackOff: "Back-off 1m20s restarting failed container=weave pod=weave-net-qn2m7_kube-system(a3a94243-67b0-11e7-a9a7-080027d1715f)"

  1m	20s	6	kubelet, minikube		Warning	FailedSync	Error syncing pod, skipping: [failed to "StartContainer" for "weave" with CrashLoopBackOff: "Back-off 1m20s restarting failed container=weave pod=weave-net-qn2m7_kube-system(a3a94243-67b0-11e7-a9a7-080027d1715f)"
, failed to "StartContainer" for "weave-npc" with CrashLoopBackOff: "Back-off 1m20s restarting failed container=weave-npc pod=weave-net-qn2m7_kube-system(a3a94243-67b0-11e7-a9a7-080027d1715f)"
]
  1m	6s	2	kubelet, minikube		Warning	FailedSync	Error syncing pod, skipping: [failed to "StartContainer" for "weave-npc" with CrashLoopBackOff: "Back-off 1m20s restarting failed container=weave-npc pod=weave-net-qn2m7_kube-system(a3a94243-67b0-11e7-a9a7-080027d1715f)"
, failed to "StartContainer" for "weave" with CrashLoopBackOff: "Back-off 1m20s restarting failed container=weave pod=weave-net-qn2m7_kube-system(a3a94243-67b0-11e7-a9a7-080027d1715f)"
]
  3m	6s	37	kubelet, minikube	spec.containers{weave}	Warning	BackOff	Back-off restarting failed container

I am using minikube
minikube version: v0.20.0
kubectl version:

Client Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.0", GitCommit:"d3ada0119e776222f11ec7945e6d860061339aad", GitTreeState:"clean", BuildDate:"2017-06-29T23:15:59Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.4", GitCommit:"d6f433224538d4f9ca2f7ae19b252e6fcb66a3ae", GitTreeState:"dirty", BuildDate:"2017-06-22T04:31:09Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}
iptables v1.6.0
ipset v6.29, protocol version: 6

I am using Ubuntu 16.04 LTS

Kernel version: 4.8.0-58-generic #63~16.04.1-Ubuntu SMP Mon Jun 26 18:08:51 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

kubectl describe nodes output

Kernel Version:		4.9.13
OS Image:			Buildroot 2017.02
Operating System:		linux
Architecture:			amd64
Container Runtime Version:	docker://1.11.1
@marccarre
Copy link
Contributor

@dipakjadhav17, thanks for creating this issue.
Could you please share the logs of the weave and weave-npc containers for your weave-net-qn2m7 pod by running the below commands?

$ kubectl logs weave-net-qn2m7 -n kube-system weave
$ kubectl logs weave-net-qn2m7 -n kube-system weave-npc

@djshrshiv
Copy link
Author

djshrshiv commented Jul 13, 2017

kubectl logs weave-net-hn51g -n kube-system -c weave
modprobe: module xt_set not found in modules.dep
Ignore the error if "xt_set" is built-in in the kernel
ipset v6.29: Kernel error received: set type not supported
kubectl logs weave-net-hn51g -n kube-system -c weave-npc
INFO: 2017/07/13 10:49:04.092036 Starting Weaveworks NPC 2.0.1; node name "minikube"
INFO: 2017/07/13 10:49:04.092173 Serving /metrics on :6781
Thu Jul 13 10:49:04 2017 <5> ulogd.c:843 building new pluginstance stack: 'log1:NFLOG,base1:BASE,pcap1:PCAP'
DEBU: 2017/07/13 10:49:04.111437 Got list of ipsets: []
FATA: 2017/07/13 10:49:04.120597 ipset [create weave-local-pods hash:ip] failed: ipset v6.29: Kernel error received: set type not supported
: exit status 1

@bboreham
Copy link
Contributor

@dipakjadhav17 that last log says your kernel does not have the xt_set module, which we use to implement Kubernetes Network Policy in the weave-npc component.

Your options are to get a Linux kernel that does have it, or to disable weave-npc.

@djshrshiv
Copy link
Author

Thanks for repply
Is my Ubuntu 16.04 or minikube doesnot have xt_set module?

@marccarre
Copy link
Contributor

Minikube runs in a virtual machine, regardless of the host operating system, so given you said you tried Net within Minikube, that would most likely be your minikube causing the issue, i.e. you should see something like the below:

  1. Ubuntu 16.04 (Host OS):

     $ cat /etc/*release
     DISTRIB_ID=Ubuntu
     DISTRIB_RELEASE=16.04
     DISTRIB_CODENAME=xenial
     DISTRIB_DESCRIPTION="Ubuntu 16.04.2 LTS"
     NAME="Ubuntu"
     VERSION="16.04.2 LTS (Xenial Xerus)"
     ID=ubuntu
     ID_LIKE=debian
     PRETTY_NAME="Ubuntu 16.04.2 LTS"
     VERSION_ID="16.04"
     HOME_URL="http://www.ubuntu.com/"
     SUPPORT_URL="http://help.ubuntu.com/"
     BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
     VERSION_CODENAME=xenial
     UBUNTU_CODENAME=xenial
    
     $ uname -a
     Linux <hostname> 4.4.0-83-generic #106-Ubuntu SMP Mon Jun 26 17:54:43 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
    
     $ sudo modprobe xt_set
    

    Status: OK

  2. Minikube (Custom guest OS):

     $ minikube ssh
    
     minikube$ cat /etc/*release
     NAME=Buildroot
     VERSION=2017.02
     ID=buildroot
     VERSION_ID=2017.02
     PRETTY_NAME="Buildroot 2017.02"
     NAME=Buildroot
     VERSION=2017.02
     ID=buildroot
     VERSION_ID=2017.02
     PRETTY_NAME="Buildroot 2017.02"
    
     minikube$ uname -a
     Linux minikube 4.9.13 #1 SMP Fri Jun 16 20:55:02 UTC 2017 x86_64 GNU/Linux
    
     minikube$ sudo modprobe xt_set
     modprobe: FATAL: Module xt_set not found in directory /lib/modules/4.9.13
    

    Status: Error

@marccarre
Copy link
Contributor

marccarre commented Jul 14, 2017

@dipakjadhav17, note that you can start minikube with --iso-url= so it should be possible to find or come up with an image which has that module.
Moreover, it looks like:

  • the instructions to build a custom ISO for minikube live here,
  • the config to build the kernel lives here,

so I have never done that before, but adding CONFIG_NETFILTER_XT_SET=m there and building your own ISO should do the trick.
As discussed on Slack, I'll try this now and will report back. I'll open a PR for minikube if successful, so that it will "just work" with future versions.

@marccarre
Copy link
Contributor

Some progress but Net is still not working:

$ minikube start --vm-driver=virtualbox --memory=4096 --iso-url=file:///$(pwd)/out/minikube.iso
$ minikube ssh
minikube$ sudo modprobe xt_set
### <------------ No error printed this time
<ctrl+D>

$ kubectl apply -n kube-system -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
$ kubectl -n kube-system logs weave-net-t03l7 weave-npc
[...]
FATA: 2017/07/14 11:03:25.323180 ipset [create weave-local-pods hash:ip] failed: ipset v6.29: Kernel error received: set type not supported
: exit status 1

@marccarre
Copy link
Contributor

Looks like I might be missing some of these options:

CONFIG_IP_SET=m
CONFIG_IP_SET_MAX=256
CONFIG_IP_SET_BITMAP_IP=m
CONFIG_IP_SET_BITMAP_IPMAC=m
CONFIG_IP_SET_BITMAP_PORT=m
CONFIG_IP_SET_HASH_IP=m
CONFIG_IP_SET_HASH_IPMARK=m
CONFIG_IP_SET_HASH_IPPORT=m
CONFIG_IP_SET_HASH_IPPORTIP=m
CONFIG_IP_SET_HASH_IPPORTNET=m
CONFIG_IP_SET_HASH_MAC=m
CONFIG_IP_SET_HASH_NETPORTNET=m
CONFIG_IP_SET_HASH_NET=m
CONFIG_IP_SET_HASH_NETNET=m
CONFIG_IP_SET_HASH_NETPORT=m
CONFIG_IP_SET_HASH_NETIFACE=m
CONFIG_IP_SET_LIST_SET=m

See also here.
Will now rebuild the image with these.

@marccarre
Copy link
Contributor

Success!

$ kubectl get po --all-namespaces
NAMESPACE     NAME                          READY     STATUS    RESTARTS   AGE
kube-system   kube-addon-manager-minikube   1/1       Running   0          1m
kube-system   kube-dns-1301475494-gnf5w     3/3       Running   0          1m
kube-system   kubernetes-dashboard-z4xjb    1/1       Running   0          1m
kube-system   weave-net-bl6mm               2/2       Running   1          1m

PR on its way.

@marccarre
Copy link
Contributor

In case it could be useful to you @dipakjadhav17, it looks like the smallest diff making it working is:

$ git diff
diff --git a/deploy/iso/minikube-iso/board/coreos/minikube/linux-4.9_defconfig b/deploy/iso/minikube-iso/board/coreos/minikube/linux-4.9_defconfig
index 8d6e1f3..355ba38 100644
--- a/deploy/iso/minikube-iso/board/coreos/minikube/linux-4.9_defconfig
+++ b/deploy/iso/minikube-iso/board/coreos/minikube/linux-4.9_defconfig
@@ -188,7 +188,10 @@ CONFIG_NETFILTER_XT_MATCH_STRING=m
 CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
 CONFIG_NETFILTER_XT_MATCH_TIME=m
 CONFIG_NETFILTER_XT_MATCH_U32=m
+CONFIG_NETFILTER_XT_SET=m
 CONFIG_IP_SET=y
+CONFIG_IP_SET_HASH_IP=m
+CONFIG_IP_SET_LIST_SET=m
 CONFIG_IP_VS=m
 CONFIG_NF_CONNTRACK_IPV4=m
 CONFIG_NF_LOG_ARP=m

@marccarre
Copy link
Contributor

In case someone faces the same issue, the ISO containing the fix is available here, and the below commands may be useful:

$ minikube start --iso-url https://storage.googleapis.com/minikube-builds/1697/minikube-testing.iso
$ minikube config set iso-url https://storage.googleapis.com/minikube-builds/1697/minikube-testing.iso

@marccarre
Copy link
Contributor

Closing as the minikube PR has been merged.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants