2018-08-14 12:13:44 +00:00
|
|
|
apiVersion: kubeadm.k8s.io/v1alpha2
|
2017-09-13 18:00:51 +00:00
|
|
|
kind: MasterConfiguration
|
|
|
|
api:
|
|
|
|
advertiseAddress: {{ ip | default(ansible_default_ipv4.address) }}
|
2017-09-15 21:28:15 +00:00
|
|
|
bindPort: {{ kube_apiserver_port }}
|
2018-08-18 14:05:35 +00:00
|
|
|
{% if groups['kube-master'] | length > 1 and kubeadm_config_api_fqdn is defined %}
|
|
|
|
controlPlaneEndpoint: {{ kubeadm_config_api_fqdn }}
|
|
|
|
{% endif %}
|
2017-09-13 18:00:51 +00:00
|
|
|
etcd:
|
2018-08-14 12:13:44 +00:00
|
|
|
external:
|
|
|
|
endpoints:
|
2017-10-04 12:27:55 +00:00
|
|
|
{% for endpoint in etcd_access_addresses.split(',') %}
|
2018-08-14 12:13:44 +00:00
|
|
|
- {{ endpoint }}
|
2017-09-13 18:00:51 +00:00
|
|
|
{% endfor %}
|
2018-08-14 12:13:44 +00:00
|
|
|
caFile: {{ kube_config_dir }}/ssl/etcd/ca.pem
|
|
|
|
certFile: {{ kube_config_dir }}/ssl/etcd/node-{{ inventory_hostname }}.pem
|
|
|
|
keyFile: {{ kube_config_dir }}/ssl/etcd/node-{{ inventory_hostname }}-key.pem
|
2017-09-13 18:00:51 +00:00
|
|
|
networking:
|
|
|
|
dnsDomain: {{ dns_domain }}
|
|
|
|
serviceSubnet: {{ kube_service_addresses }}
|
|
|
|
podSubnet: {{ kube_pods_subnet }}
|
|
|
|
kubernetesVersion: {{ kube_version }}
|
2018-03-30 09:42:20 +00:00
|
|
|
{% if cloud_provider is defined and cloud_provider != "gce" %}
|
|
|
|
cloudProvider: {{ cloud_provider }}
|
2017-12-25 08:57:45 +00:00
|
|
|
{% endif %}
|
2018-01-29 05:15:32 +00:00
|
|
|
kubeProxy:
|
|
|
|
config:
|
2018-08-14 12:13:44 +00:00
|
|
|
mode: {{ kube_proxy_mode }}
|
|
|
|
hostnameOverride: {{ inventory_hostname }}
|
2018-08-22 16:43:03 +00:00
|
|
|
{% if kube_proxy_nodeport_addresses %}
|
|
|
|
nodePortAddresses: [{{ kube_proxy_nodeport_addresses_cidr }}]
|
|
|
|
{% endif %}
|
2017-09-15 21:28:15 +00:00
|
|
|
authorizationModes:
|
2017-09-13 18:00:51 +00:00
|
|
|
{% for mode in authorization_modes %}
|
|
|
|
- {{ mode }}
|
|
|
|
{% endfor %}
|
|
|
|
apiServerExtraArgs:
|
2017-11-29 15:24:02 +00:00
|
|
|
bind-address: {{ kube_apiserver_bind_address }}
|
2017-09-13 18:00:51 +00:00
|
|
|
insecure-bind-address: {{ kube_apiserver_insecure_bind_address }}
|
|
|
|
insecure-port: "{{ kube_apiserver_insecure_port }}"
|
2018-08-02 18:10:40 +00:00
|
|
|
{% if kube_version | version_compare('v1.10', '<') %}
|
2017-09-13 18:00:51 +00:00
|
|
|
admission-control: {{ kube_apiserver_admission_control | join(',') }}
|
2018-08-02 18:10:40 +00:00
|
|
|
{% else %}
|
2018-08-06 18:50:48 +00:00
|
|
|
{% if kube_apiserver_enable_admission_plugins|length > 0 %}
|
2018-08-03 18:58:03 +00:00
|
|
|
enable-admission-plugins: {{ kube_apiserver_enable_admission_plugins | join(',') }}
|
2018-08-06 18:50:48 +00:00
|
|
|
{% endif %}
|
|
|
|
{% if kube_apiserver_disable_admission_plugins|length > 0 %}
|
2018-08-03 18:58:03 +00:00
|
|
|
disable-admission-plugins: {{ kube_apiserver_disable_admission_plugins | join(',') }}
|
2018-08-06 18:50:48 +00:00
|
|
|
{% endif %}
|
2018-08-02 18:10:40 +00:00
|
|
|
{% endif %}
|
2017-09-15 21:28:15 +00:00
|
|
|
apiserver-count: "{{ kube_apiserver_count }}"
|
2018-03-20 13:33:36 +00:00
|
|
|
{% if kube_version | version_compare('v1.9', '>=') %}
|
|
|
|
endpoint-reconciler-type: lease
|
2018-04-01 16:58:08 +00:00
|
|
|
{% endif %}
|
2018-06-18 13:19:12 +00:00
|
|
|
{% if etcd_events_cluster_enabled %}
|
2018-04-01 16:58:08 +00:00
|
|
|
etcd-servers-overrides: "/events#{{ etcd_events_access_addresses }}"
|
2018-03-30 09:38:06 +00:00
|
|
|
{% endif %}
|
2017-09-13 18:00:51 +00:00
|
|
|
service-node-port-range: {{ kube_apiserver_node_port_range }}
|
2018-03-13 09:31:15 +00:00
|
|
|
kubelet-preferred-address-types: "{{ kubelet_preferred_address_types }}"
|
2017-09-13 18:00:51 +00:00
|
|
|
{% if kube_basic_auth|default(true) %}
|
|
|
|
basic-auth-file: {{ kube_users_dir }}/known_users.csv
|
|
|
|
{% endif %}
|
|
|
|
{% if kube_oidc_auth|default(false) and kube_oidc_url is defined and kube_oidc_client_id is defined %}
|
|
|
|
oidc-issuer-url: {{ kube_oidc_url }}
|
|
|
|
oidc-client-id: {{ kube_oidc_client_id }}
|
|
|
|
{% if kube_oidc_ca_file is defined %}
|
|
|
|
oidc-ca-file: {{ kube_oidc_ca_file }}
|
|
|
|
{% endif %}
|
|
|
|
{% if kube_oidc_username_claim is defined %}
|
|
|
|
oidc-username-claim: {{ kube_oidc_username_claim }}
|
|
|
|
{% endif %}
|
|
|
|
{% if kube_oidc_groups_claim is defined %}
|
|
|
|
oidc-groups-claim: {{ kube_oidc_groups_claim }}
|
|
|
|
{% endif %}
|
2018-03-15 19:20:05 +00:00
|
|
|
{% endif %}
|
|
|
|
{% if kube_encrypt_secret_data %}
|
|
|
|
experimental-encryption-provider-config: {{ kube_config_dir }}/ssl/secrets_encryption.yaml
|
2017-09-13 18:00:51 +00:00
|
|
|
{% endif %}
|
|
|
|
storage-backend: {{ kube_apiserver_storage_backend }}
|
|
|
|
{% if kube_api_runtime_config is defined %}
|
2017-10-15 19:41:17 +00:00
|
|
|
runtime-config: {{ kube_api_runtime_config | join(',') }}
|
2017-09-13 18:00:51 +00:00
|
|
|
{% endif %}
|
|
|
|
allow-privileged: "true"
|
2018-08-20 05:00:53 +00:00
|
|
|
{% if kubernetes_audit %}
|
|
|
|
audit-log-path: {{ audit_log_path }}
|
|
|
|
audit-log-maxage: {{ audit_log_maxage }}
|
|
|
|
audit-log-maxbackup: {{ audit_log_maxbackups }}
|
|
|
|
audit-log-maxsize: {{ audit_log_maxsize }}
|
|
|
|
audit-policy-file: {{ audit_policy_file }}
|
|
|
|
{% endif %}
|
2018-02-12 07:29:46 +00:00
|
|
|
{% for key in kube_kubeadm_apiserver_extra_args %}
|
2018-03-15 19:27:19 +00:00
|
|
|
{{ key }}: "{{ kube_kubeadm_apiserver_extra_args[key] }}"
|
2018-02-12 07:29:46 +00:00
|
|
|
{% endfor %}
|
2017-09-13 18:00:51 +00:00
|
|
|
controllerManagerExtraArgs:
|
|
|
|
node-monitor-grace-period: {{ kube_controller_node_monitor_grace_period }}
|
|
|
|
node-monitor-period: {{ kube_controller_node_monitor_period }}
|
|
|
|
pod-eviction-timeout: {{ kube_controller_pod_eviction_timeout }}
|
2018-02-14 16:15:25 +00:00
|
|
|
{% if cloud_provider is defined and cloud_provider in ["openstack"] and openstack_cacert is defined %}
|
|
|
|
controllerManagerExtraVolumes:
|
|
|
|
- name: openstackcacert
|
|
|
|
hostPath: "{{ kube_config_dir }}/openstack-cacert.pem"
|
|
|
|
mountPath: "{{ kube_config_dir }}/openstack-cacert.pem"
|
|
|
|
{% endif %}
|
2018-08-20 05:00:53 +00:00
|
|
|
{% if kubernetes_audit %}
|
|
|
|
apiServerExtraVolumes:
|
|
|
|
- name: {{ audit_policy_name }}
|
|
|
|
hostPath: {{ audit_policy_hostpath }}
|
|
|
|
mountPath: {{ audit_policy_mountpath }}
|
|
|
|
{% if audit_log_path != "-" %}
|
|
|
|
- name: {{ audit_log_name }}
|
|
|
|
hostPath: {{ audit_log_hostpath }}
|
|
|
|
mountPath: {{ audit_log_mountpath }}
|
|
|
|
Writable: true
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
2017-09-13 18:00:51 +00:00
|
|
|
{% if kube_feature_gates %}
|
|
|
|
feature-gates: {{ kube_feature_gates|join(',') }}
|
|
|
|
{% endif %}
|
2018-02-05 13:49:13 +00:00
|
|
|
{% for key in kube_kubeadm_controller_extra_args %}
|
2018-03-15 19:27:19 +00:00
|
|
|
{{ key }}: "{{ kube_kubeadm_controller_extra_args[key] }}"
|
2018-02-05 13:49:13 +00:00
|
|
|
{% endfor %}
|
|
|
|
{% if kube_kubeadm_scheduler_extra_args|length > 0 %}
|
|
|
|
schedulerExtraArgs:
|
|
|
|
{% for key in kube_kubeadm_scheduler_extra_args %}
|
2018-03-15 19:27:19 +00:00
|
|
|
{{ key }}: "{{ kube_kubeadm_scheduler_extra_args[key] }}"
|
2018-02-05 13:49:13 +00:00
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2017-09-13 18:00:51 +00:00
|
|
|
apiServerCertSANs:
|
|
|
|
{% for san in apiserver_sans.split(' ') | unique %}
|
|
|
|
- {{ san }}
|
|
|
|
{% endfor %}
|
|
|
|
certificatesDir: {{ kube_config_dir }}/ssl
|
2017-09-15 21:28:15 +00:00
|
|
|
unifiedControlPlaneImage: "{{ hyperkube_image_repo }}:{{ hyperkube_image_tag }}"
|
2018-08-14 12:13:44 +00:00
|
|
|
nodeRegistration:
|
2018-03-23 12:33:25 +00:00
|
|
|
{% if kube_override_hostname|default('') %}
|
2018-08-14 12:13:44 +00:00
|
|
|
name: {{ kube_override_hostname }}
|
2018-03-23 12:33:25 +00:00
|
|
|
{% endif %}
|
2018-08-14 12:13:44 +00:00
|
|
|
taints:
|
|
|
|
- effect: NoSchedule
|
|
|
|
key: node-role.kubernetes.io/master
|
2018-08-15 08:41:13 +00:00
|
|
|
{% if kubernetes_audit %}
|
|
|
|
featureGates:
|
|
|
|
Auditing: true
|
|
|
|
{% endif %}
|