blob: 3f6794dcf895e2acf22d3935a72a1a138bd56839 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
{# https://godoc.org/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta3 #}
{# #}
apiVersion: kubeadm.k8s.io/v1beta3
kind: InitConfiguration
localAPIEndpoint:
bindPort: 6442
{% if kubernetes_overlay_node_ip is defined %}
advertiseAddress: "{{ kubernetes_overlay_node_ip }}"
{% endif %}
skipPhases:
- show-join-command
{% if kubernetes_network_plugin_replaces_kube_proxy %}
- addon/kube-proxy
{% endif %}
nodeRegistration:
name: "{{ kubernetes_node_name }}"
criSocket: "{{ kubernetes_cri_socket }}"
kubeletExtraArgs:
node-labels: "ansible.spreadsapce.org/inventory_hostname={{ inventory_hostname }}"
{% if kubernetes_overlay_node_ip is defined %}
node-ip: "{{ kubernetes_overlay_node_ip }}"
{% endif %}
---
apiVersion: kubeadm.k8s.io/v1beta3
kind: ClusterConfiguration
kubernetesVersion: {{ kubernetes_version }}
clusterName: "{{ kubernetes.cluster_name }}"
controlPlaneEndpoint: 127.0.0.1:6443
networking:
dnsDomain: "{{ kubernetes.dns_domain | default('cluster.local') }}"
podSubnet: "{{ kubernetes.pod_ip_range }}"
serviceSubnet: "{{ kubernetes.service_ip_range }}"
apiServer:
extraArgs:
encryption-provider-config: /etc/kubernetes/encryption/config
encryption-provider-config-automatic-reload: "true"
extraVolumes:
- name: encryption-config
hostPath: /etc/kubernetes/encryption
mountPath: /etc/kubernetes/encryption
readOnly: true
pathType: Directory
{% if (kubernetes.api_extra_sans | default([]) | length) == 0 %}
certSANs: []
{% else %}
certSANs:
{{ kubernetes.api_extra_sans | to_nice_yaml | indent(width=2) }}
{% endif %}
controllerManager:
extraArgs:
node-cidr-mask-size: "{{ kubernetes.pod_ip_range_size }}"
scheduler: {}
---
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
cgroupDriver: systemd
{% if kubernetes_enable_nodelocal_dnscache %}
clusterDNS:
- "{{ kubernetes_nodelocal_dnscache_ip }}"
{% endif %}
{% if not kubernetes_network_plugin_replaces_kube_proxy and kubernetes_kube_proxy_mode is defined %}
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
mode: {{ kubernetes_kube_proxy_mode }}
{% endif %}
|