master.yaml.v1.j2 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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: false
  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 not openshift_version_gte_3_9 %}
  28. assetConfig:
  29. logoutURL: "{{ openshift.master.logout_url | default('') }}"
  30. masterPublicURL: {{ openshift.master.public_api_url }}
  31. publicURL: {{ openshift.master.public_console_url }}/
  32. {% if 'logging_public_url' in openshift.master %}
  33. loggingPublicURL: {{ openshift.master.logging_public_url }}
  34. {% endif %}
  35. {% if openshift_hosted_metrics_deploy_url is defined %}
  36. metricsPublicURL: {{ openshift_hosted_metrics_deploy_url }}
  37. {% endif %}
  38. {% if 'extension_scripts' in openshift.master %}
  39. extensionScripts: {{ openshift.master.extension_scripts | lib_utils_to_padded_yaml(1, 2) }}
  40. {% endif %}
  41. {% if 'extension_stylesheets' in openshift.master %}
  42. extensionStylesheets: {{ openshift.master.extension_stylesheets | lib_utils_to_padded_yaml(1, 2) }}
  43. {% endif %}
  44. {% if 'extensions' in openshift.master %}
  45. extensions: {{ openshift.master.extensions | lib_utils_to_padded_yaml(1, 2) }}
  46. {% endif %}
  47. servingInfo:
  48. bindAddress: {{ openshift.master.bind_addr }}:{{ openshift.master.console_port }}
  49. bindNetwork: tcp4
  50. certFile: master.server.crt
  51. clientCA: ""
  52. keyFile: master.server.key
  53. maxRequestsInFlight: 0
  54. requestTimeoutSeconds: 0
  55. {% if openshift_master_min_tls_version is defined %}
  56. minTLSVersion: {{ openshift_master_min_tls_version }}
  57. {% endif %}
  58. {% if openshift_master_cipher_suites is defined %}
  59. cipherSuites:
  60. {% for cipher_suite in openshift_master_cipher_suites %}
  61. - {{ cipher_suite }}
  62. {% endfor %}
  63. {% endif %}
  64. # assetconfig end
  65. {% endif %}
  66. {% if openshift.master.audit_config | default(none) is not none %}
  67. auditConfig:{{ openshift.master.audit_config | lib_utils_to_padded_yaml(level=1) }}
  68. {% endif %}
  69. controllerConfig:
  70. election:
  71. lockName: openshift-master-controllers
  72. serviceServingCert:
  73. signer:
  74. certFile: service-signer.crt
  75. keyFile: service-signer.key
  76. controllers: '*'
  77. corsAllowedOrigins:
  78. # anchor with start (\A) and end (\z) of the string, make the check case insensitive ((?i)) and escape hostname
  79. {% for origin in ['127.0.0.1', 'localhost', openshift.common.ip, openshift.common.public_ip] | union(openshift.common.all_hostnames) | unique %}
  80. - (?i)//{{ origin | regex_escape() }}(:|\z)
  81. {% endfor %}
  82. {% for custom_origin in openshift.master.custom_cors_origins | default("") %}
  83. - (?i)//{{ custom_origin | regex_escape() }}(:|\z)
  84. {% endfor %}
  85. {% if 'disabled_features' in openshift.master %}
  86. disabledFeatures: {{ openshift.master.disabled_features | to_json }}
  87. {% endif %}
  88. {% if openshift.master.embedded_dns | bool %}
  89. dnsConfig:
  90. bindAddress: {{ openshift.master.bind_addr }}:{{ openshift_master_dns_port }}
  91. bindNetwork: tcp4
  92. {% endif %}
  93. etcdClientInfo:
  94. ca: master.etcd-ca.crt
  95. certFile: master.etcd-client.crt
  96. keyFile: master.etcd-client.key
  97. urls:
  98. {% for etcd_url in openshift_master_etcd_urls %}
  99. - {{ etcd_url }}
  100. {% endfor %}
  101. etcdStorageConfig:
  102. kubernetesStoragePrefix: kubernetes.io
  103. kubernetesStorageVersion: v1
  104. openShiftStoragePrefix: openshift.io
  105. openShiftStorageVersion: v1
  106. imageConfig:
  107. format: {{ l_os_registry_url }}
  108. latest: {{ openshift_master_image_config_latest }}
  109. imagePolicyConfig:{{ openshift.master.image_policy_config | default({"internalRegistryHostname":"docker-registry.default.svc:5000"}) | lib_utils_to_padded_yaml(level=1) }}
  110. kubeletClientInfo:
  111. {# TODO: allow user specified kubelet port #}
  112. ca: ca-bundle.crt
  113. certFile: master.kubelet-client.crt
  114. keyFile: master.kubelet-client.key
  115. port: 10250
  116. {% if openshift.master.embedded_kube | bool %}
  117. kubernetesMasterConfig:
  118. apiServerArguments: {{ openshift.master.api_server_args | default(None) | lib_utils_to_padded_yaml( level=2 ) }}
  119. storage-backend:
  120. - etcd3
  121. storage-media-type:
  122. - application/vnd.kubernetes.protobuf
  123. controllerArguments: {{ openshift.master.controller_args | default(None) | lib_utils_to_padded_yaml( level=2 ) }}
  124. masterCount: {{ openshift.master.master_count }}
  125. masterIP: {{ openshift.common.ip }}
  126. podEvictionTimeout: {{ openshift.master.pod_eviction_timeout | default("") }}
  127. proxyClientInfo:
  128. certFile: master.proxy-client.crt
  129. keyFile: master.proxy-client.key
  130. schedulerArguments: {{ openshift_master_scheduler_args | default(None) | lib_utils_to_padded_yaml( level=3 ) }}
  131. schedulerConfigFile: {{ openshift_master_scheduler_conf }}
  132. servicesNodePortRange: "{{ openshift_node_port_range | default("") }}"
  133. servicesSubnet: {{ openshift.common.portal_net }}
  134. staticNodeNames: {{ openshift_node_ips | default([], true) }}
  135. {% endif %}
  136. masterClients:
  137. {# TODO: allow user to set externalKubernetesKubeConfig #}
  138. externalKubernetesClientConnectionOverrides:
  139. acceptContentTypes: application/vnd.kubernetes.protobuf,application/json
  140. contentType: application/vnd.kubernetes.protobuf
  141. burst: {{ openshift_master_external_ratelimit_burst | default(400) }}
  142. qps: {{ openshift_master_external_ratelimit_qps | default(200) }}
  143. externalKubernetesKubeConfig: ""
  144. openshiftLoopbackClientConnectionOverrides:
  145. acceptContentTypes: application/vnd.kubernetes.protobuf,application/json
  146. contentType: application/vnd.kubernetes.protobuf
  147. burst: {{ openshift_master_loopback_ratelimit_burst | default(600) }}
  148. qps: {{ openshift_master_loopback_ratelimit_qps | default(300) }}
  149. openshiftLoopbackKubeConfig: openshift-master.kubeconfig
  150. masterPublicURL: {{ openshift.master.public_api_url }}
  151. networkConfig:
  152. clusterNetworkCIDR: {{ openshift.master.sdn_cluster_network_cidr }}
  153. hostSubnetLength: {{ openshift.master.sdn_host_subnet_length }}
  154. {% if openshift_version_gte_3_7 | bool %}
  155. clusterNetworks:
  156. - cidr: {{ openshift.master.sdn_cluster_network_cidr }}
  157. hostSubnetLength: {{ openshift.master.sdn_host_subnet_length }}
  158. {% endif %}
  159. {% 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' %}
  160. networkPluginName: {{ r_openshift_master_sdn_network_plugin_name_default }}
  161. {% endif %}
  162. # serviceNetworkCIDR must match kubernetesMasterConfig.servicesSubnet
  163. serviceNetworkCIDR: {{ openshift.common.portal_net }}
  164. externalIPNetworkCIDRs: {{ openshift_master_external_ip_network_cidrs | default(["0.0.0.0/0"]) | lib_utils_to_padded_yaml(1,2) }}
  165. {% if openshift_master_ingress_ip_network_cidr is defined %}
  166. ingressIPNetworkCIDR: {{ openshift_master_ingress_ip_network_cidr }}
  167. {% endif %}
  168. oauthConfig:
  169. {% if 'oauth_always_show_provider_selection' in openshift.master %}
  170. alwaysShowProviderSelection: {{ openshift.master.oauth_always_show_provider_selection }}
  171. {% endif %}
  172. {% if l_openshift_master_oauth_templates %}
  173. templates:{{ l_openshift_master_oauth_templates | lib_utils_to_padded_yaml(level=2) }}
  174. {% endif %}
  175. assetPublicURL: {{ openshift.master.public_console_url }}/
  176. grantConfig:
  177. method: {{ openshift.master.oauth_grant_method }}
  178. identityProviders:
  179. {% for line in translated_identity_providers.splitlines() %}
  180. {{ line }}
  181. {% endfor %}
  182. masterCA: ca-bundle.crt
  183. masterPublicURL: {{ openshift.master.public_api_url }}
  184. masterURL: {{ openshift.master.api_url }}
  185. sessionConfig:
  186. sessionMaxAgeSeconds: {{ openshift.master.session_max_seconds }}
  187. sessionName: {{ openshift.master.session_name }}
  188. {% if openshift.master.session_auth_secrets is defined and openshift.master.session_encryption_secrets is defined %}
  189. sessionSecretsFile: {{ openshift.master.session_secrets_file }}
  190. {% endif %}
  191. tokenConfig:
  192. accessTokenMaxAgeSeconds: {{ openshift.master.access_token_max_seconds }}
  193. authorizeTokenMaxAgeSeconds: {{ openshift.master.auth_token_max_seconds }}
  194. pauseControllers: false
  195. policyConfig:
  196. bootstrapPolicyFile: {{ openshift_master_policy }}
  197. openshiftInfrastructureNamespace: openshift-infra
  198. openshiftSharedResourcesNamespace: openshift
  199. projectConfig:
  200. defaultNodeSelector: "{{ hostvars[groups.oo_first_master.0].l_osm_default_node_selector }}"
  201. projectRequestMessage: "{{ osm_project_request_message }}"
  202. projectRequestTemplate: "{{ osm_project_request_template }}"
  203. securityAllocator:
  204. mcsAllocatorRange: "{{ osm_mcs_allocator_range }}"
  205. mcsLabelsPerProject: {{ osm_mcs_labels_per_project }}
  206. uidAllocatorRange: "{{ osm_uid_allocator_range }}"
  207. routingConfig:
  208. subdomain: "{{ openshift_master_default_subdomain }}"
  209. serviceAccountConfig:
  210. limitSecretReferences: {{ openshift_master_saconfig_limitsecretreferences | default(false) }}
  211. managedNames:
  212. - default
  213. - builder
  214. - deployer
  215. masterCA: ca-bundle.crt
  216. privateKeyFile: serviceaccounts.private.key
  217. publicKeyFiles:
  218. - serviceaccounts.public.key
  219. servingInfo:
  220. bindAddress: {{ openshift.master.bind_addr }}:{{ openshift.master.api_port }}
  221. bindNetwork: tcp4
  222. certFile: master.server.crt
  223. clientCA: ca.crt
  224. keyFile: master.server.key
  225. maxRequestsInFlight: {{ openshift.master.max_requests_inflight }}
  226. requestTimeoutSeconds: 3600
  227. {% if openshift.master.named_certificates | default([]) | length > 0 %}
  228. namedCertificates:
  229. {% for named_certificate in openshift.master.named_certificates %}
  230. - certFile: {{ named_certificate['certfile'] }}
  231. keyFile: {{ named_certificate['keyfile'] }}
  232. names:
  233. {% for name in named_certificate['names'] %}
  234. - "{{ name }}"
  235. {% endfor %}
  236. {% endfor %}
  237. {% endif %}
  238. {% if openshift_master_min_tls_version is defined %}
  239. minTLSVersion: {{ openshift_master_min_tls_version }}
  240. {% endif %}
  241. {% if openshift_master_cipher_suites is defined %}
  242. cipherSuites:
  243. {% for cipher_suite in openshift_master_cipher_suites %}
  244. - {{ cipher_suite }}
  245. {% endfor %}
  246. {% endif %}
  247. volumeConfig:
  248. dynamicProvisioningEnabled: {{ openshift.master.dynamic_provisioning_enabled }}