2018-03-13 19:00:05 +08:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Kubernetes Apps | Lay Down KubeDNS Template
|
|
|
|
template:
|
|
|
|
src: "{{ item.file }}.j2"
|
|
|
|
dest: "{{ kube_config_dir }}/{{ item.file }}"
|
|
|
|
with_items:
|
|
|
|
- { name: kube-dns, file: kubedns-sa.yml, type: sa }
|
|
|
|
- { name: kube-dns, file: kubedns-deploy.yml, type: deployment }
|
|
|
|
- { name: kube-dns, file: kubedns-svc.yml, type: svc }
|
|
|
|
- { name: kubedns-autoscaler, file: kubedns-autoscaler-sa.yml, type: sa }
|
|
|
|
- { name: kubedns-autoscaler, file: kubedns-autoscaler-clusterrole.yml, type: clusterrole }
|
|
|
|
- { name: kubedns-autoscaler, file: kubedns-autoscaler-clusterrolebinding.yml, type: clusterrolebinding }
|
|
|
|
- { name: kubedns-autoscaler, file: kubedns-autoscaler.yml, type: deployment }
|
|
|
|
register: kubedns_manifests
|
|
|
|
when:
|
|
|
|
- dns_mode in ['kubedns','dnsmasq_kubedns']
|
|
|
|
- inventory_hostname == groups['kube-master'][0]
|
|
|
|
tags:
|
|
|
|
- dnsmasq
|
2018-08-08 02:53:36 +08:00
|
|
|
- kubedns
|
2018-03-13 19:00:05 +08:00
|
|
|
|
|
|
|
# see https://github.com/kubernetes/kubernetes/issues/45084, only needed for "old" kube-dns
|
|
|
|
- name: Kubernetes Apps | Patch system:kube-dns ClusterRole
|
|
|
|
command: >
|
|
|
|
{{ bin_dir }}/kubectl patch clusterrole system:kube-dns
|
|
|
|
--patch='{
|
|
|
|
"rules": [
|
|
|
|
{
|
|
|
|
"apiGroups" : [""],
|
|
|
|
"resources" : ["endpoints", "services"],
|
|
|
|
"verbs": ["list", "watch", "get"]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}'
|
|
|
|
when:
|
|
|
|
- dns_mode in ['kubedns', 'dnsmasq_kubedns']
|
|
|
|
- inventory_hostname == groups['kube-master'][0]
|
2018-10-17 06:33:30 +08:00
|
|
|
- rbac_enabled and kubedns_version is version("1.11.0", "<", strict=True)
|
2018-03-13 19:00:05 +08:00
|
|
|
tags:
|
|
|
|
- dnsmasq
|
2018-08-08 02:53:36 +08:00
|
|
|
- kubedns
|