-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kind pods in kube-system namespace are being restarted every 30s and are using wrong namespace when run within a k8s based jenkins pipeline #621
Comments
kind is not responsible for creating namespaces? you'll need to create these yourself |
can you show the logs? also note: to run successfully on kubernetes in docker in docker see #303 |
This observation is not quite correct, You can disable this on the outer cluster's pod with Also note that typically the default namespace is
This sounds like a resources issue in your cluster. Can't tell what without more details / logs, but ... You should also see #303. Sticking multiple layers of docker in docker requires more things to work properly. Running kind inside a Kubernetes pod is something we do ourselves for CI, but requires some special environmental setup that kind cannot do for you. |
I'm inclined to mark this as a duplicate of #303 with regards to issues running in a Kubernetes Pod. The namespaces issue might be worth documenting somewhere, but isn't really specific to kind. If you span up a cluster in the cloud or any other cluster deployment tool via your Jenkins pod you'd see the same kubectl behavior. 😬 This is working as intended from the point of view of the outer cluster, and not controllable by kind (nor should it be). |
Hi, thanks for pointing me to #303, this issues does indeed sound like a duplicate. Is there any way to solve this without having to access host directories via hostpath? In our case that's not possible due to security concerns :/ |
I haven't found one yet. In particular you really do want the host's modules to be picked up by some things and you want the first docker in docker to get the host's cgroups mounts. It might be possible to work out without those but once we're running privileged pods we sorta treat that node as insecure and move on... 😬 |
Those mounts should be on the dind container fwiw. |
Yeah, I now got it running fine in a minikube setup, not sure how to handle the hostpath issue, but that has nothing do to with kind. Thanks for your help :) |
Hi,
we are currently trying to get kind running in our jenkins CI which in turn is running in kubernetes. It's basically kubernetes in docker in jenkins in kubernetes.
What happened:
Cluster creation with kind finishes without errors and (after setting kubeconfig) "kubectl cluster-info" returns
This seems to be fine. It's not possible to do anything with the cluster though as all commands either fail to execute or seem to not have any effect.
Observation 1:
Many commands are trying to use the namespace of the jenkins k8s cluster which obviously doesn't exist in kind, despite configuring kubectl to use kind:
When run with "-n default" the above command does create a deployment in kind default namespace.
Interestingly, "kubectl get po" correctly uses the kind default namespace and doesn't complain about non existing jenkins namespaces (after setting the kubeconfig):
Observation 2:
Pods in kube-system namespace are being restarted once every 30s, initial pod creation can be delayed up to 20min:
Observation 3:
Some of the pods in kube-system namespace are also trying to use the jenkins namespace:
Observation 4:
One in two kubectl commands outright fails with:
Unable to connect to the server: EOF
What you expected to happen:
KInd cluster should start fully without any interference from "higher level" kubernetes namespaces. Pod creation should work normally.
How to reproduce it (as minimally and precisely as possible):
I'm able to reproduce this locally when running jenkins 2.177 in minikube v1.0.1 (I don't think the versions matter to much though). This is the podTemplate I'm using:
Anything else we need to know?:
We tried giving more recourses to the pod but that didn't help.
Environment:
kind version
): 0.3.0kubectl version
):Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.2",
Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.2",
docker info
):/etc/os-release
):NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.9.4
PRETTY_NAME="Alpine Linux v3.9"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"
We really would like to use kind for e2e testing and similar things, so any help is appreciated :)
The text was updated successfully, but these errors were encountered: