master.yaml.v1.j2 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. kind: MasterConfig
  2. apiVersion: v1
  3. admissionConfig:
  4. pluginConfig:{{ openshift.master.admission_plugin_config | default(None) | lib_utils_to_padded_yaml(level=2) }}
  5. PodPreset:
  6. configuration:
  7. kind: DefaultAdmissionConfig
  8. apiVersion: v1
  9. disable: true
  10. aggregatorConfig:
  11. proxyClientInfo:
  12. certFile: aggregator-front-proxy.crt
  13. keyFile: aggregator-front-proxy.key
  14. authConfig:
  15. requestHeader:
  16. clientCA: front-proxy-ca.crt
  17. clientCommonNames:
  18. - aggregator-front-proxy
  19. usernameHeaders:
  20. - X-Remote-User
  21. groupHeaders:
  22. - X-Remote-Group
  23. extraHeaderPrefixes:
  24. - X-Remote-Extra-
  25. apiLevels:
  26. - v1
  27. {% if openshift_master_audit_config is defined %}
  28. auditConfig:{{ openshift_master_audit_config | lib_utils_to_padded_yaml(level=1) }}
  29. {% endif %}
  30. controllerConfig:
  31. election:
  32. lockName: openshift-master-controllers
  33. serviceServingCert:
  34. signer:
  35. certFile: service-signer.crt
  36. keyFile: service-signer.key
  37. controllers: '*'
  38. corsAllowedOrigins:
  39. # anchor with start (\A) and end (\z) of the string, make the check case insensitive ((?i)) and escape hostname
  40. {% for origin in ['127.0.0.1', 'localhost', openshift.common.ip, openshift.common.public_ip] | union(openshift.common.all_hostnames) | unique %}
  41. - (?i)//{{ origin | regex_escape() }}(:|\z)
  42. {% endfor %}
  43. {% for custom_origin in osm_custom_cors_origins | default("") %}
  44. - (?i)//{{ custom_origin | regex_escape() }}(:|\z)
  45. {% endfor %}
  46. {% if 'disabled_features' in openshift.master %}
  47. disabledFeatures: {{ openshift.master.disabled_features | to_json }}
  48. {% endif %}
  49. {% if openshift_master_embedded_dns | bool %}
  50. dnsConfig:
  51. bindAddress: {{ openshift.master.bind_addr }}:{{ openshift_master_dns_port }}
  52. bindNetwork: tcp4
  53. {% endif %}
  54. etcdClientInfo:
  55. ca: master.etcd-ca.crt
  56. certFile: master.etcd-client.crt
  57. keyFile: master.etcd-client.key
  58. urls:
  59. {% for etcd_url in openshift_master_etcd_urls %}
  60. - {{ etcd_url }}
  61. {% endfor %}
  62. etcdStorageConfig:
  63. kubernetesStoragePrefix: kubernetes.io
  64. kubernetesStorageVersion: v1
  65. openShiftStoragePrefix: openshift.io
  66. openShiftStorageVersion: v1
  67. imageConfig:
  68. format: {{ l_os_registry_url }}
  69. latest: {{ openshift_master_image_config_latest }}
  70. imagePolicyConfig:{{ openshift.master.image_policy_config | default({"internalRegistryHostname":"docker-registry.default.svc:5000"}) | lib_utils_to_padded_yaml(level=1) }}
  71. kubeletClientInfo:
  72. {# TODO: allow user specified kubelet port #}
  73. ca: ca-bundle.crt
  74. certFile: master.kubelet-client.crt
  75. keyFile: master.kubelet-client.key
  76. port: 10250
  77. {% if openshift_master_embedded_kube | bool %}
  78. kubernetesMasterConfig:
  79. apiServerArguments:
  80. {{ openshift.master.api_server_args | default(None) | lib_utils_to_padded_yaml( level=2 ) }}
  81. storage-backend:
  82. - etcd3
  83. storage-media-type:
  84. - application/vnd.kubernetes.protobuf
  85. {% if openshift_master_use_persistentlocalvolumes | bool %}
  86. feature-gates:
  87. - PersistentLocalVolumes=true
  88. {% endif %}
  89. controllerArguments: {{ openshift.master.controller_args | default(None) | lib_utils_to_padded_yaml( level=2 ) }}
  90. {% if openshift_master_use_persistentlocalvolumes | bool %}
  91. feature-gates:
  92. - PersistentLocalVolumes=true
  93. {% endif %}
  94. masterCount: {{ openshift_master_count | default(groups.oo_masters | length) }}
  95. masterIP: {{ openshift.common.ip }}
  96. podEvictionTimeout: {{ openshift_master_pod_eviction_timeout }}
  97. proxyClientInfo:
  98. certFile: master.proxy-client.crt
  99. keyFile: master.proxy-client.key
  100. schedulerArguments: {{ openshift_master_scheduler_args | default(None) | lib_utils_to_padded_yaml( level=3 ) }}
  101. schedulerConfigFile: {{ openshift_master_scheduler_conf }}
  102. servicesNodePortRange: "{{ openshift_node_port_range | default("") }}"
  103. servicesSubnet: {{ openshift.common.portal_net }}
  104. staticNodeNames: {{ openshift_node_ips | default([], true) }}
  105. {% endif %}
  106. masterClients:
  107. {# TODO: allow user to set externalKubernetesKubeConfig #}
  108. externalKubernetesClientConnectionOverrides:
  109. acceptContentTypes: application/vnd.kubernetes.protobuf,application/json
  110. contentType: application/vnd.kubernetes.protobuf
  111. burst: {{ openshift_master_external_ratelimit_burst | default(400) }}
  112. qps: {{ openshift_master_external_ratelimit_qps | default(200) }}
  113. externalKubernetesKubeConfig: ""
  114. openshiftLoopbackClientConnectionOverrides:
  115. acceptContentTypes: application/vnd.kubernetes.protobuf,application/json
  116. contentType: application/vnd.kubernetes.protobuf
  117. burst: {{ openshift_master_loopback_ratelimit_burst | default(600) }}
  118. qps: {{ openshift_master_loopback_ratelimit_qps | default(300) }}
  119. openshiftLoopbackKubeConfig: openshift-master.kubeconfig
  120. masterPublicURL: {{ openshift.master.public_api_url }}
  121. networkConfig:
  122. clusterNetworkCIDR: {{ openshift.master.sdn_cluster_network_cidr }}
  123. hostSubnetLength: {{ openshift.master.sdn_host_subnet_length }}
  124. {% if openshift_version_gte_3_7 | bool %}
  125. clusterNetworks:
  126. - cidr: {{ openshift.master.sdn_cluster_network_cidr }}
  127. hostSubnetLength: {{ openshift.master.sdn_host_subnet_length }}
  128. {% endif %}
  129. {% if r_openshift_master_use_openshift_sdn or r_openshift_master_use_nuage or r_openshift_master_use_contiv or r_openshift_master_use_kuryr or r_openshift_master_sdn_network_plugin_name == 'cni' %}
  130. networkPluginName: {{ r_openshift_master_sdn_network_plugin_name_default }}
  131. {% endif %}
  132. # serviceNetworkCIDR must match kubernetesMasterConfig.servicesSubnet
  133. serviceNetworkCIDR: {{ openshift.common.portal_net }}
  134. externalIPNetworkCIDRs: {{ openshift_master_external_ip_network_cidrs | default(["0.0.0.0/0"]) | lib_utils_to_padded_yaml(1,2) }}
  135. {% if openshift_master_ingress_ip_network_cidr is defined %}
  136. ingressIPNetworkCIDR: {{ openshift_master_ingress_ip_network_cidr }}
  137. {% endif %}
  138. oauthConfig:
  139. {% if openshift_master_oauth_always_show_provider_selection is defined %}
  140. alwaysShowProviderSelection: {{ openshift_master_oauth_always_show_provider_selection }}
  141. {% endif %}
  142. {% if l_openshift_master_oauth_templates %}
  143. templates:{{ l_openshift_master_oauth_templates | lib_utils_to_padded_yaml(level=2) }}
  144. {% endif %}
  145. assetPublicURL: {{ openshift.master.public_console_url }}/
  146. grantConfig:
  147. method: {{ openshift_master_oauth_grant_method }}
  148. identityProviders:
  149. {% for line in translated_identity_providers.splitlines() %}
  150. {{ line }}
  151. {% endfor %}
  152. masterCA: ca-bundle.crt
  153. masterPublicURL: {{ openshift.master.public_api_url }}
  154. masterURL: {{ openshift.master.api_url }}
  155. sessionConfig:
  156. sessionMaxAgeSeconds: {{ openshift.master.session_max_seconds }}
  157. sessionName: {{ openshift.master.session_name }}
  158. sessionSecretsFile: {{ openshift_master_session_secrets_file }}
  159. tokenConfig:
  160. accessTokenMaxAgeSeconds: {{ openshift_master_access_token_max_seconds }}
  161. authorizeTokenMaxAgeSeconds: {{ openshift_master_auth_token_max_seconds }}
  162. pauseControllers: false
  163. policyConfig:
  164. bootstrapPolicyFile: {{ openshift_master_policy }}
  165. openshiftInfrastructureNamespace: openshift-infra
  166. openshiftSharedResourcesNamespace: openshift
  167. projectConfig:
  168. defaultNodeSelector: "{{ hostvars[groups.oo_first_master.0].l_osm_default_node_selector }}"
  169. projectRequestMessage: "{{ osm_project_request_message }}"
  170. projectRequestTemplate: "{{ osm_project_request_template }}"
  171. securityAllocator:
  172. mcsAllocatorRange: "{{ osm_mcs_allocator_range }}"
  173. mcsLabelsPerProject: {{ osm_mcs_labels_per_project }}
  174. uidAllocatorRange: "{{ osm_uid_allocator_range }}"
  175. routingConfig:
  176. subdomain: "{{ openshift_master_default_subdomain }}"
  177. serviceAccountConfig:
  178. limitSecretReferences: {{ openshift_master_saconfig_limitsecretreferences | default(false) }}
  179. managedNames:
  180. - default
  181. - builder
  182. - deployer
  183. masterCA: ca-bundle.crt
  184. privateKeyFile: serviceaccounts.private.key
  185. publicKeyFiles:
  186. - serviceaccounts.public.key
  187. servingInfo:
  188. bindAddress: {{ openshift.master.bind_addr }}:{{ openshift_master_api_port }}
  189. bindNetwork: tcp4
  190. certFile: master.server.crt
  191. clientCA: ca.crt
  192. keyFile: master.server.key
  193. maxRequestsInFlight: {{ openshift_master_max_requests_inflight }}
  194. requestTimeoutSeconds: 3600
  195. {% if openshift.master.named_certificates | default([]) | length > 0 %}
  196. namedCertificates:
  197. {% for named_certificate in openshift.master.named_certificates %}
  198. - certFile: {{ named_certificate['certfile'] }}
  199. keyFile: {{ named_certificate['keyfile'] }}
  200. names:
  201. {% for name in named_certificate['names'] %}
  202. - "{{ name }}"
  203. {% endfor %}
  204. {% endfor %}
  205. {% endif %}
  206. {% if openshift_master_min_tls_version is defined %}
  207. minTLSVersion: {{ openshift_master_min_tls_version }}
  208. {% endif %}
  209. {% if openshift_master_cipher_suites is defined %}
  210. cipherSuites:
  211. {% for cipher_suite in openshift_master_cipher_suites %}
  212. - {{ cipher_suite }}
  213. {% endfor %}
  214. {% endif %}
  215. volumeConfig:
  216. dynamicProvisioningEnabled: {{ openshift_master_dynamic_provisioning_enabled }}