master.yaml.v1.j2 11 KB

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