master.yaml.v1.j2 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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_is_atomic | bool %}
  87. flex-volume-plugin-dir:
  88. - "/etc/origin/kubelet-plugins/volume/exec"
  89. {% endif %}
  90. {% if openshift_master_use_persistentlocalvolumes | bool %}
  91. feature-gates:
  92. - PersistentLocalVolumes=true
  93. - VolumeScheduling=true
  94. {% endif %}
  95. masterCount: {{ openshift_master_count | default(groups.oo_masters | length) }}
  96. masterIP: {{ openshift.common.ip }}
  97. podEvictionTimeout: {{ openshift_master_pod_eviction_timeout }}
  98. proxyClientInfo:
  99. certFile: master.proxy-client.crt
  100. keyFile: master.proxy-client.key
  101. schedulerArguments: {{ openshift_master_scheduler_args | default(None) | lib_utils_to_padded_yaml( level=3 ) }}
  102. schedulerConfigFile: {{ openshift_master_scheduler_conf }}
  103. servicesNodePortRange: "{{ openshift_node_port_range | default("") }}"
  104. servicesSubnet: {{ openshift.common.portal_net }}
  105. staticNodeNames: {{ openshift_node_ips | default([], true) }}
  106. {% endif %}
  107. masterClients:
  108. {# TODO: allow user to set externalKubernetesKubeConfig #}
  109. externalKubernetesClientConnectionOverrides:
  110. acceptContentTypes: application/vnd.kubernetes.protobuf,application/json
  111. contentType: application/vnd.kubernetes.protobuf
  112. burst: {{ openshift_master_external_ratelimit_burst | default(400) }}
  113. qps: {{ openshift_master_external_ratelimit_qps | default(200) }}
  114. externalKubernetesKubeConfig: ""
  115. openshiftLoopbackClientConnectionOverrides:
  116. acceptContentTypes: application/vnd.kubernetes.protobuf,application/json
  117. contentType: application/vnd.kubernetes.protobuf
  118. burst: {{ openshift_master_loopback_ratelimit_burst | default(600) }}
  119. qps: {{ openshift_master_loopback_ratelimit_qps | default(300) }}
  120. openshiftLoopbackKubeConfig: openshift-master.kubeconfig
  121. masterPublicURL: {{ openshift.master.public_api_url }}
  122. networkConfig:
  123. clusterNetworks:
  124. - cidr: {{ openshift_cluster_network_cidr }}
  125. hostSubnetLength: {{ openshift_host_subnet_length }}
  126. {% 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' %}
  127. networkPluginName: {{ r_openshift_master_sdn_network_plugin_name_default }}
  128. {% endif %}
  129. # serviceNetworkCIDR must match kubernetesMasterConfig.servicesSubnet
  130. serviceNetworkCIDR: {{ openshift.common.portal_net }}
  131. externalIPNetworkCIDRs: {{ openshift_master_external_ip_network_cidrs | default(["0.0.0.0/0"]) | lib_utils_to_padded_yaml(1,2) }}
  132. {% if openshift_master_ingress_ip_network_cidr is defined %}
  133. ingressIPNetworkCIDR: {{ openshift_master_ingress_ip_network_cidr }}
  134. {% endif %}
  135. oauthConfig:
  136. {% if openshift_master_oauth_always_show_provider_selection is defined %}
  137. alwaysShowProviderSelection: {{ openshift_master_oauth_always_show_provider_selection }}
  138. {% endif %}
  139. {% if l_openshift_master_oauth_templates %}
  140. templates:{{ l_openshift_master_oauth_templates | lib_utils_to_padded_yaml(level=2) }}
  141. {% endif %}
  142. assetPublicURL: {{ openshift.master.public_console_url }}/
  143. grantConfig:
  144. method: {{ openshift_master_oauth_grant_method }}
  145. identityProviders:
  146. {% for line in translated_identity_providers.splitlines() %}
  147. {{ line }}
  148. {% endfor %}
  149. masterCA: ca-bundle.crt
  150. masterPublicURL: {{ openshift.master.public_api_url }}
  151. masterURL: {{ openshift.master.api_url }}
  152. sessionConfig:
  153. sessionMaxAgeSeconds: {{ openshift.master.session_max_seconds }}
  154. sessionName: {{ openshift.master.session_name }}
  155. sessionSecretsFile: {{ openshift_master_session_secrets_file }}
  156. tokenConfig:
  157. accessTokenMaxAgeSeconds: {{ openshift_master_access_token_max_seconds }}
  158. authorizeTokenMaxAgeSeconds: {{ openshift_master_auth_token_max_seconds }}
  159. pauseControllers: false
  160. policyConfig:
  161. bootstrapPolicyFile: {{ openshift_master_policy }}
  162. openshiftInfrastructureNamespace: openshift-infra
  163. openshiftSharedResourcesNamespace: openshift
  164. projectConfig:
  165. defaultNodeSelector: "{{ hostvars[groups.oo_first_master.0].l_osm_default_node_selector }}"
  166. projectRequestMessage: "{{ osm_project_request_message }}"
  167. projectRequestTemplate: "{{ osm_project_request_template }}"
  168. securityAllocator:
  169. mcsAllocatorRange: "{{ osm_mcs_allocator_range }}"
  170. mcsLabelsPerProject: {{ osm_mcs_labels_per_project }}
  171. uidAllocatorRange: "{{ osm_uid_allocator_range }}"
  172. routingConfig:
  173. subdomain: "{{ openshift_master_default_subdomain }}"
  174. serviceAccountConfig:
  175. limitSecretReferences: {{ openshift_master_saconfig_limitsecretreferences | default(false) }}
  176. managedNames:
  177. - default
  178. - builder
  179. - deployer
  180. masterCA: ca-bundle.crt
  181. privateKeyFile: serviceaccounts.private.key
  182. publicKeyFiles:
  183. - serviceaccounts.public.key
  184. servingInfo:
  185. bindAddress: {{ openshift.master.bind_addr }}:{{ openshift_master_api_port }}
  186. bindNetwork: tcp4
  187. certFile: master.server.crt
  188. clientCA: ca.crt
  189. keyFile: master.server.key
  190. maxRequestsInFlight: {{ openshift_master_max_requests_inflight }}
  191. requestTimeoutSeconds: 3600
  192. {% if openshift.master.named_certificates | default([]) | length > 0 %}
  193. namedCertificates:
  194. {% for named_certificate in openshift.master.named_certificates %}
  195. - certFile: {{ named_certificate['certfile'] }}
  196. keyFile: {{ named_certificate['keyfile'] }}
  197. names:
  198. {% for name in named_certificate['names'] %}
  199. - "{{ name }}"
  200. {% endfor %}
  201. {% endfor %}
  202. {% endif %}
  203. {% if openshift_master_min_tls_version is defined %}
  204. minTLSVersion: {{ openshift_master_min_tls_version }}
  205. {% endif %}
  206. {% if openshift_master_cipher_suites is defined %}
  207. cipherSuites:
  208. {% for cipher_suite in openshift_master_cipher_suites %}
  209. - {{ cipher_suite }}
  210. {% endfor %}
  211. {% endif %}
  212. volumeConfig:
  213. dynamicProvisioningEnabled: {{ openshift_master_dynamic_provisioning_enabled }}