master.yaml.v1.j2 11 KB

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