master.yaml.v1.j2 9.7 KB

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