This repository has been archived by the owner on Dec 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
init.sh
executable file
·70 lines (57 loc) · 1.81 KB
/
init.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env bash
set +x
echo "Checking argocd namespace existence"
kubectl get ns argocd > /dev/null 2>&1
if [ $? != 0 ]; then
echo "argocd namespace does not exist, creating..."
kubectl create ns argocd > /dev/null 2>&1
fi
echo "Checking cf-explorer namespace existence"
kubectl get ns cf-explorer > /dev/null 2>&1
if [ $? != 0 ]; then
echo "cf-explorer namespace does not exist, creating..."
kubectl create ns cf-explorer > /dev/null 2>&1
fi
## Create a Master Key
# openssl req -new -newkey rsa:4096 -x509 -sha256 -days 365 -nodes -out tls.crt -keyout tls.key
## DockerHub secret
kubectl create secret -n cf-explorer generic regcred \
--from-file=.dockerconfigjson=../.keys/docker-cred.json \
--type=kubernetes.io/dockerconfigjson \
--save-config \
--dry-run=client \
-o yaml \
| kubectl apply -f -
## Sealed Secrets certificates
#kubectl create secret generic sealed-secrets-key \
# --save-config \
# --dry-run=client \
# -o yaml \
# -n argocd \
# --from-file=../.keys/tls.crt \
# --from-file=../.keys/tls.key \
# | kubectl apply -f -
# Git Hub deploy key
kubectl create secret generic github-deploy-key \
--save-config \
--dry-run=client \
-o yaml \
-n argocd \
--from-file=../.keys/cf-explorer \
| kubectl apply -f -
# Infra Secrets (eg Psql, Redis, etc.)
kubectl create secret generic infra-other-secrets \
--save-config \
--dry-run=client \
-o yaml \
-n cf-explorer \
--from-env-file=../.keys/infra-secrets-dev-mainnet \
| kubectl apply -f -
#echo "Fetching helm dependencies for main app"
#helm dependency build
echo "Updating helm dependencies for main app"
helm dependency update
helm upgrade --install argocd -n argocd . \
--set git.targetRevision=feat/MET-1304-Update_Helm_Chart_Official_cluster \
--set valueFile=values-dev-mainnet.yaml \
-f values-secrets.yaml