-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathargocd-setup.sh
executable file
·56 lines (40 loc) · 1.26 KB
/
argocd-setup.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
51
52
53
54
55
56
set -o xtrace
set -o errexit
set -o nounset
set -o pipefail
source ./env.sh $1
setupArgoCD() {
local cluster=${1}
kubectl create namespace argocd --context=kind-${cluster}
helm upgrade --install argocd ./charts/argocd \
--wait \
--kube-context=kind-${cluster} \
--namespace=argocd
}
installArgoCDApps() {
local cluster=${1}
helm upgrade --install argocd-apps ./charts/argocd-apps \
--wait \
--kube-context=kind-${cluster} \
--values=./charts/argocd-apps/values-base.yaml \
--values=./charts/argocd-apps/values-"${cluster}".yaml \
--namespace=argocd
}
# setupRemoteSecret() {
# local cluster1context=${1}
# local cluster2context=${2}
# local apiServerIP=$(kubectl --context=${cluster1context} get pod -n kube-system -l component=kube-apiserver -o jsonpath='{.items[0].status.podIP}')
# local istioClusterName="${cluster1context/kind/istio}"
# istioctl create-remote-secret \
# --context=${cluster1context} \
# --server=https://${apiServerIP}:6443 \
# --name=${istioClusterName} | \
# kubectl apply -f - --context=${cluster2context}
# }
main() {
for cluster in ${CLUSTERS[@]}; do
setupArgoCD ${cluster}
installArgoCDApps ${cluster}
done
}
main