-
Notifications
You must be signed in to change notification settings - Fork 0
/
k8s_start.sh
50 lines (43 loc) · 1.29 KB
/
k8s_start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
set -eux
set -o pipefail
WORKING_DIR=$(
cd "$(dirname "$0")"
pwd
)
WORKING_DIR="${WORKING_DIR}/.."
# check minikube
MINIKUBE_INSTALLED="y"
which minikube >/dev/null 2>&1 || { MINIKUBE_INSTALLED="n"; }
if [[ ${MINIKUBE_INSTALLED} == "n" ]]; then
echo "pls install minikube first"
exit 1
fi
minikube version
# using transparent proxy instead http/https proxy
# start minikube
PROFILE_NAME='playground'
SOFT_ROUTE_IP='192.168.1.41'
KVM_NETWORK='nat-network'
NODE_NUM=3
# bash ${WORKING_DIR}/scripts/k8s_set_route.sh ${PROFILE_NAME} ${NODE_NUM} ${SOFT_ROUTE_IP} &
# export HTTP_PROXY=http://${SOFT_ROUTE_IP}:1080
# export HTTPS_PROXY=https://${SOFT_ROUTE_IP}:1080
# export NO_PROXY=localhost,127.0.0.1,10.96.0.0/12,192.168.59.0/24,192.168.49.0/24,192.168.39.0/24
minikube config set WantUpdateNotification false
minikube \
--profile ${PROFILE_NAME} \
--driver=kvm2 \
--install-addons=false \
--kubernetes-version='v1.24.3' \
--auto-update-drivers=false \
--nodes=${NODE_NUM} \
--cpus=8 \
--memory=18g \
--disk-size=40g \
--kvm-network="${KVM_NETWORK}" \
--image-mirror-country='cn' \
--image-repository='registry.cn-hangzhou.aliyuncs.com/google_containers' \
start
minikube kubectl --profile ${PROFILE_NAME} -- get pods -A
minikube dashboard --profile ${PROFILE_NAME} --url &