master.yaml.v1.j2 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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. controllerLeaseTTL: {{ openshift.master.controller_lease_ttl | default('30') }}
  43. {% endif %}
  44. controllers: '*'
  45. corsAllowedOrigins:
  46. {% for origin in ['127.0.0.1', 'localhost', openshift.common.ip, openshift.common.public_ip] | union(openshift.common.all_hostnames) | unique %}
  47. - {{ origin }}
  48. {% endfor %}
  49. {% for custom_origin in openshift.master.custom_cors_origins | default("") %}
  50. - {{ custom_origin }}
  51. {% endfor %}
  52. {% if 'disabled_features' in openshift.master %}
  53. disabledFeatures: {{ openshift.master.disabled_features | to_json }}
  54. {% endif %}
  55. {% if openshift.master.embedded_dns | bool %}
  56. dnsConfig:
  57. bindAddress: {{ openshift.master.bind_addr }}:{{ openshift.master.dns_port }}
  58. bindNetwork: tcp4
  59. {% endif %}
  60. etcdClientInfo:
  61. ca: {{ "ca.crt" if (openshift.master.embedded_etcd | bool) else "master.etcd-ca.crt" }}
  62. certFile: master.etcd-client.crt
  63. keyFile: master.etcd-client.key
  64. urls:
  65. {% for etcd_url in openshift.master.etcd_urls %}
  66. - {{ etcd_url }}
  67. {% endfor %}
  68. {% if openshift.master.embedded_etcd | bool %}
  69. etcdConfig:
  70. address: {{ openshift.common.hostname }}:{{ openshift.master.etcd_port }}
  71. peerAddress: {{ openshift.common.hostname }}:7001
  72. peerServingInfo:
  73. bindAddress: {{ openshift.master.bind_addr }}:7001
  74. certFile: etcd.server.crt
  75. clientCA: ca.crt
  76. keyFile: etcd.server.key
  77. servingInfo:
  78. bindAddress: {{ openshift.master.bind_addr }}:{{ openshift.master.etcd_port }}
  79. certFile: etcd.server.crt
  80. clientCA: ca.crt
  81. keyFile: etcd.server.key
  82. storageDirectory: {{ openshift.common.data_dir }}/openshift.local.etcd
  83. {% endif %}
  84. etcdStorageConfig:
  85. kubernetesStoragePrefix: kubernetes.io
  86. kubernetesStorageVersion: v1
  87. openShiftStoragePrefix: openshift.io
  88. openShiftStorageVersion: v1
  89. imageConfig:
  90. format: {{ openshift.master.registry_url }}
  91. latest: false
  92. {% if 'image_policy_config' in openshift.master %}
  93. imagePolicyConfig:{{ openshift.master.image_policy_config | to_padded_yaml(level=1) }}
  94. {% endif %}
  95. kind: MasterConfig
  96. kubeletClientInfo:
  97. {# TODO: allow user specified kubelet port #}
  98. ca: ca.crt
  99. certFile: master.kubelet-client.crt
  100. keyFile: master.kubelet-client.key
  101. port: 10250
  102. {% if openshift.master.embedded_kube | bool %}
  103. kubernetesMasterConfig:
  104. {% if not openshift.common.version_gte_3_1_or_1_1 | bool %}
  105. apiLevels:
  106. - v1beta3
  107. - v1
  108. {% endif %}
  109. admissionConfig:
  110. {% if 'kube_admission_plugin_order' in openshift.master %}
  111. pluginOrderOverride:{{ openshift.master.kube_admission_plugin_order | to_padded_yaml(level=3) }}
  112. {% endif %}
  113. {% if 'kube_admission_plugin_config' in openshift.master %}
  114. pluginConfig:{{ openshift.master.kube_admission_plugin_config | to_padded_yaml(level=3) }}
  115. {% endif %}
  116. apiServerArguments: {{ openshift.master.api_server_args | default(None) | to_padded_yaml( level=2 ) }}
  117. controllerArguments: {{ openshift.master.controller_args | default(None) | to_padded_yaml( level=2 ) }}
  118. masterCount: {{ openshift.master.master_count if openshift.master.cluster_method | default(None) == 'native' else 1 }}
  119. masterIP: {{ openshift.common.ip }}
  120. podEvictionTimeout: {{ openshift.master.pod_eviction_timeout | default("") }}
  121. proxyClientInfo:
  122. certFile: master.proxy-client.crt
  123. keyFile: master.proxy-client.key
  124. schedulerConfigFile: {{ openshift_master_scheduler_conf }}
  125. servicesNodePortRange: ""
  126. servicesSubnet: {{ openshift.common.portal_net }}
  127. staticNodeNames: {{ openshift_node_ips | default([], true) }}
  128. {% endif %}
  129. masterClients:
  130. {# TODO: allow user to set externalKubernetesKubeConfig #}
  131. externalKubernetesKubeConfig: ""
  132. openshiftLoopbackKubeConfig: openshift-master.kubeconfig
  133. masterPublicURL: {{ openshift.master.public_api_url }}
  134. networkConfig:
  135. clusterNetworkCIDR: {{ openshift.master.sdn_cluster_network_cidr }}
  136. hostSubnetLength: {{ openshift.master.sdn_host_subnet_length }}
  137. {% if openshift.common.use_openshift_sdn or openshift.common.use_nuage %}
  138. networkPluginName: {{ openshift.common.sdn_network_plugin_name }}
  139. {% endif %}
  140. # serviceNetworkCIDR must match kubernetesMasterConfig.servicesSubnet
  141. serviceNetworkCIDR: {{ openshift.common.portal_net }}
  142. oauthConfig:
  143. {% if 'oauth_always_show_provider_selection' in openshift.master %}
  144. alwaysShowProviderSelection: {{ openshift.master.oauth_always_show_provider_selection }}
  145. {% endif %}
  146. {% if 'oauth_templates' in openshift.master %}
  147. templates:{{ openshift.master.oauth_templates | to_padded_yaml(level=2) }}
  148. {% endif %}
  149. assetPublicURL: {{ openshift.master.public_console_url }}/
  150. grantConfig:
  151. method: {{ openshift.master.oauth_grant_method }}
  152. identityProviders:
  153. {% for line in translated_identity_providers.splitlines() %}
  154. {{ line }}
  155. {% endfor %}
  156. masterCA: ca.crt
  157. masterPublicURL: {{ openshift.master.public_api_url }}
  158. masterURL: {{ openshift.master.api_url }}
  159. sessionConfig:
  160. sessionMaxAgeSeconds: {{ openshift.master.session_max_seconds }}
  161. sessionName: {{ openshift.master.session_name }}
  162. {% if openshift.master.session_auth_secrets is defined and openshift.master.session_encryption_secrets is defined %}
  163. sessionSecretsFile: {{ openshift.master.session_secrets_file }}
  164. {% endif %}
  165. tokenConfig:
  166. accessTokenMaxAgeSeconds: {{ openshift.master.access_token_max_seconds }}
  167. authorizeTokenMaxAgeSeconds: {{ openshift.master.auth_token_max_seconds }}
  168. pauseControllers: false
  169. policyConfig:
  170. bootstrapPolicyFile: {{ openshift_master_policy }}
  171. openshiftInfrastructureNamespace: openshift-infra
  172. openshiftSharedResourcesNamespace: openshift
  173. projectConfig:
  174. defaultNodeSelector: "{{ openshift.master.default_node_selector }}"
  175. projectRequestMessage: "{{ openshift.master.project_request_message }}"
  176. projectRequestTemplate: "{{ openshift.master.project_request_template }}"
  177. securityAllocator:
  178. mcsAllocatorRange: "{{ openshift.master.mcs_allocator_range }}"
  179. mcsLabelsPerProject: {{ openshift.master.mcs_labels_per_project }}
  180. uidAllocatorRange: "{{ openshift.master.uid_allocator_range }}"
  181. routingConfig:
  182. subdomain: "{{ openshift.master.default_subdomain | default("") }}"
  183. serviceAccountConfig:
  184. limitSecretReferences: false
  185. managedNames:
  186. - default
  187. - builder
  188. - deployer
  189. masterCA: ca.crt
  190. privateKeyFile: serviceaccounts.private.key
  191. publicKeyFiles:
  192. - serviceaccounts.public.key
  193. servingInfo:
  194. bindAddress: {{ openshift.master.bind_addr }}:{{ openshift.master.api_port }}
  195. bindNetwork: tcp4
  196. certFile: master.server.crt
  197. clientCA: ca.crt
  198. keyFile: master.server.key
  199. maxRequestsInFlight: 500
  200. requestTimeoutSeconds: 3600
  201. {% if openshift.master.named_certificates %}
  202. namedCertificates:
  203. {% for named_certificate in openshift.master.named_certificates %}
  204. - certFile: {{ named_certificate['certfile'] }}
  205. keyFile: {{ named_certificate['keyfile'] }}
  206. names:
  207. {% for name in named_certificate['names'] %}
  208. - "{{ name }}"
  209. {% endfor %}
  210. {% endfor %}
  211. {% endif %}