deimosfr / ansible-coreos-kubernetes Goto Github PK
View Code? Open in Web Editor NEWAnsible role to deploy kubernetes on CoreOS Linux container for production usage
License: GNU General Public License v3.0
Ansible role to deploy kubernetes on CoreOS Linux container for production usage
License: GNU General Public License v3.0
Hi,
Since i run this kuberntes, and got following error:
`
TASK [wait for etcd port to be open] ****************************************************************************************************************************************
ok: [core-02]
fatal: [core-03]: FAILED! => {"changed": false, "elapsed": 301, "failed": true, "msg": "Timeout when waiting for 127.0.0.1:2379"}
fatal: [core-01]: FAILED! => {"changed": false, "elapsed": 301, "failed": true, "msg": "Timeout when waiting for 127.0.0.1:2379"}
TASK [get etcd current config for flanneld] *********************************************************************************************************************************
fatal: [core-02]: FAILED! => {"changed": false, "cmd": ["etcdctl", "get", "/coreos.com/network/config"], "delta": "0:00:00.018890", "end": "2017-12-15 09:37:52.140488", "failed": true, "msg": "non-zero return code", "rc": 4, "start": "2017-12-15 09:37:52.121598", "stderr": "Error: client: etcd cluster is unavailable or misconfigured; error #0: client: etcd member http://127.0.0.1:2379 has no leader\n; error #1: dial tcp 127.0.0.1:4001: getsockopt: connection refused\n\nerror #0: client: etcd member http://127.0.0.1:2379 has no leader\nerror #1: dial tcp 127.0.0.1:4001: getsockopt: connection refused", "stderr_lines": ["Error: client: etcd cluster is unavailable or misconfigured; error #0: client: etcd member http://127.0.0.1:2379 has no leader", "; error #1: dial tcp 127.0.0.1:4001: getsockopt: connection refused", "", "error #0: client: etcd member http://127.0.0.1:2379 has no leader", "error #1: dial tcp 127.0.0.1:4001: getsockopt: connection refused"], "stdout": "", "stdout_lines": []}
...ignoring
TASK [publishing network config to etcd] ************************************************************************************************************************************
fatal: [core-02]: FAILED! => {"changed": false, "cmd": ["/usr/bin/etcdctl", "set", "/coreos.com/network/config", "{ "Network": "10.1.0.0/16" }"], "delta": "0:00:00.020305", "end": "2017-12-15 09:37:52.593564", "failed": true, "msg": "non-zero return code", "rc": 4, "start": "2017-12-15 09:37:52.573259", "stderr": "Error: client: etcd cluster is unavailable or misconfigured; error #0: dial tcp 127.0.0.1:4001: getsockopt: connection refused\n; error #1: client: etcd member http://127.0.0.1:2379 has no leader\n\nerror #0: dial tcp 127.0.0.1:4001: getsockopt: connection refused\nerror #1: client: etcd member http://127.0.0.1:2379 has no leader", "stderr_lines": ["Error: client: etcd cluster is unavailable or misconfigured; error #0: dial tcp 127.0.0.1:4001: getsockopt: connection refused", "; error #1: client: etcd member http://127.0.0.1:2379 has no leader", "", "error #0: dial tcp 127.0.0.1:4001: getsockopt: connection refused", "error #1: client: etcd member http://127.0.0.1:2379 has no leader"], "stdout": "", "stdout_lines": []}
to retry, use: --limit @/Users/kevin/dotfiles-mac/work-envs/k8s-core-infrastructure/bootstrap-kubernetes.retry
PLAY RECAP ******************************************************************************************************************************************************************
core-01 : ok=6 changed=0 unreachable=0 failed=1
core-02 : ok=8 changed=0 unreachable=0 failed=1
core-03 : ok=6 changed=0 unreachable=0 failed=1
core-04 : ok=3 changed=0 unreachable=0 failed=0
core-05 : ok=3 changed=0 unreachable=0 failed=0
core-06 : ok=3 changed=0 unreachable=0 failed=0
localhost : ok=15 changed=2 unreachable=0 failed=0
`
I did not change anything in this role, and i login into core-02, 03, 01, and run:
etcdctl -C http://etcd:4001 cluster-health
I got following response:
`
core@core-02 ~ $ etcdctl -C http://etcd:4001 cluster-health
cluster may be unhealthy: failed to list members
Error: client: etcd cluster is unavailable or misconfigured; error #0: dial tcp: lookup etcd: no such host
error #0: dial tcp: lookup etcd: no such host
`
Could you help to check it, thanks!!!
Hi,
The k8s_openssl.cnf.j2
template was not working for me, the global counters were not incrementing in the inner loops thus rendering something like this:
[alt_names]
DNS.1 = kubernetes
DNS.2 = kubernetes.default
DNS.3 = kubernetes.default.svc
DNS.4 = kubernetes.default.svc.cluster.local
DNS.5 = k9s-api.virtual.local
DNS.5 = k9s01.virtual.local
DNS.5 = k9s02.virtual.local
DNS.7 = k9s03.virtual.local
IP.1 = 10.3.0.1
IP.1 = 192.168.0.154
IP.2 = 192.168.0.1
...
[req]
...
The following modified template using Namespaces with Jinja2 v2.10 renders the file correctly:
{% for item in k8s_openssl_config|sort %}
[{{ item }}]
{% if k8s_openssl_config[item] %}
{% for k in k8s_openssl_config[item]|sort %}
{% if k == 'DNS' %}
{% set ns = namespace(count=0) %}
{% for dns in k8s_openssl_config[item][k] %}
{{ k }}.{{ loop.index0 }} = {{ dns }}
{% set ns.count = ns.count + 1 %}
{% endfor %}
{% for host in groups['k8s-masters'] %}
{{ k }}.{{ ns.count }} = {{ host }}
{% set ns.count = ns.count + 1 %}
{% endfor %}
{% elif k == 'IP' %}
{% set ns = namespace(count=0) %}
{% for ip in k8s_openssl_config[item][k] %}
{{ k }}.{{ loop.index0 }} = {{ ip }}
{% set ns.count = ns.count + 1 %}
{% endfor %}
{% for ip in groups['k8s-masters']|map('extract', hostvars, ['priv_ip'])|list|sort %}
{{ k }}.{{ ns.count }} = {{ ip }}
{% set ns.count = ns.count + 1 %}
{% endfor %}
{% else %}
{{ k }} = {{ k8s_openssl_config[item][k] }}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
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.