kubernetes-up-and-running / kuard

Demo app for Kubernetes Up and Running book
Apache License 2.0
1.56k stars 535 forks source link

make build fails on Fedora 27 #18

Closed nandanlbhat closed 6 years ago

nandanlbhat commented 6 years ago

I am trying to follow along in the book

Docker is from Fedora repo. Daemon is up and running. hello-world container ran fine and gave some output on screen.

But I get errors on following steps outlined in README.md

[root@kube1 01]# git clone https://github.com/kubernetes-up-and-running/kuard Cloning into 'kuard'... remote: Counting objects: 1303, done. remote: Total 1303 (delta 0), reused 0 (delta 0), pack-reused 1303 Receiving objects: 100% (1303/1303), 2.08 MiB | 580.00 KiB/s, done. Resolving deltas: 100% (428/428), done. [root@kube1 01]# ls Dockerfile kuard [root@kube1 01]# cd kuard [root@kube1 kuard]# ls build client cmd Dockerfile.build Dockerfile.kuard docs Godeps LICENSE Makefile pkg README.md rules.mk sitedata testscripts vendor [root@kube1 kuard]# make build container: kuard-build /usr/bin/docker-current: Error response from daemon: invalid bind mount spec "kuard-build-data:/data:delegated": invalid mode: delegated. See '/usr/bin/docker-current run --help'. make: *** [rules.mk:93: .kuard-build-container] Error 125

jbeda commented 6 years ago

Your version of Docker is too old. The delegated mode requires a new-ish Docker.

You can fix this with make build DOCKER_MOUNT_OPTION=. I'll update the README at some point to call this out.

nandanlbhat commented 6 years ago

Using kubernetes with docker-ce is also not workable. kubelet.service fails on node.

Please suggest a neutral method to follow the book.

jbeda commented 6 years ago

@nandanlbhat I'm confused -- what does the kubelet have to do with this issue? Are you having problems building kuard or getting kubernetes running. More detail is needed in any case.

Wrt building kuard, can you confirm that if make build DOCKER_MOUNT_OPTION= worked or not?

nandanlbhat commented 6 years ago

Hi Joe,

You are absolutely right. My problem is standing up a Kubernetes cluster on Fedora 27.

Right now, I am getting nowhere with these guides:

https://github.com/Praqma/LearnKubernetes/blob/master/kamran/Kubernetes-Fedora-Multi-node.md http://kubernetes.io/docs/getting-started-guides/fedora/fedora_manual_config/ http://kubernetes.io/docs/getting-started-guides/fedora/flannel_multi_node_cluster/

I have 6 VMs, 2 GB RAM, 10 GB HDD. One is called kubemaster and the others kube1, kube2, kube3, kube4 and kube5.

I am trying out the guide at https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/ and https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-init/ . But for most part, the build process is a bit opaque to me. Right now, I don't care. As long as I get to try out the examples in the book now, I would be trying to understand the setup process later. If I have difficulties with this guide, I will be generally sending out SOS to anyone listening.

nandanlbhat commented 6 years ago

After following kubeadm init with flannel configuration, I re-tried the kuard build and saw a different error:

[root@kubemaster kuard]# make build container: kuard-build Sending build context to Docker daemon 10.55 MB Step 1/10 : FROM golang:1.7-alpine Trying to pull repository docker.io/library/golang ... sha256:3f79ea057ef12518935ad981f62637d046a033eb10d28d5203c048837fedee58: Pulling from docker.io/library/golang 90f4dba627d6: Pulling fs layer 6ca70669e0c7: Pulling fs layer 8afccc587e11: Pulling fs layer 5d5d4c33684a: Pulling fs layer 6865c91bf9e0: Pulling fs layer 24ec77c4f34d: Pulling fs layer 5d5d4c33684a: Waiting 6865c91bf9e0: Waiting 24ec77c4f34d: Waiting 90f4dba627d6: Verifying Checksum 90f4dba627d6: Download complete 8afccc587e11: Verifying Checksum 8afccc587e11: Download complete 90f4dba627d6: Pull complete 6ca70669e0c7: Verifying Checksum 6ca70669e0c7: Download complete 6865c91bf9e0: Verifying Checksum 6865c91bf9e0: Download complete 6ca70669e0c7: Pull complete 8afccc587e11: Pull complete 24ec77c4f34d: Verifying Checksum 24ec77c4f34d: Download complete 5d5d4c33684a: Verifying Checksum 5d5d4c33684a: Download complete 5d5d4c33684a: Pull complete 6865c91bf9e0: Pull complete 24ec77c4f34d: Pull complete Digest: sha256:3f79ea057ef12518935ad981f62637d046a033eb10d28d5203c048837fedee58 Status: Downloaded newer image for docker.io/golang:1.7-alpine ---> 974aa102bae2 Step 2/10 : WORKDIR /data ---> 5b43c7811cc3 Removing intermediate container 90d157a1f8c5 Step 3/10 : ENV GOPATH /data/go ---> Running in 3ce4d9e8a602 ---> d6e03d98e7f4 Removing intermediate container 3ce4d9e8a602 Step 4/10 : ENV npm_config_cache /data/npm_cache ---> Running in 82e94250b16b ---> ad4c04546b60 Removing intermediate container 82e94250b16b Step 5/10 : ARG ALL_ARCH ---> Running in 61ba11502097 ---> 014e49bce85e Removing intermediate container 61ba11502097 Step 6/10 : ENV ALL_ARCH ${ALL_ARCH} ---> Running in 2ec27aa55494 ---> d2c962617971 Removing intermediate container 2ec27aa55494 Step 7/10 : RUN for ARCH in ${ALLARCH}; do ln -s -f "/data/std/${ARCH}" "/usr/local/go/pkg/linux${ARCH}_static" ; done ---> Running in 0bad751acd4f ---> fde2e6f3b366 Removing intermediate container 0bad751acd4f Step 8/10 : RUN apk update && apk upgrade && apk add --no-cache git nodejs bash ---> Running in 77a81ed39838 fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.4/main: temporary error (try again later) WARNING: Ignoring APKINDEX.167438ca.tar.gz: No such file or directory fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.4/community: temporary error (try again later) WARNING: Ignoring APKINDEX.a2e6dac0.tar.gz: No such file or directory 2 errors; 12 distinct packages available The command '/bin/sh -c apk update && apk upgrade && apk add --no-cache git nodejs bash' returned a non-zero code: 2 make: *** [rules.mk:90: .kuard-build-container] Error 2

The url is not workable at the moment. Error I see in Firefox for http://dl-cdn.alpinelinux.org/:

Error 503 Backend is unhealthy

Backend is unhealthy Guru Mediation:

Details: cache-ams4148-AMS 1519084446 3198040633

Varnish cache server

jbeda commented 6 years ago

This looks like an error trying to talk to the package servers for alpine. It could be a transient thing or it could be that something is messed up with the networking of your node.

FWIW, it is rare for people to do developments and builds on the same machine that they are using to run their cluster. Most of the time people have a different set of machines for doing builds and development and the cluster is just for deployment. Over time more targeted runtimes (CRI-O or containerd instead of docker) won't support building in this way.

nandanlbhat commented 6 years ago

Hi Joe,

I am happy to say the docker build step worked fine (only with make build DOCKER_MOUNT_OPTION=).

Thanks for your help.

BTW, I understand the reasoning for keeping the cluster isolated from development efforts. But, I am just curious to try out the steps in the book and it is easy for me to set up a test bed with virtual machines on my laptop.

I must say, I found the kubeadm init style of putting up a cluster is very convenient for my laptop as well. After some time, I guess I have to go with Kubernetes The Hard Way.

rachmatowicz commented 5 years ago

I had the same problem as described in this issue on Fedora 27. After investigating the meaning of 'delegated', I found it was a volume mount option used to improve performance on certain operating systems. It also appears only in more recent versions of Docker CE (17.04+). The Fedora version of Docker is based on projectatomic which is in turn based on moby, what appears to be the Docker upstream; projectatomic's Docker is quite out of date with respect to moby, which is really unfortunate for Fedora users, and results in 'delegated' not being recognized. In any case, once I found it was an optimization, I just got rid of all 'delegated' keywords on the volume mounts and the problem disappeared. Following this, SE Linux complained a lot about privileged operations being executed, so I just disabled SE Linux temporarily for the build. No problems after that.