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.

22 lines
921 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
  13. DNS.4 = kubernetes.default.svc.{{ dns_domain }}
  14. {% if loadbalancer_apiserver is defined and apiserver_loadbalancer_domain_name is defined %}
  15. DNS.5 = {{ apiserver_loadbalancer_domain_name }}
  16. {% endif %}
  17. {% for host in groups['kube-master'] %}
  18. IP.{{ 2 * loop.index - 1 }} = {{ hostvars[host]['access_ip'] | default(hostvars[host]['ansible_default_ipv4']['address']) }}
  19. IP.{{ 2 * loop.index }} = {{ hostvars[host]['ip'] | default(hostvars[host]['ansible_default_ipv4']['address']) }}
  20. {% endfor %}
  21. {% set idx = groups['kube-master'] | length | int * 2 + 1 %}
  22. IP.{{ idx | string }} = {{ kube_apiserver_ip }}