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.

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