@@ -34,8 +34,20 @@ if [[ "${INSTALL_K3S_MIRROR}" == "cn" ]] ; then
3434mirrors:
3535 "docker.io":
3636 endpoint:
37- - "http ://hub -mirror.c.163.com "
37+ - "https ://docker -mirror.drycc.cc "
3838 - "https://registry-1.docker.io"
39+ "quay.io":
40+ endpoint:
41+ - "https://quay-mirror.drycc.cc"
42+ - "https://quay.io"
43+ "gcr.io":
44+ endpoint:
45+ - "https://gcr-mirror.drycc.cc"
46+ - "https://gcr.io"
47+ "k8s.gcr.io":
48+ endpoint:
49+ - "https://k8s-mirror.drycc.cc"
50+ - "https://k8s.gcr.io"
3951EOF
4052 k3s_install_url=" http://rancher-mirror.cnrancher.com/k3s/k3s-install.sh"
4153else
@@ -63,27 +75,22 @@ helm repo add svc-cat https://kubernetes-sigs.github.io/service-catalog
6375helm repo add drycc https://charts.drycc.cc/${CHANNEL:- stable}
6476helm repo update
6577
66- helm install cilium --set operator.replicas=1 cilium/cilium --namespace kube-system
67- helm install metallb bitnami/metallb --namespace kube-system -f - << EOF
78+ echo -e " \\ 033[32m---> Waiting for helm to install components...\\ 033[0m"
79+
80+ helm install cilium --set operator.replicas=1 cilium/cilium --namespace kube-system --wait
81+ helm install metallb bitnami/metallb --namespace kube-system --wait -f - << EOF
6882configInline:
6983 address-pools:
7084 - name: default
7185 protocol: layer2
7286 addresses:
7387 - ${METALLB_ADDRESS_POOLS:- 172.16.0.0/ 12}
7488EOF
75- helm install ingress-nginx ingress-nginx/ingress-nginx --namespace kube-system
76- helm install longhorn --create-namespace --set persistence.defaultClass=false --set persistence.defaultClassReplicaCount=1 longhorn/longhorn --namespace longhorn-system
77- helm install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --set installCRDs=true
89+ helm install ingress-nginx ingress-nginx/ingress-nginx --namespace kube-system --wait
90+ helm install longhorn --create-namespace --set persistence.defaultClass=false --set persistence.defaultClassReplicaCount=1 longhorn/longhorn --namespace longhorn-system --wait
91+ helm install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --set installCRDs=true --wait
7892helm install catalog svc-cat/catalog --set asyncBindingOperationsEnabled=true --namespace catalog --create-namespace --wait
7993
80- echo -e " \\ 033[32m---> Waiting cert-manager...\\ 033[0m"
81- while [ $( kubectl get pods -n cert-manager| grep Running| wc -l) -le 2 ]
82- do
83- kubectl get pods -n cert-manager
84- sleep 10
85- done
86-
8794echo -e " \\ 033[32m---> Start installing workflow...\\ 033[0m"
8895
8996RABBITMQ_USERNAME=$( cat /proc/sys/kernel/random/uuid)
@@ -147,6 +154,49 @@ spec:
147154 url: http://${HELMBROKER_USERNAME} :${HELMBROKER_PASSWORD} @drycc-helmbroker.${PLATFORM_DOMAIN}
148155EOF
149156
157+ BUILDER_IP=$( kubectl get svc drycc-builder -n drycc -o=" jsonpath={.status.loadBalancer.ingress[0].ip}" )
158+ INGRESS_IP=$( kubectl get svc ingress-nginx-controller -n kube-system -o=" jsonpath={.status.loadBalancer.ingress[0].ip}" )
159+
160+ if [[ " ${USE_HAPROXY:- true} " == " true" ]] ; then
161+ cat << EOF > "/etc/haproxy/haproxy.cfg"
162+ global
163+ log /dev/log local0
164+ log /dev/log local1 notice
165+ chroot /var/lib/haproxy
166+ stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
167+ stats timeout 30s
168+ user haproxy
169+ group haproxy
170+ daemon
171+ listen http-80
172+ bind *:80
173+ mode tcp
174+ maxconn 100000
175+ timeout connect 60s
176+ timeout client 30000
177+ timeout server 30000
178+ server ingress ${INGRESS_IP} :80 check
179+ listen http-443
180+ bind *:443
181+ mode tcp
182+ maxconn 100000
183+ timeout connect 60s
184+ timeout client 30000
185+ timeout server 30000
186+ server ingress ${INGRESS_IP} :443 check
187+ listen builder
188+ bind *:2222
189+ mode tcp
190+ maxconn 100000
191+ timeout connect 60s
192+ timeout client 30000
193+ timeout server 30000
194+ server builder ${BUILDER_IP} :2222 check
195+ EOF
196+ fi
197+ systemctl enable haproxy
198+ systemctl restart haproxy
199+
150200echo -e " \\ 033[32m---> Please save the following information for future use.\\ 033[0m"
151201echo -e " \\ 033[32m---> Rabbitmq username: $RABBITMQ_USERNAME \\ 033[0m"
152202echo -e " \\ 033[32m---> Rabbitmq password: $RABBITMQ_PASSWORD \\ 033[0m"
0 commit comments