Browse Source

add support for using ansible 2.10.x for deploying kubespray (#7600)

* add support for using ansible 2.10.x for deploying kubespray

* move dns-autoscaler-clusterrole{binding}.yml to files/ folder

* note that ansible 2.10 is now experimentally supported

* coredns: move files to templates like before #4341
pull/7621/head
Cristian Calin 3 years ago
committed by GitHub
parent
commit
e9870b8d25
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 16 additions and 17 deletions
  1. 2
      README.md
  2. 2
      ansible_version.yml
  3. 29
      roles/kubernetes-apps/ansible/tasks/coredns.yml
  4. 0
      roles/kubernetes-apps/ansible/templates/coredns-clusterrole.yml.j2
  5. 0
      roles/kubernetes-apps/ansible/templates/coredns-clusterrolebinding.yml.j2
  6. 0
      roles/kubernetes-apps/ansible/templates/coredns-sa.yml.j2
  7. 0
      roles/kubernetes-apps/ansible/templates/dns-autoscaler-clusterrole.yml.j2
  8. 0
      roles/kubernetes-apps/ansible/templates/dns-autoscaler-clusterrolebinding.yml.j2
  9. 0
      roles/kubernetes-apps/ansible/templates/dns-autoscaler-sa.yml.j2

2
README.md

@ -162,7 +162,7 @@ Note: Upstart/SysV init based OS types are not supported.
## Requirements
- **Minimum required version of Kubernetes is v1.19**
- **Ansible v2.9.x, Jinja 2.11+ and python-netaddr is installed on the machine that will run Ansible commands, Ansible 2.10.x is not supported for now**
- **Ansible v2.9.x, Jinja 2.11+ and python-netaddr is installed on the machine that will run Ansible commands, Ansible 2.10.x is experimentally supported for now**
- The target servers must have **access to the Internet** in order to pull docker images. Otherwise, additional configuration is required (See [Offline Environment](docs/offline-environment.md))
- The target servers are configured to allow **IPv4 forwarding**.
- If using IPv6 for pods and services, the target servers are configured to allow **IPv6 forwarding**.

2
ansible_version.yml

@ -4,7 +4,7 @@
become: no
vars:
minimal_ansible_version: 2.9.0
maximal_ansible_version: 2.10.0
maximal_ansible_version: 2.11.0
ansible_connection: local
tasks:
- name: "Check {{ minimal_ansible_version }} <= Ansible version < {{ maximal_ansible_version }}"

29
roles/kubernetes-apps/ansible/tasks/coredns.yml

@ -1,20 +1,19 @@
---
- name: Kubernetes Apps | Lay Down CoreDNS Template
action: "{{ item.module }}"
args:
src: "{{ item.file }}{% if item.module == 'template' %}.j2{% endif %}"
- name: Kubernetes Apps | Lay Down CoreDNS templates
template:
src: "{{ item.file }}.j2"
dest: "{{ kube_config_dir }}/{{ item.file }}"
with_items:
- { name: coredns, module: template, file: coredns-config.yml, type: configmap }
- { name: coredns, module: copy, file: coredns-sa.yml, type: sa }
- { name: coredns, module: template, file: coredns-deployment.yml, type: deployment }
- { name: coredns, module: template, file: coredns-svc.yml, type: svc }
- { name: coredns, module: copy, file: coredns-clusterrole.yml, type: clusterrole }
- { name: coredns, module: copy, file: coredns-clusterrolebinding.yml, type: clusterrolebinding }
- { name: dns-autoscaler, module: copy, file: dns-autoscaler-sa.yml, type: sa }
- { name: dns-autoscaler, module: copy, file: dns-autoscaler-clusterrole.yml, type: clusterrole }
- { name: dns-autoscaler, module: copy, file: dns-autoscaler-clusterrolebinding.yml, type: clusterrolebinding }
- { name: dns-autoscaler, module: template, file: dns-autoscaler.yml, type: deployment }
loop:
- { name: coredns, file: coredns-clusterrole.yml, type: clusterrole }
- { name: coredns, file: coredns-clusterrolebinding.yml, type: clusterrolebinding }
- { name: coredns, file: coredns-config.yml, type: configmap }
- { name: coredns, file: coredns-deployment.yml, type: deployment }
- { name: coredns, file: coredns-sa.yml, type: sa }
- { name: coredns, file: coredns-svc.yml, type: svc }
- { name: dns-autoscaler, file: dns-autoscaler.yml, type: deployment }
- { name: dns-autoscaler, file: dns-autoscaler-clusterrole.yml, type: clusterrole }
- { name: dns-autoscaler, file: dns-autoscaler-clusterrolebinding.yml, type: clusterrolebinding }
- { name: dns-autoscaler, file: dns-autoscaler-sa.yml, type: sa }
register: coredns_manifests
vars:
clusterIP: "{{ skydns_server }}"

roles/kubernetes-apps/ansible/files/coredns-clusterrole.yml → roles/kubernetes-apps/ansible/templates/coredns-clusterrole.yml.j2

roles/kubernetes-apps/ansible/files/coredns-clusterrolebinding.yml → roles/kubernetes-apps/ansible/templates/coredns-clusterrolebinding.yml.j2

roles/kubernetes-apps/ansible/files/coredns-sa.yml → roles/kubernetes-apps/ansible/templates/coredns-sa.yml.j2

roles/kubernetes-apps/ansible/dns-autoscaler-clusterrole.yml → roles/kubernetes-apps/ansible/templates/dns-autoscaler-clusterrole.yml.j2

roles/kubernetes-apps/ansible/dns-autoscaler-clusterrolebinding.yml → roles/kubernetes-apps/ansible/templates/dns-autoscaler-clusterrolebinding.yml.j2

roles/kubernetes-apps/ansible/files/dns-autoscaler-sa.yml → roles/kubernetes-apps/ansible/templates/dns-autoscaler-sa.yml.j2

Loading…
Cancel
Save