master.yaml.v1.j2 7.3 KB

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