Git Product home page Git Product logo

kubernetes-sigs / kubespray Goto Github PK

View Code? Open in Web Editor NEW
15.4K 317.0 6.3K 23.4 MB

Deploy a Production Ready Kubernetes Cluster

License: Apache License 2.0

Shell 6.08% Python 5.63% HCL 12.41% Smarty 0.14% Makefile 0.08% Dockerfile 0.33% HTML 0.09% Ruby 0.15% Jinja 75.09%
kubernetes-cluster ansible kubernetes high-availability bare-metal gce aws kubespray k8s-sig-cluster-lifecycle hacktoberfest

kubespray's Issues

Automated tests : tasks sequence

Below is a list of tasks in order to automate cluster deployment tests :

  • Test on the main linux distribs :
    • Fedora
    • Centos 7
    • RedHat 7
    • Ubuntu 1404
    • Ubuntu 1510
    • Debian 8
  • One test per network plugin
  • Idealy a cluster will be composed of
    • a master (master components only)
    • a master with node components (handles workloads)
    • a node

Test sequence:

  • Cluster deployment
  • Check all nodes ready
  • Run a replica controller composed of 2 pods
kubectl run test --image=busybox --replicas=2 --command -- tail -f /dev/null
replicationcontroller "test" created
  • Check that pods ip addresses are in the configured subnet
kubectl describe po test-34ozs | grep ^IP
IP:             10.233.16.2

kubectl exec test-34ozs -- ip a show dev eth0
8: eth0@if9: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1450 qdisc noqueue
    link/ether 02:42:0a:e9:2b:03 brd ff:ff:ff:ff:ff:ff
    inet 10.233.16.2/24 scope global eth0
  • Ping between pods
  • Deploy the kubedns app and browse the kubernetes api using the service name as follows
kubectl exec test-f31yx -- curl -k -u kube:changeme https://kubernetes

Resources manifests/yaml backup

Currently, the script sends all manifests to master[0] in /etc/k8s/manifestsand then use kubectl to create the resources.
I think we all agree that is better to use API so the question is what do we do about resource manifests?

  1. Use API only, the manifests don;t need to be stored
  2. Use API only and store manifests in the deploy machine
  3. Use API only and store manifests in one of the masters
  4. (complete)

From my side

  • I like to see the manifests so not the 1.
  • 2 is fine, but deploy machine can be any. And if someone else from the team deploy, I may not have access to the manifests.
  • I like 3 :), @Smana I know you don't, can you explain why?

resolve all python dependencies

fatal: [node1] => Failed to template {{ kube_service_addresses|ipaddr('net')|ipaddr(1)|ipaddr('address') }}: The ipaddr filter requires python-netaddr be installed on the ansible controller

ha master: kubernetes service has only only one endpoint

I just notice that the kubernetes service only have one endpoint in a multi master architecture.

Name:           kubernetes
Namespace:      default
Labels:         component=apiserver,provider=kubernetes
Selector:       <none>
Type:           ClusterIP
IP:         10.233.0.1
Port:           <unnamed>   443/TCP
Endpoints:      10.115.99.41:443
Session Affinity:   None
No events.

Document ansible usage

Some users use ansible for the first time, I think a quick note/doc-link about options and configuration would be good.

Fail with sudoer user

failed: [10.206.41.5 -> localhost] => {"cmd": "rsync --delay-updates -F --compress --times --rsh 'ssh -S none -o StrictHostKeyChecking=no' --out-format='<>%i %n%L' "/tmp/releases/kubernetes/bin/kubelet" "[email protected]:/usr/local/bin/kubelet"", "failed": true, "rc": 23}
msg: rsync: mkstemp "/usr/local/bin/.kubelet.kPJDLA" failed: Permission denied (13)

Don't run apiserver as pod

We noticed that it was tricky to notify the apiserver about changes (e.g. add when a new node is added #47 ).
We've decided that core kubernetes components like etcd or apiserver should be running as host services.

Remove downloader host

We faced issues with synchronize module and using 'copy' had too much constraint.

I propose that each nodes download their dependencies, it will then remove the need to copy/rsync binaries from node to node.

I'll probably work again on the 'downloader' host later as it can be usefull in somecase (later)

Use systemd as the unique init system

I think it would be easier to manage only systemd init linux distribs.
All the main linux distribs have made that choice, even ubuntu is switching to it.

@ant31 : what is your opinion ? is it possible to use a systemd OS with travis ?

apps seem to fail because of unicode in templates

This is more for questions to @ant31 and @Smana.

I'm trying to use the apps (kube-dns, and others). I'm getting errors with all of them because the files to be fed into kubectl have unicode string in them. The problem appears to be that python structure dumps into the kube templates causes u'ddd' style unicode string. This isn't supported by kubectl. I've found a fix for them, but they will hit pretty much all of the k8s-XXX modules. I've added to_nice_json to many of the vars for printing into the files.

I was wondering if you have this working or haven't tried it recently.

Remove systemd depedencie

Using systemd unit should be optionnal.

This include rework on following roles:

  • etcd
  • dnsmasq
  • calico-node
  • kubelet

Configure firewall.

I see two options:

  1. configure with ansible the firewall
  2. Create a 'firewall' controller daemon that check services and ingress

using ansible_default_ipv4 cause issues

In the file /etc/network-environment
The default ipv4 in took from the first interface only. But it should be possible to set ip from differents interface

DEFAULT_IPV4=

Don't run etcd as pod

I had an issue on reboot with etcd as pod.

It looks like kubelet continue to try restarting same pods, and pods failed to start because etcd was not 'on'.

We should rollback and use an etcd not-managed by kubernetes.

Kubelet on masters?

I propose to run kubelet on all nodes. It will allow to use pod manifests to bootstrap services like etcd.

---   
- hosts: k8s-cluster
 roles: 
    - { role: docker, tags: docker }
    - { role: kubernetes/kubelet, tags: kubelet }
    - { role: etcd, tags: etcd }  
    - { role: dnsmasq, tags: dnsmasq }
    - { role: network_plugin, tags: ['calico', 'flannel', 'network'] }

- hosts: k8s-node
  roles:
    - { role: kubernetes/node, tags: node }

- hosts: kube-master
  roles:
    - { role: kubernetes/master, tags: master }

initial deployment fails with multiple masters

Currently, the deployment fails at the first deployment.
The apiserver is restarted multiple times and when the handlers are played i have the following output for an unknown reason:

NOTIFIED: [kubernetes/master | restart kube-apiserver] ************************ 
failed: [node2] => {"failed": true}
msg: Job for kube-apiserver.service failed. See 'systemctl status kube-apiserver.service' and 'journalctl -xn' for details.

The logs don't help very much

Jan 24 15:29:54 kubenode2 kube-apiserver[4192]: [restful] 2016/01/24 15:29:54 log.go:30: [restful/swagger] listing is av
Jan 24 15:29:54 kubenode2 kube-apiserver[4192]: [restful] 2016/01/24 15:29:54 log.go:30: [restful/swagger] https://10.11
Jan 24 15:29:55 kubenode2 kube-apiserver[4192]: F0124 15:29:55.343958    4192 controller.go:80] Unable to perform initia
Jan 24 15:29:55 kubenode2 systemd[1]: kube-apiserver.service: main process exited, code=exited, status=255/n/a
Jan 24 15:29:55 kubenode2 systemd[1]: Failed to start Kubernetes API Server.
Jan 24 15:29:55 kubenode2 systemd[1]: Unit kube-apiserver.service entered failed state.

I guess the error is caused by a missing controller-manager but i'm not sure

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.