vyshane / kid Goto Github PK
View Code? Open in Web Editor NEWUtility to launch Kubernetes in Docker
License: Apache License 2.0
Utility to launch Kubernetes in Docker
License: Apache License 2.0
Traceback (most recent call last):
File "/usr/bin/kid", line 9, in
load_entry_point('kid==0.9.6', 'console_scripts', 'kid')()
File "/usr/lib/python2.7/dist-packages/kid/run.py", line 102, in main
module = kid.load_template(f, name='main', cache=False)
File "/usr/lib/python2.7/dist-packages/kid/init.py", line 146, in load_template
"%s (in %s)" % (filename, ', '.join(path.paths)))
Running OS X El Capitan && Docker for Mac 1.12.
Upon ./kid up
I always get
Docker for Mac detected
docker: Error response from daemon: Mounts denied:
The path /var/lib/kubelet/
is not shared from OS X and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.
See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.
..
Waiting for Kubernetes cluster to become available...
until I SIGINT.
But in the "File Sharing" tab in Docker for Mac preferences the directory /private
is already set and /var
in OS X is a symlink to /private/var
, so whatever kid
needs in there should be shared already.
$ ls -l /
...
lrwxr-xr-x@ 1 root wheel 11 Mar 12 10:38 var -> private/var
Adding the subdirectory kubelet
did not help. Adding the path /var/lib/kubelet
to the File Sharing preferences is not possible since it resolves to /private/var/lib/kubelet
(because of the symlink) and then overlaps with the /private
share:
What to do?
When using kid up
, the following output is generated:
$ ./kid up
WARNING: No swap limit support
WARNING: No swap limit support
When adding set -x to the script, the following is outputted:
$ ./kid up
+ '[' up == up ']'
+ start_kubernetes 1.3.2 8080 31999 cluster.local 10.0.0.10
+ local kubernetes_version=1.3.2
+ local kubernetes_api_port=8080
+ local dashboard_service_nodeport=31999
+ local dns_domain=cluster.local
+ local dns_server_ip=10.0.0.10
+ check_prerequisites
+ require_command_exists kubectl
+ command -v kubectl
+ require_command_exists docker
+ command -v docker
+ require_command_exists socat
+ command -v socat
+ docker info
WARNING: No swap limit support
+ '[' 0 '!=' 0 ']'
++ active_docker_machine
++ docker-machine active
++ [[ 1 == 0 ]]
+ '[' -n ']'
+ fix_shared_mount /
+ path=/
+ docker run -it --rm --entrypoint=sh --privileged --net=host -e sysimage=/host -v /:/host -v /dev:/dev -v /run:/run gcr.io/google_containers/hyperkube-amd64:v1.3.2 -c 'nsenter --mount=$sysimage/proc/1/ns/mnt -- mount --make-shared /'
+ docker info
+ egrep -q 'Kernel Version: .*-moby'
WARNING: No swap limit support
It looks like the re-introduction of set -e
in 73ed577 causes the script to fail on
Removing the set -e
allows kid up
to run successfully.
I've tried setting KUBERNETES_VERSION=1.6.2 but although the correct hyperkube version is pulled (gcr.io/google_containers/hyperkube-amd64:v1.6.2) it fails to start correctly with Docker reporting the container as stopped.
Googling for "kubelet 1.6 in docker" there's a little bit of traffic that seems to talk of cgroup issues kubernetes/kubernetes#43704 but I've been unable to make any headway with any of the comments mentioned in the link, e.g.:
"So I think we have found a work around now, adding --cgroups-per-qos=false --enforce-node-allocatable="" solves the problem."
"I already have -v /sys:/sys:rw -v /sys/fs/cgroup:/sys/fs/cgroup:rw, or is that not enough or somehow not the right thing?"
"So in release#306 it's been mentioned that --cgroup-driver=systemd is another working solution for RHEL"
I tried tweaking the docker run command in the kid "start_kubernetes" function as follows:
docker run \
--name=kubelet \
--volume=/:/rootfs:ro \
--volume=/sys:/sys:rw \
--volume /sys/fs/cgroup:/sys/fs/cgroup:rw \
--volume=/var/lib/docker/:/var/lib/docker:rw \
--volume=/var/lib/kubelet/:/var/lib/kubelet:rw,shared \
--volume=/var/run:/var/run:rw \
--net=host \
--pid=host \
--privileged=true \
-d \
gcr.io/google_containers/hyperkube-amd64:v${kubernetes_version} \
/hyperkube kubelet \
--containerized \
--cgroups-per-qos=false --enforce-node-allocatable="" \
--cgroup-driver=systemd \
--hostname-override="127.0.0.1" \
--address="0.0.0.0" \
--api-servers=http://localhost:${kubernetes_api_port} \
--config=/etc/kubernetes/manifests \
--cluster-dns=$DNS_SERVER_IP \
--cluster-domain=$DNS_DOMAIN \
--allow-privileged=true --v=2 \
> /dev/null
To include some of the stuff mentioned, but no joy.
Have you managed to get k8s 1.6.x working? Any thoughts on what I might be missing?
FWIW I'm running Docker version 17.05.0-ce, build 89658be on Linux Mint (Ubuntu based distro)
MTIA.
"pindata" was removed from Docker beta 16 for Mac. According to https://news.ycombinator.com/item?id=11567442 localhost should be used by default
With docket beta for mac there is no need for virualbox and all that goes along with it.
I am wondering if this repo has been tried with it. ?
I am willing to test and feedback issues and fix where needed since my main language is golang & kid looks very useful.
I'm not really sure about how this is supposed to work (I'm new to Kubernetes). But I guess that my Kubernetes Services
with type LoadBalancers
should be accessible by their ports. And they are not. The pods are working fine though, with no errors.
Here is the example config:
apiVersion: v1
kind: Service
metadata:
name: name-nginx
labels:
app: name
spec:
ports:
- port: 80
targetPort: 8080
protocol: TCP
name: http
- port: 443
targetPort: 8081
protocol: TCP
name: https
selector:
app: name
tier: frontend
type: LoadBalancer
OS Version:
OS X El Capitan: 10.11.5 (15F34)
docker --version
: (It's Docker for Mac)
Docker version 1.12.0-rc3, build 91e29e8, experimental
Having reviewed the source code, I haven't found any process, that is going to launch etcd and flannel containers and services.
How they are going to be launched?
I have this error (on commit 75c9f52 all worked properly).
Env:
docker: Error response from daemon: linux mounts: Path /var/lib/kubelet is mounted on / but it is not a shared mount..
I'm trying to use kid
to set up Kubernetes on my workstation, which sits behind the usual corporate HTTP proxy. At hte moment kid
is blocking here:
$ kid up
WARNING: No swap limit support
Waiting for Kubernetes cluster to become available...
[..]
The Kubernetes setup process seems to be waiting on curl
:
$ pstree -a
systemd splash
.
.
|-docker daemon
| |-docker-containe -l /var/run/docker/libcontainerd/docker-containerd.sock --runtime docker-runc
| | |-docker-containe cf4e8b89c4f58f14c5df033eab3aff20a4a0ae8f10e5fc563c74b7137d934853...
| | | |-setup-files.sh /setup-files.sh...
| | | | `-make-ca-cert.sh /make-ca-cert.sh 136.156.124.222...
| | | | `-curl -L -O https://storage.googleapis.com/kubernetes-release/easy-rsa/easy-rsa.tar.gz
That curl
process was started by the gcr.io/google_containers/hyperkube-amd64:v1.2.4
image (see attached output of docker inspect
. It will not succeed, because it is trying to access https://storage.googleapis.com/kubernetes-release/easy-rsa/easy-rsa.tar.gz
directly, without using the HTTP/HTTPS proxy.
Is there a way to tell hyperkube
to use an HTTP proxy? Or to set the usual http_proxy
, https_proxy
and no_proxy
environment variables within the containers?
docker-inspect-cf4e8b89c4f58f14c5df033eab3aff20a4a0ae8f10e5fc563c74b7137d934853.txt
Hi Vyshane,
Kid is almost prefect to me until I run it on my Macbook:
I used a simple configmap, given /path/to/config/my-config.properties
kubectl create configmap my-config --from-file /path/to/config
then tried to mount it to a Deployment with Volumes and mountVolumes
spec:
containers:
- name: my-deployment
image: my-images:1
ports:
- containerPort: 10080
name: http
volumeMounts:
- mountPath: /optconfig
name: config
- mountPath: /opt/secret
name: secret
readOnly: true
volumes:
- name: config
configMap:
name: my-config
- name: secret
secret:
secretName: my-secret
So as a comparison, I also had a secret mounted, and turned out only the secret worked, that I can see files under the mounted path /opt/secret, however, the configmap mounted folder /opt/config is empty.
I've seen the same issue with kubernetes official one-node docker command on Mac, and desperately trying to find a solution, if you could please help ...
Thanks in advance
James
I got these errors when doing a kid up
but everything seems to work fine.
error validating "STDIN": error validating data: unexpected type: object; if you choose to ignore these errors, turn validation off with --validate=false
error validating "STDIN": error validating data: [unexpected type: object, unexpected type: object, unexpected type: object, unexpected type: object, unexpected type: object, unexpected type: object, unexpected type: object, unexpected type: object, unexpected type: object, unexpected type: object, unexpected type: object]; if you choose to ignore these errors, turn validation off with --validate=false
error validating "STDIN": error validating data: [unexpected type: object, unexpected type: object, unexpected type: object, unexpected type: object, unexpected type: object]; if you choose to ignore these errors, turn validation off with --validate=false
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.