-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Using alpine linux image causes deployment issues to kubernetes #474
Comments
I actually do not know anything about kubernetes. Need some help here. Also, it'll be good to know how you setup everything, for others to try to reproduce it. |
Well, "what is Kubernetes" could end up being a big question. Quoting "https://kubernetes.io/":
Something similar to docker swarm, if that help. Now, developers normally don't setup Kubernetes locally. There is a lot of networking and operational detail to learn which could be overwhelming if one would want to stay productive and focused. Instead, Google built Minikube, which is a single node Kubernetes cluster running inside a VM. So you'll need a virtualisation infrastructure in your local dev environment. I personally use This is a really good guideline on how to setup minikube: https://thenewstack.io/tutorial-configuring-ultimate-development-environment-kubernetes/ As for this particular bug, I basically rebuilt the docker image from "scratch" and solved the problem that way. Here are some details: Docker file:
The script that uses the docker file to build my image:
In order to deploy this image to minikube in form of "pods" and "services", we need Yaml files. Quickly explaining what POD and Service are:
The yaml file (weed.yml) that creates the master POD:
The yaml file (weed2.yml) that creates the volume POD:
And the yaml file (weed3.yml) that create a service exposing both PODs to outside the cluster:
You can then run them using
You can then try calling the APIs:
minikubecluster in my environment resolves to the IP address of the minikube's VM which you can get using One more thing to note is those directories in the yaml files (e.g.: /var/containerdata/haystack/volume). You'll need to create them manually before deploy your stuff. You can do so by SSHing into the minikube's VM (using
|
Thanks for the detailed steps! Myself do not really understand the details. But I feel this would be helpful to some Kurbernetes users. Could you please turn this into some sort of tutorial? |
Where do you intend to keep the tutorial? |
https://github.com/chrislusf/seaweedfs/wiki Not sure whether you have permission. If not, just post it here and I can copy to the wiki. |
@gheibia did you find any workaround? could an Ubuntu base image work? Having the same issue, tried to update the alpine image to 3.6 and have the same error, DNS discovery does not work. EDIT: Didn't see that you used a different dockerfile. In that way and splitting the deployment in two different deployments worked for me. Thanks! |
@kartojal I never tried Ubuntu for this application. There were quite a few things that needed changing. Also, I didn't really need anything but the application itself (thus building it from "scratch"). But I've deployed Ubuntu based containers in general to Kubernetes. So I don't see why not. |
Tried with a minidebian image and got the same results. Still can not use the Service IP inside the Volume pod. But outside the pod i can call to the master server with the Service IP. What changes you did to got it working? 😄 |
To the application, none. I just used the "scratch" image and compiled the application as a self contained binary. See my steps and explanation above. |
Please note though that I'm pulling the latest revision of the code. You might wanna pull the latest stable release instead. |
Hi there, I used the latest docker image and I deployed it on kubernetes. My master servers will always re-elect leaders when any one of them gets shut down or reboot;I am trying to achieve high availability so I am doing some testing right now. I don't have such issue when I run weedfs on localhost. Have you met this problem? Do you have any clue about what might cause this? |
This is a BUG report.
I'm using 0.74 version. After building the docker image and deploying to kubernetes, I noticed that volume service is failing to find its master.
As it can be seen from the logs, the volume is struggling to find its master. Searching after the nslookup error (*can't resolve '(null)': *) I came across this:
https://github.com/gliderlabs/docker-alpine/blob/master/docs/caveats.md#dns
The text was updated successfully, but these errors were encountered: