File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 239239 fi
240240}
241241
242+ function configure_kubectl {
243+ echo -e " \\ 033[32m---> Start configuring kubectl defaults\\ 033[0m"
244+ mkdir -p " $HOME /.kube"
245+ cat << EOF > "$HOME /.kube/kuberc"
246+ apiVersion: kubectl.config.k8s.io/v1beta1
247+ kind: Preference
248+ defaults:
249+ # Default to server-side apply
250+ - command: apply
251+ options:
252+ - name: server-side
253+ default: "true"
254+ EOF
255+ chmod 600 " $HOME /.kube/kuberc"
256+ echo -e " \\ 033[32m---> Kubectl defaults configured (server-side apply enabled)\\ 033[0m"
257+ }
258+
242259function configure_k3s_mirrors {
243260 echo -e " \\ 033[32m---> Start configuring k3s mirrors\\ 033[0m"
244261 if [[ " ${INSTALL_DRYCC_MIRROR} " == " cn" ]] ; then
@@ -254,6 +271,7 @@ function configure_k3s_mirrors {
254271function install_k3s_server {
255272 configure_os
256273 install_runtime
274+ configure_kubectl
257275 configure_registry
258276 configure_k3s_mirrors
259277 INSTALL_K3S_EXEC=" server ${INSTALL_K3S_EXEC} --embedded-registry --flannel-backend=none --disable-network-policy --disable=traefik --disable=servicelb --disable-kube-proxy --cluster-cidr=${CLUSTER_CIDR} --service-cidr=${SERVICE_CIDR} "
281299function install_k3s_agent {
282300 configure_os
283301 install_runtime
302+ configure_kubectl
284303 configure_registry
285304 configure_k3s_mirrors
286305 if [[ -n " ${K3S_DATA_DIR} " ]] ; then
@@ -438,7 +457,7 @@ function install_gateway() {
438457
439458 helm repo add istio https://github.com/istio-charts
440459 helm repo update
441- kubectl apply --server-side - f $gateway_api_url /releases/download/${version} /experimental-install.yaml
460+ kubectl apply -f $gateway_api_url /releases/download/${version} /experimental-install.yaml
442461 helm upgrade --install istio-base istio/base -n istio-system --set defaultRevision=default --create-namespace --wait $options
443462 helm upgrade --install istio-istiod istio/istiod -n istio-system \
444463 --set pilot.env.PILOT_ENABLE_ALPHA_GATEWAY_API=true \
You can’t perform that action at this time.
0 commit comments