master.yaml.v1.j2 6.2 KB

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