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.

75 lines
2.7 KiB

  1. apiVersion: kubeadm.k8s.io/v1alpha1
  2. kind: MasterConfiguration
  3. api:
  4. advertiseAddress: {{ ip | default(ansible_default_ipv4.address) }}
  5. bindPort: {{ kube_apiserver_port }}
  6. etcd:
  7. endpoints:
  8. {% for endpoint in etcd_access_addresses.split(',') %}
  9. - {{ endpoint }}
  10. {% endfor %}
  11. caFile: {{ kube_config_dir }}/ssl/etcd/ca.pem
  12. certFile: {{ kube_config_dir }}/ssl/etcd/node-{{ inventory_hostname }}.pem
  13. keyFile: {{ kube_config_dir }}/ssl/etcd/node-{{ inventory_hostname }}-key.pem
  14. networking:
  15. dnsDomain: {{ dns_domain }}
  16. serviceSubnet: {{ kube_service_addresses }}
  17. podSubnet: {{ kube_pods_subnet }}
  18. kubernetesVersion: {{ kube_version }}
  19. {% if cloud_provider is defined and cloud_provider != "gce" %}
  20. cloudProvider: {{ cloud_provider }}
  21. {% endif %}
  22. {% if kube_proxy_mode == 'ipvs' %}
  23. kubeProxy:
  24. config:
  25. featureGates: SupportIPVSProxyMode=true
  26. mode: ipvs
  27. {% endif %}
  28. authorizationModes:
  29. {% for mode in authorization_modes %}
  30. - {{ mode }}
  31. {% endfor %}
  32. token: {{ kubeadm_token }}
  33. tokenTTL: "{{ kubeadm_token_ttl }}"
  34. selfHosted: false
  35. apiServerExtraArgs:
  36. bind-address: {{ kube_apiserver_bind_address }}
  37. insecure-bind-address: {{ kube_apiserver_insecure_bind_address }}
  38. insecure-port: "{{ kube_apiserver_insecure_port }}"
  39. admission-control: {{ kube_apiserver_admission_control | join(',') }}
  40. apiserver-count: "{{ kube_apiserver_count }}"
  41. service-node-port-range: {{ kube_apiserver_node_port_range }}
  42. {% if kube_basic_auth|default(true) %}
  43. basic-auth-file: {{ kube_users_dir }}/known_users.csv
  44. {% endif %}
  45. {% if kube_oidc_auth|default(false) and kube_oidc_url is defined and kube_oidc_client_id is defined %}
  46. oidc-issuer-url: {{ kube_oidc_url }}
  47. oidc-client-id: {{ kube_oidc_client_id }}
  48. {% if kube_oidc_ca_file is defined %}
  49. oidc-ca-file: {{ kube_oidc_ca_file }}
  50. {% endif %}
  51. {% if kube_oidc_username_claim is defined %}
  52. oidc-username-claim: {{ kube_oidc_username_claim }}
  53. {% endif %}
  54. {% if kube_oidc_groups_claim is defined %}
  55. oidc-groups-claim: {{ kube_oidc_groups_claim }}
  56. {% endif %}
  57. {% endif %}
  58. storage-backend: {{ kube_apiserver_storage_backend }}
  59. {% if kube_api_runtime_config is defined %}
  60. runtime-config: {{ kube_api_runtime_config | join(',') }}
  61. {% endif %}
  62. allow-privileged: "true"
  63. controllerManagerExtraArgs:
  64. node-monitor-grace-period: {{ kube_controller_node_monitor_grace_period }}
  65. node-monitor-period: {{ kube_controller_node_monitor_period }}
  66. pod-eviction-timeout: {{ kube_controller_pod_eviction_timeout }}
  67. {% if kube_feature_gates %}
  68. feature-gates: {{ kube_feature_gates|join(',') }}
  69. {% endif %}
  70. apiServerCertSANs:
  71. {% for san in apiserver_sans.split(' ') | unique %}
  72. - {{ san }}
  73. {% endfor %}
  74. certificatesDir: {{ kube_config_dir }}/ssl
  75. unifiedControlPlaneImage: "{{ hyperkube_image_repo }}:{{ hyperkube_image_tag }}"