master.yaml.v1.j2 9.6 KB

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