jonlangemak / ansible_kubernetes Goto Github PK
View Code? Open in Web Editor NEWAn Ansible role designed to install and configure a Kubernetes cluster
An Ansible role designed to install and configure a Kubernetes cluster
Hi there,
I am very new to kubernetes and tried following your post about using sensible to deploy a local cluster. Ansible playbook run completes with no errors, but when I try to get cluster-info or get pods, I get the following error:
$kubectl get pods
The connection to the server localhost:8080 was refused - did you specify the right host or port
Even if I do specify the --server option, I get a similar error.
thanks for your help and excellent posts
Hi Jon,
Thank you very much for the tutorial (http://www.dasblinkenlichten.com/getting-started-kubernetes-using-ansible/) , it Rocks... :) .
Today I tried to reproduce it on my lab and everything was passing perfect, until i tried to find Pod networking allocation with:
kubectl get nodes --output=jsonpath='{range .items[*]}{.status.addresses[?(@.type=="InternalIP")].address} {.spec.podCIDR} {"\n"}{end}' which failed.
I'm not sure but maybe files/systemd_templatez/kube-controller-manager.service
should be corrected with:
diff files/systemd_templatez/kube-controller-manager.service files/systemd_templatez/kube-controller-manager.service.orig
"+" --allocate-node-cidrs=true
"+" --cluster-cidr={{ cluster_info.cluster_node_cidr }} \
"-" --allocate-node-cidrs=false \
Regards,
Radoslav Mitov
Hi Jon,
just found that if the networking should work as in the example from http://www.dasblinkenlichten.com/getting-started-kubernetes-using-ansible
The following changes should be applied in files/systemd_templatez/kubelet.service
"+" --network-plugin=kubenet
"+" --non-masquerade-cidr={{ cluster_info.cluster_node_cidr }} \
"-" --network-plugin=cni
Regards,
Radoslav Mitov
You mention it - but its not actually set in vars/main.yml
Hi Jon,
I got the following error messages when running ansible-playbook on my Ubuntu-1 master node.
ben.le@labs-ubuntu-k8-001:~$ ansible-playbook k8s_isntall.yml --ask-become-pass
SUDO password:
ERROR! Unexpected Exception: sequence item 0: expected string, AnsibleMapping found
to see the full traceback, use -vvv
ben.le@labs-ubuntu-k8-001:~$ ansible-playbook k8s_isntall.yml --ask-become-pass -vvv
Using /etc/ansible/ansible.cfg as config file
SUDO password:
ERROR! Unexpected Exception: sequence item 0: expected string, AnsibleMapping found
the full traceback was:
Traceback (most recent call last):
File "/usr/bin/ansible-playbook", line 109, in
exit_code = cli.run()
File "/usr/lib/python2.7/dist-packages/ansible/cli/playbook.py", line 154, in run
results = pbex.run()
File "/usr/lib/python2.7/dist-packages/ansible/executor/playbook_executor.py", line 81, in run
pb = Playbook.load(playbook_path, variable_manager=self._variable_manager, loader=self._loader)
File "/usr/lib/python2.7/dist-packages/ansible/playbook/init.py", line 54, in load
pb._load_playbook_data(file_name=file_name, variable_manager=variable_manager)
File "/usr/lib/python2.7/dist-packages/ansible/playbook/init.py", line 99, in _load_playbook_data
entry_obj = Play.load(entry, variable_manager=variable_manager, loader=self._loader)
File "/usr/lib/python2.7/dist-packages/ansible/playbook/play.py", line 115, in load
data['name'] = ','.join(data['hosts'])
TypeError: sequence item 0: expected string, AnsibleMapping found
Any suggestions?
Hello,I'm trying this on openstack machines (ip's like 10.97.177....).
The installation has finished with no error but when i try to check the etcd cluster it's down
kubectl get componentstatus
NAME STATUS MESSAGE ERROR
controller-manager Healthy ok
etcd-0 Unhealthy Get https://192.168.0.49:2379/health: x509: certificate is valid for 10.11.12.1, 127.0.0.1, 10.97.177.xx, 10.97.177.xx, 10.97.177.xx, 10.97.177.xx, 10.97.177.xx, not 192.168.0.49
scheduler Healthy ok
What i've changed is:
I don't understand why the etcd cluster it's down.
Please advice.
Thank You
hello
can you giveme a hint why i get this bad cert error ?
kubectl get componentstatus
NAME STATUS MESSAGE ERROR
scheduler Healthy ok
controller-manager Healthy ok
etcd-0 Unhealthy Get https://host01:2379/health: remote error: tls: bad certificate
I tried everything, but IO can't get out of the NotReady state.
However, kubectl get componentstatus is fine
I noticed some etcd errors. I also wonder if the older aAnsible cluster building posting still works with the new Calico centric GitHub changes
Is it OK that calicoctl.cfg in the endpoints use the IP in etcdendpoint ?
/etc/cni was not created but it is referred to in /etc/calico/calicoctl.cfg
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.