You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.6 KiB

  1. ---
  2. - name: Kubernetes Apps | Lay Down KubeDNS Template
  3. template:
  4. src: "{{ item.file }}.j2"
  5. dest: "{{ kube_config_dir }}/{{ item.file }}"
  6. with_items:
  7. - { name: kube-dns, file: kubedns-sa.yml, type: sa }
  8. - { name: kube-dns, file: kubedns-deploy.yml, type: deployment }
  9. - { name: kube-dns, file: kubedns-svc.yml, type: svc }
  10. - { name: kubedns-autoscaler, file: kubedns-autoscaler-sa.yml, type: sa }
  11. - { name: kubedns-autoscaler, file: kubedns-autoscaler-clusterrole.yml, type: clusterrole }
  12. - { name: kubedns-autoscaler, file: kubedns-autoscaler-clusterrolebinding.yml, type: clusterrolebinding }
  13. - { name: kubedns-autoscaler, file: kubedns-autoscaler.yml, type: deployment }
  14. register: kubedns_manifests
  15. when:
  16. - dns_mode in ['kubedns','dnsmasq_kubedns']
  17. - inventory_hostname == groups['kube-master'][0]
  18. tags:
  19. - dnsmasq
  20. - kubedns
  21. # see https://github.com/kubernetes/kubernetes/issues/45084, only needed for "old" kube-dns
  22. - name: Kubernetes Apps | Patch system:kube-dns ClusterRole
  23. command: >
  24. {{ bin_dir }}/kubectl patch clusterrole system:kube-dns
  25. --patch='{
  26. "rules": [
  27. {
  28. "apiGroups" : [""],
  29. "resources" : ["endpoints", "services"],
  30. "verbs": ["list", "watch", "get"]
  31. }
  32. ]
  33. }'
  34. when:
  35. - dns_mode in ['kubedns', 'dnsmasq_kubedns']
  36. - inventory_hostname == groups['kube-master'][0]
  37. - rbac_enabled and kubedns_version|version_compare("1.11.0", "<", strict=True)
  38. tags:
  39. - dnsmasq
  40. - kubedns