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.

98 lines
3.7 KiB

6 years ago
  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' and kube_version | version_compare('v1.10', '<') %}
  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. selfHosted: false
  33. apiServerExtraArgs:
  34. bind-address: {{ kube_apiserver_bind_address }}
  35. insecure-bind-address: {{ kube_apiserver_insecure_bind_address }}
  36. insecure-port: "{{ kube_apiserver_insecure_port }}"
  37. admission-control: {{ kube_apiserver_admission_control | join(',') }}
  38. apiserver-count: "{{ kube_apiserver_count }}"
  39. {% if kube_version | version_compare('v1.9', '>=') %}
  40. endpoint-reconciler-type: lease
  41. {% endif %}
  42. {% if etcd_events_cluster_enabled %}
  43. etcd-servers-overrides: "/events#{{ etcd_events_access_addresses }}"
  44. {% endif %}
  45. service-node-port-range: {{ kube_apiserver_node_port_range }}
  46. kubelet-preferred-address-types: "{{ kubelet_preferred_address_types }}"
  47. {% if kube_basic_auth|default(true) %}
  48. basic-auth-file: {{ kube_users_dir }}/known_users.csv
  49. {% endif %}
  50. {% if kube_oidc_auth|default(false) and kube_oidc_url is defined and kube_oidc_client_id is defined %}
  51. oidc-issuer-url: {{ kube_oidc_url }}
  52. oidc-client-id: {{ kube_oidc_client_id }}
  53. {% if kube_oidc_ca_file is defined %}
  54. oidc-ca-file: {{ kube_oidc_ca_file }}
  55. {% endif %}
  56. {% if kube_oidc_username_claim is defined %}
  57. oidc-username-claim: {{ kube_oidc_username_claim }}
  58. {% endif %}
  59. {% if kube_oidc_groups_claim is defined %}
  60. oidc-groups-claim: {{ kube_oidc_groups_claim }}
  61. {% endif %}
  62. {% endif %}
  63. {% if kube_encrypt_secret_data %}
  64. experimental-encryption-provider-config: {{ kube_config_dir }}/ssl/secrets_encryption.yaml
  65. {% endif %}
  66. storage-backend: {{ kube_apiserver_storage_backend }}
  67. {% if kube_api_runtime_config is defined %}
  68. runtime-config: {{ kube_api_runtime_config | join(',') }}
  69. {% endif %}
  70. allow-privileged: "true"
  71. {% for key in kube_kubeadm_apiserver_extra_args %}
  72. {{ key }}: "{{ kube_kubeadm_apiserver_extra_args[key] }}"
  73. {% endfor %}
  74. controllerManagerExtraArgs:
  75. node-monitor-grace-period: {{ kube_controller_node_monitor_grace_period }}
  76. node-monitor-period: {{ kube_controller_node_monitor_period }}
  77. pod-eviction-timeout: {{ kube_controller_pod_eviction_timeout }}
  78. {% if kube_feature_gates %}
  79. feature-gates: {{ kube_feature_gates|join(',') }}
  80. {% endif %}
  81. {% for key in kube_kubeadm_controller_extra_args %}
  82. {{ key }}: "{{ kube_kubeadm_controller_extra_args[key] }}"
  83. {% endfor %}
  84. {% if kube_kubeadm_scheduler_extra_args|length > 0 %}
  85. schedulerExtraArgs:
  86. {% for key in kube_kubeadm_scheduler_extra_args %}
  87. {{ key }}: "{{ kube_kubeadm_scheduler_extra_args[key] }}"
  88. {% endfor %}
  89. {% endif %}
  90. apiServerCertSANs:
  91. {% for san in apiserver_sans.split(' ') | unique %}
  92. - {{ san }}
  93. {% endfor %}
  94. certificatesDir: {{ kube_config_dir }}/ssl
  95. unifiedControlPlaneImage: "{{ hyperkube_image_repo }}:{{ hyperkube_image_tag }}"
  96. {% if kube_override_hostname|default('') %}
  97. nodeName: {{ kube_override_hostname }}
  98. {% endif %}