master.yaml.v1.j2 10 KB

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