master.yaml.v1.j2 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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. clusterNetworkCIDR: {{ openshift.master.sdn_cluster_network_cidr }}
  115. hostSubnetLength: {{ openshift.master.sdn_host_subnet_length }}
  116. clusterNetworks:
  117. - cidr: {{ openshift.master.sdn_cluster_network_cidr }}
  118. hostSubnetLength: {{ openshift.master.sdn_host_subnet_length }}
  119. {% 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' %}
  120. networkPluginName: {{ r_openshift_master_sdn_network_plugin_name_default }}
  121. {% endif %}
  122. # serviceNetworkCIDR must match kubernetesMasterConfig.servicesSubnet
  123. serviceNetworkCIDR: {{ openshift.common.portal_net }}
  124. externalIPNetworkCIDRs: {{ openshift_master_external_ip_network_cidrs | default(["0.0.0.0/0"]) | lib_utils_to_padded_yaml(1,2) }}
  125. {% if openshift_master_ingress_ip_network_cidr is defined %}
  126. ingressIPNetworkCIDR: {{ openshift_master_ingress_ip_network_cidr }}
  127. {% endif %}
  128. oauthConfig:
  129. {% if openshift_master_oauth_always_show_provider_selection is defined %}
  130. alwaysShowProviderSelection: {{ openshift_master_oauth_always_show_provider_selection }}
  131. {% endif %}
  132. {% if l_openshift_master_oauth_templates %}
  133. templates:{{ l_openshift_master_oauth_templates | lib_utils_to_padded_yaml(level=2) }}
  134. {% endif %}
  135. assetPublicURL: {{ openshift.master.public_console_url }}/
  136. grantConfig:
  137. method: {{ openshift_master_oauth_grant_method }}
  138. identityProviders:
  139. {% for line in translated_identity_providers.splitlines() %}
  140. {{ line }}
  141. {% endfor %}
  142. masterCA: ca-bundle.crt
  143. masterPublicURL: {{ openshift.master.public_api_url }}
  144. masterURL: {{ openshift.master.api_url }}
  145. sessionConfig:
  146. sessionMaxAgeSeconds: {{ openshift.master.session_max_seconds }}
  147. sessionName: {{ openshift.master.session_name }}
  148. sessionSecretsFile: {{ openshift_master_session_secrets_file }}
  149. tokenConfig:
  150. accessTokenMaxAgeSeconds: {{ openshift_master_access_token_max_seconds }}
  151. authorizeTokenMaxAgeSeconds: {{ openshift_master_auth_token_max_seconds }}
  152. pauseControllers: false
  153. policyConfig:
  154. bootstrapPolicyFile: {{ openshift_master_policy }}
  155. openshiftInfrastructureNamespace: openshift-infra
  156. openshiftSharedResourcesNamespace: openshift
  157. projectConfig:
  158. defaultNodeSelector: "{{ hostvars[groups.oo_first_master.0].l_osm_default_node_selector }}"
  159. projectRequestMessage: "{{ osm_project_request_message }}"
  160. projectRequestTemplate: "{{ osm_project_request_template }}"
  161. securityAllocator:
  162. mcsAllocatorRange: "{{ osm_mcs_allocator_range }}"
  163. mcsLabelsPerProject: {{ osm_mcs_labels_per_project }}
  164. uidAllocatorRange: "{{ osm_uid_allocator_range }}"
  165. routingConfig:
  166. subdomain: "{{ openshift_master_default_subdomain }}"
  167. serviceAccountConfig:
  168. limitSecretReferences: {{ openshift_master_saconfig_limitsecretreferences | default(false) }}
  169. managedNames:
  170. - default
  171. - builder
  172. - deployer
  173. masterCA: ca-bundle.crt
  174. privateKeyFile: serviceaccounts.private.key
  175. publicKeyFiles:
  176. - serviceaccounts.public.key
  177. servingInfo:
  178. bindAddress: {{ openshift.master.bind_addr }}:{{ openshift.master.api_port }}
  179. bindNetwork: tcp4
  180. certFile: master.server.crt
  181. clientCA: ca.crt
  182. keyFile: master.server.key
  183. maxRequestsInFlight: {{ openshift_master_max_requests_inflight }}
  184. requestTimeoutSeconds: 3600
  185. {% if openshift.master.named_certificates | default([]) | length > 0 %}
  186. namedCertificates:
  187. {% for named_certificate in openshift.master.named_certificates %}
  188. - certFile: {{ named_certificate['certfile'] }}
  189. keyFile: {{ named_certificate['keyfile'] }}
  190. names:
  191. {% for name in named_certificate['names'] %}
  192. - "{{ name }}"
  193. {% endfor %}
  194. {% endfor %}
  195. {% endif %}
  196. {% if openshift_master_min_tls_version is defined %}
  197. minTLSVersion: {{ openshift_master_min_tls_version }}
  198. {% endif %}
  199. {% if openshift_master_cipher_suites is defined %}
  200. cipherSuites:
  201. {% for cipher_suite in openshift_master_cipher_suites %}
  202. - {{ cipher_suite }}
  203. {% endfor %}
  204. {% endif %}
  205. volumeConfig:
  206. dynamicProvisioningEnabled: {{ openshift_master_dynamic_provisioning_enabled }}