2015-12-11 10:32:13 +00:00
|
|
|
[req]
|
|
|
|
req_extensions = v3_req
|
|
|
|
distinguished_name = req_distinguished_name
|
|
|
|
[req_distinguished_name]
|
|
|
|
[ v3_req ]
|
|
|
|
basicConstraints = CA:FALSE
|
|
|
|
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
|
|
|
|
subjectAltName = @alt_names
|
|
|
|
[alt_names]
|
|
|
|
DNS.1 = kubernetes
|
|
|
|
DNS.2 = kubernetes.default
|
2016-04-01 10:40:01 +00:00
|
|
|
DNS.3 = kubernetes.default.svc
|
|
|
|
DNS.4 = kubernetes.default.svc.{{ dns_domain }}
|
2016-09-28 11:05:08 +00:00
|
|
|
DNS.5 = localhost
|
2016-09-26 17:14:19 +00:00
|
|
|
{% for host in groups['kube-master'] %}
|
2016-09-28 11:05:08 +00:00
|
|
|
DNS.{{ 5 + loop.index }} = {{ host }}
|
2016-09-26 17:14:19 +00:00
|
|
|
{% endfor %}
|
2015-12-15 15:51:55 +00:00
|
|
|
{% if loadbalancer_apiserver is defined and apiserver_loadbalancer_domain_name is defined %}
|
2017-02-15 21:13:52 +00:00
|
|
|
{% set idx = groups['kube-master'] | length | int + 5 + 1 %}
|
2016-09-28 11:05:08 +00:00
|
|
|
DNS.{{ idx | string }} = {{ apiserver_loadbalancer_domain_name }}
|
2015-12-15 15:51:55 +00:00
|
|
|
{% endif %}
|
2015-12-11 10:32:13 +00:00
|
|
|
{% for host in groups['kube-master'] %}
|
2016-01-26 20:41:42 +00:00
|
|
|
IP.{{ 2 * loop.index - 1 }} = {{ hostvars[host]['access_ip'] | default(hostvars[host]['ansible_default_ipv4']['address']) }}
|
|
|
|
IP.{{ 2 * loop.index }} = {{ hostvars[host]['ip'] | default(hostvars[host]['ansible_default_ipv4']['address']) }}
|
2015-12-11 10:32:13 +00:00
|
|
|
{% endfor %}
|
2016-01-26 20:41:42 +00:00
|
|
|
{% set idx = groups['kube-master'] | length | int * 2 + 1 %}
|
2016-09-28 11:05:08 +00:00
|
|
|
IP.{{ idx }} = {{ kube_apiserver_ip }}
|
|
|
|
IP.{{ idx + 1 }} = 127.0.0.1
|