master.yaml.v1.j2 8.4 KB

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