c12s-kubespray/roles/kubernetes/master/tasks/kube-init.yml
Bogdan Dobrelya 6fa44458db Add kubeadm init, join
* Implement kubeadm init,join for Debian OS family (PoC) with
  the external etcd option set.
* Make certs/tokens management optional and depending on
  the use_kubeadm var
* Do not delegate static pods and config management to kubeadm
  and remove produced artifacts to be regenerated by ansible.
* Add new set of system pods manifests templates based on that kubeadm
  produces by default and parametrize it by ansible vars
* Fix apiserver container logging to follow 12-factor apps
  and scheduler/controller-manager logging setup

Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
2016-10-20 11:34:13 +02:00

25 lines
1.1 KiB
YAML

---
- name: check for bootstrap
command: kubectl get nodes
register: kube_bootstrap
ignore_errors: true
- name: initialize the kubernetes master
command: "kubeadm init --token {{ init_token }} \
--api-advertise-addresses {{ kube_apiserver_access_address }} \
--service-cidr {{ kube_service_addresses }} \
--external-etcd-endpoints {{ etcd_access_addresses }} \
--service-dns-domain {{ cluster_name }} \
{% if cloud_provider is defined %}--cloud-provider {{ cloud_provider }}{% endif %}"
when: "'localhost:8080 was refused' in kube_bootstrap.stderr"
register: initout
ignore_errors: true
# NOTE(bogdando) we want ansible to control configs/manifests instead of kubeadm, yet
- name: purge kube manifests created by kubeadm
file: path="{{ kube_manifest_dir }}/{{ item }}.json" state=absent
with_items: [ "kube-controller-manager", "kube-apiserver", "kube-scheduler" ]
- name: purge kube configs created by kubeadm
file: path="{{ kube_config_dir }}/{{ item }}.conf" state=absent
with_items: [ "kubelet", "admin" ]