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.

21 lines
834 B

  1. [req]
  2. req_extensions = v3_req
  3. distinguished_name = req_distinguished_name
  4. [req_distinguished_name]
  5. [ v3_req ]
  6. basicConstraints = CA:FALSE
  7. keyUsage = nonRepudiation, digitalSignature, keyEncipherment
  8. subjectAltName = @alt_names
  9. [alt_names]
  10. DNS.1 = kubernetes
  11. DNS.2 = kubernetes.default
  12. DNS.3 = kubernetes.default.svc.{{ dns_domain }}
  13. {% for host in groups['kube-master'] %}
  14. IP.{{ loop.index }} = {{ hostvars[host]['ip'] | default(hostvars[host]['ansible_default_ipv4']['address']) }}
  15. {% endfor %}
  16. {% set idx = groups['kube-master'] | length | int + 1 %}
  17. IP.{{ idx | string }} = {{ kube_apiserver_ip }}
  18. {% if kube_loadbalancer_ip is defined | default('') %}
  19. {% set idx = idx | int + 1 %}
  20. IP.{{ idx | string }} = {{ kube_loadbalancer }}
  21. {% endif %}