master.yaml.v1.j2 9.8 KB

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