Skip to content

Commit 88c3bdc

Browse files
authored
Merge pull request #24 from jianxiaoguo/main
chore(workflow): modify install.sh uninstall.sh
2 parents 6fe2922 + 04128e8 commit 88c3bdc

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

_scripts/install.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,16 @@ function install_components {
147147
check_metallb
148148
helm repo update
149149
echo -e "\\033[32m---> Waiting for helm to install components...\\033[0m"
150-
api_server=(`kubectl config view -o=jsonpath='{.clusters[0].cluster.server}' | tr "://" " "`)
150+
api_server_address=(`ip -o route get to 8.8.8.8 | sed -n 's/.*src \([0-9.]\+\).*/\1/p'`)
151151
helm install cilium drycc/cilium \
152152
--set tunnel=geneve \
153153
--set operator.replicas=1 \
154154
--set bandwidthManager=true \
155155
--set kubeProxyReplacement=strict \
156-
--set k8sServiceHost=${api_server[1]} \
157-
--set k8sServicePort=${api_server[2]} \
156+
--set k8sServiceHost=${KUBE_API_SERVER_ADDRESS:-$api_server_address} \
157+
--set k8sServicePort=${KUBE_API_SERVER_PORT:-"6443"} \
158+
--set global.containerRuntime.integration="containerd" \
159+
--set global.containerRuntime.socketPath="/var/run/k3s/containerd/containerd.sock" \
158160
--set hostPort.enabled=true \
159161
--namespace kube-system --wait
160162

_scripts/uninstall.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@ set -eo pipefail
33
shopt -s expand_aliases
44

55
/usr/local/bin/k3s-killall.sh
6-
/usr/local/bin/k3s-uninstall.sh
6+
7+
if [[ -x /usr/local/bin/k3s-uninstall.sh ]] ; then
8+
/usr/local/bin/k3s-uninstall.sh
9+
fi
10+
11+
if [[ -x /usr/local/bin/k3s-agent-uninstall.sh ]] ; then
12+
/usr/local/bin/k3s-agent-uninstall.sh
13+
fi
714

815
if [[ -n "${K3S_DATA_DIR}" ]] ; then
916
rm -rf "${K3S_DATA_DIR}/rancher"

src/quickstart/install-workflow.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ DRYCC_ADMIN_PASSWORD | Required item, specify drycc's admi
178178
CERT_MANAGER_ENABLED | Whether to use automatic certificate. It is `true` by default
179179
CHANNEL | By default, `stable` channel will be installed. You can also specify `testing`
180180
REGISTRIES_FILE | The `registers.yaml` file path used by drycc registry
181+
KUBE_API_SERVER_ADDRESS | Set with the IP address of the loadbalancer that was in front of kube-apiserver, The default is the IP address of the current node
182+
KUBE_API_SERVER_PORT | Set with the PORT of the loadbalancer that was in front of kube-apiserver, which is `6443` by default
181183
METALLB_CONFIG_FILE | The metallb config file path, layer 2 network is used by default
182184
INSTALL_DRYCC_MIRROR | Specify the accelerated mirror location. Currently, only `cn` is supported
183185
CONTROLLER_APP_STORAGE_CLASS | StorageClass allocated by `drycc volumes`; default storageClass is used by default

0 commit comments

Comments
 (0)