master.yaml.v1.j2 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. kind: MasterConfig
  2. apiVersion: v1
  3. admissionConfig:
  4. pluginConfig:{{ openshift.master.admission_plugin_config | default(None) | lib_utils_to_padded_yaml(level=2) }}
  5. PodPreset:
  6. configuration:
  7. kind: DefaultAdmissionConfig
  8. apiVersion: v1
  9. disable: true
  10. aggregatorConfig:
  11. proxyClientInfo:
  12. certFile: aggregator-front-proxy.crt
  13. keyFile: aggregator-front-proxy.key
  14. authConfig:
  15. requestHeader:
  16. clientCA: front-proxy-ca.crt
  17. clientCommonNames:
  18. - aggregator-front-proxy
  19. usernameHeaders:
  20. - X-Remote-User
  21. groupHeaders:
  22. - X-Remote-Group
  23. extraHeaderPrefixes:
  24. - X-Remote-Extra-
  25. apiLevels:
  26. - v1
  27. {% if openshift_master_audit_config is defined %}
  28. auditConfig:{{ openshift_master_audit_config | lib_utils_to_padded_yaml(level=1) }}
  29. {% endif %}
  30. controllerConfig:
  31. election:
  32. lockName: openshift-master-controllers
  33. serviceServingCert:
  34. signer:
  35. certFile: service-signer.crt
  36. keyFile: service-signer.key
  37. controllers: '*'
  38. corsAllowedOrigins:
  39. # anchor with start (\A) and end (\z) of the string, make the check case insensitive ((?i)) and escape hostname
  40. {% for origin in ['127.0.0.1', 'localhost', openshift.common.ip, openshift.common.public_ip] | union(openshift.common.all_hostnames) | unique %}
  41. - (?i)//{{ origin | regex_escape() }}(:|\z)
  42. {% endfor %}
  43. {% for custom_origin in osm_custom_cors_origins | default("") %}
  44. - (?i)//{{ custom_origin | regex_escape() }}(:|\z)
  45. {% endfor %}
  46. {% if 'disabled_features' in openshift.master %}
  47. disabledFeatures: {{ openshift.master.disabled_features | to_json }}
  48. {% endif %}
  49. {% if openshift_master_embedded_dns | bool %}
  50. dnsConfig:
  51. bindAddress: {{ openshift.master.bind_addr }}:{{ openshift_master_dns_port }}
  52. bindNetwork: tcp4
  53. {% endif %}
  54. etcdClientInfo:
  55. ca: master.etcd-ca.crt
  56. certFile: master.etcd-client.crt
  57. keyFile: master.etcd-client.key
  58. urls:
  59. {% for etcd_url in openshift_master_etcd_urls %}
  60. - {{ etcd_url }}
  61. {% endfor %}
  62. etcdStorageConfig:
  63. kubernetesStoragePrefix: kubernetes.io
  64. kubernetesStorageVersion: v1
  65. openShiftStoragePrefix: openshift.io
  66. openShiftStorageVersion: v1
  67. imageConfig:
  68. format: {{ l_os_registry_url }}
  69. latest: {{ openshift_master_image_config_latest }}
  70. imagePolicyConfig:{{ openshift.master.image_policy_config | default({"internalRegistryHostname":"docker-registry.default.svc:5000"}) | lib_utils_to_padded_yaml(level=1) }}
  71. kubeletClientInfo:
  72. {# TODO: allow user specified kubelet port #}
  73. ca: ca-bundle.crt
  74. certFile: master.kubelet-client.crt
  75. keyFile: master.kubelet-client.key
  76. port: 10250
  77. {% if openshift_master_embedded_kube | bool %}
  78. kubernetesMasterConfig:
  79. apiServerArguments:
  80. {{ openshift.master.api_server_args | default(None) | lib_utils_to_padded_yaml( level=2 ) }}
  81. storage-backend:
  82. - etcd3
  83. storage-media-type:
  84. - application/vnd.kubernetes.protobuf
  85. controllerArguments: {{ openshift.master.controller_args | default(None) | lib_utils_to_padded_yaml( level=2 ) }}
  86. masterCount: {{ openshift_master_count | default(groups.oo_masters | length) }}
  87. masterIP: {{ openshift.common.ip }}
  88. podEvictionTimeout: {{ openshift_master_pod_eviction_timeout }}
  89. proxyClientInfo:
  90. certFile: master.proxy-client.crt
  91. keyFile: master.proxy-client.key
  92. schedulerArguments: {{ openshift_master_scheduler_args | default(None) | lib_utils_to_padded_yaml( level=3 ) }}
  93. schedulerConfigFile: {{ openshift_master_scheduler_conf }}
  94. servicesNodePortRange: "{{ openshift_node_port_range | default("") }}"
  95. servicesSubnet: {{ openshift.common.portal_net }}
  96. staticNodeNames: {{ openshift_node_ips | default([], true) }}
  97. {% endif %}
  98. masterClients:
  99. {# TODO: allow user to set externalKubernetesKubeConfig #}
  100. externalKubernetesClientConnectionOverrides:
  101. acceptContentTypes: application/vnd.kubernetes.protobuf,application/json
  102. contentType: application/vnd.kubernetes.protobuf
  103. burst: {{ openshift_master_external_ratelimit_burst | default(400) }}
  104. qps: {{ openshift_master_external_ratelimit_qps | default(200) }}
  105. externalKubernetesKubeConfig: ""
  106. openshiftLoopbackClientConnectionOverrides:
  107. acceptContentTypes: application/vnd.kubernetes.protobuf,application/json
  108. contentType: application/vnd.kubernetes.protobuf
  109. burst: {{ openshift_master_loopback_ratelimit_burst | default(600) }}
  110. qps: {{ openshift_master_loopback_ratelimit_qps | default(300) }}
  111. openshiftLoopbackKubeConfig: openshift-master.kubeconfig
  112. masterPublicURL: {{ openshift.master.public_api_url }}
  113. networkConfig:
  114. clusterNetworks:
  115. - cidr: {{ openshift_cluster_network_cidr }}
  116. hostSubnetLength: {{ openshift_host_subnet_length }}
  117. {% 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' %}
  118. networkPluginName: {{ r_openshift_master_sdn_network_plugin_name_default }}
  119. {% endif %}
  120. # serviceNetworkCIDR must match kubernetesMasterConfig.servicesSubnet
  121. serviceNetworkCIDR: {{ openshift.common.portal_net }}
  122. externalIPNetworkCIDRs: {{ openshift_master_external_ip_network_cidrs | default(["0.0.0.0/0"]) | lib_utils_to_padded_yaml(1,2) }}
  123. {% if openshift_master_ingress_ip_network_cidr is defined %}
  124. ingressIPNetworkCIDR: {{ openshift_master_ingress_ip_network_cidr }}
  125. {% endif %}
  126. oauthConfig:
  127. {% if openshift_master_oauth_always_show_provider_selection is defined %}
  128. alwaysShowProviderSelection: {{ openshift_master_oauth_always_show_provider_selection }}
  129. {% endif %}
  130. {% if l_openshift_master_oauth_templates %}
  131. templates:{{ l_openshift_master_oauth_templates | lib_utils_to_padded_yaml(level=2) }}
  132. {% endif %}
  133. assetPublicURL: {{ openshift.master.public_console_url }}/
  134. grantConfig:
  135. method: {{ openshift_master_oauth_grant_method }}
  136. identityProviders:
  137. {% for line in translated_identity_providers.splitlines() %}
  138. {{ line }}
  139. {% endfor %}
  140. masterCA: ca-bundle.crt
  141. masterPublicURL: {{ openshift.master.public_api_url }}
  142. masterURL: {{ openshift.master.api_url }}
  143. sessionConfig:
  144. sessionMaxAgeSeconds: {{ openshift.master.session_max_seconds }}
  145. sessionName: {{ openshift.master.session_name }}
  146. sessionSecretsFile: {{ openshift_master_session_secrets_file }}
  147. tokenConfig:
  148. accessTokenMaxAgeSeconds: {{ openshift_master_access_token_max_seconds }}
  149. authorizeTokenMaxAgeSeconds: {{ openshift_master_auth_token_max_seconds }}
  150. pauseControllers: false
  151. policyConfig:
  152. bootstrapPolicyFile: {{ openshift_master_policy }}
  153. openshiftInfrastructureNamespace: openshift-infra
  154. openshiftSharedResourcesNamespace: openshift
  155. projectConfig:
  156. defaultNodeSelector: "{{ hostvars[groups.oo_first_master.0].l_osm_default_node_selector }}"
  157. projectRequestMessage: "{{ osm_project_request_message }}"
  158. projectRequestTemplate: "{{ osm_project_request_template }}"
  159. securityAllocator:
  160. mcsAllocatorRange: "{{ osm_mcs_allocator_range }}"
  161. mcsLabelsPerProject: {{ osm_mcs_labels_per_project }}
  162. uidAllocatorRange: "{{ osm_uid_allocator_range }}"
  163. routingConfig:
  164. subdomain: "{{ openshift_master_default_subdomain }}"
  165. serviceAccountConfig:
  166. limitSecretReferences: {{ openshift_master_saconfig_limitsecretreferences | default(false) }}
  167. managedNames:
  168. - default
  169. - builder
  170. - deployer
  171. masterCA: ca-bundle.crt
  172. privateKeyFile: serviceaccounts.private.key
  173. publicKeyFiles:
  174. - serviceaccounts.public.key
  175. servingInfo:
  176. bindAddress: {{ openshift.master.bind_addr }}:{{ openshift_master_api_port }}
  177. bindNetwork: tcp4
  178. certFile: master.server.crt
  179. clientCA: ca.crt
  180. keyFile: master.server.key
  181. maxRequestsInFlight: {{ openshift_master_max_requests_inflight }}
  182. requestTimeoutSeconds: 3600
  183. {% if openshift.master.named_certificates | default([]) | length > 0 %}
  184. namedCertificates:
  185. {% for named_certificate in openshift.master.named_certificates %}
  186. - certFile: {{ named_certificate['certfile'] }}
  187. keyFile: {{ named_certificate['keyfile'] }}
  188. names:
  189. {% for name in named_certificate['names'] %}
  190. - "{{ name }}"
  191. {% endfor %}
  192. {% endfor %}
  193. {% endif %}
  194. {% if openshift_master_min_tls_version is defined %}
  195. minTLSVersion: {{ openshift_master_min_tls_version }}
  196. {% endif %}
  197. {% if openshift_master_cipher_suites is defined %}
  198. cipherSuites:
  199. {% for cipher_suite in openshift_master_cipher_suites %}
  200. - {{ cipher_suite }}
  201. {% endfor %}
  202. {% endif %}
  203. volumeConfig:
  204. dynamicProvisioningEnabled: {{ openshift_master_dynamic_provisioning_enabled }}