|
13 | 13 | def install_kubernetes(airgap_dir = ONE_AIRGAP_DIR) |
14 | 14 | rke2_release_url = "https://github.com/rancher/rke2/releases/download/#{ONE_SERVICE_RKE2_VERSION}" |
15 | 15 |
|
16 | | - amap= { |
17 | | - "x86_64" => "amd64", |
18 | | - "aarch64" => "arm64" |
19 | | - } |
20 | 16 | begin |
21 | | - arch = amap[`arch`.strip] |
| 17 | + arch = {'x86_64' => 'amd64', 'aarch64' => 'arm64'}[`arch`.strip] |
22 | 18 | rescue KeyError |
23 | | - msg :error, "Unknown architecture" |
24 | | - exit 1 |
| 19 | + msg :error, 'Unknown architecture' |
| 20 | + exit 1 |
25 | 21 | end |
26 | 22 |
|
27 | 23 | msg :info, "Install RKE2 runtime: #{ONE_SERVICE_RKE2_VERSION}" |
@@ -203,6 +199,8 @@ def init_master |
203 | 199 | 'node-taint' => ['CriticalAddonsOnly=true:NoExecute'], |
204 | 200 | 'disable' => ['rke2-ingress-nginx'], |
205 | 201 | 'cni' => cni, |
| 202 | + 'cluster-cidr' => ONEAPP_K8S_CLUSTER_CIDR, |
| 203 | + 'service-cidr' => ONEAPP_K8S_SERVICE_CIDR, |
206 | 204 | 'disable-kube-proxy' => ONEAPP_K8S_CNI_PLUGIN == 'cilium', |
207 | 205 | 'disable-cloud-controller' => ONEAPP_RKE2_CLOUD_CONTROLLER_ENABLED == false |
208 | 206 | } |
@@ -260,6 +258,8 @@ def join_master(token, retries = RETRIES, seconds = SECONDS) |
260 | 258 | 'node-taint' => ['CriticalAddonsOnly=true:NoExecute'], |
261 | 259 | 'disable' => ['rke2-ingress-nginx'], |
262 | 260 | 'cni' => cni, |
| 261 | + 'cluster-cidr' => ONEAPP_K8S_CLUSTER_CIDR, |
| 262 | + 'service-cidr' => ONEAPP_K8S_SERVICE_CIDR, |
263 | 263 | 'disable-kube-proxy' => ONEAPP_K8S_CNI_PLUGIN == 'cilium', |
264 | 264 | 'disable-cloud-controller' => ONEAPP_RKE2_CLOUD_CONTROLLER_ENABLED == false |
265 | 265 | } |
@@ -392,10 +392,13 @@ def configure_rke2_proxy(current_role) |
392 | 392 | proxy_config = [] |
393 | 393 | proxy_config << "HTTP_PROXY=#{ONEAPP_K8S_HTTP_PROXY}" unless ONEAPP_K8S_HTTP_PROXY.nil? |
394 | 394 | proxy_config << "HTTPS_PROXY=#{ONEAPP_K8S_HTTPS_PROXY}" unless ONEAPP_K8S_HTTPS_PROXY.nil? |
| 395 | + |
395 | 396 | if ONEAPP_K8S_NO_PROXY.to_s.empty? |
396 | | - no_proxy = ['127.0.0.1/32', 'localhost'] |
| 397 | + no_proxy = ['127.0.0.0/8', 'localhost'] |
397 | 398 | no_proxy << retrieve_endpoint_host(ONEAPP_K8S_CONTROL_PLANE_EP) if ONEAPP_K8S_CONTROL_PLANE_EP |
398 | 399 | no_proxy << retrieve_endpoint_host(ONEAPP_RKE2_SUPERVISOR_EP) if ONEAPP_RKE2_SUPERVISOR_EP |
| 400 | + no_proxy << ONEAPP_K8S_CLUSTER_CIDR |
| 401 | + no_proxy << ONEAPP_K8S_SERVICE_CIDR |
399 | 402 | proxy_config << "NO_PROXY=#{no_proxy.uniq.join(',')}" |
400 | 403 | else |
401 | 404 | proxy_config << "NO_PROXY=#{ONEAPP_K8S_NO_PROXY}" |
|
0 commit comments