-
Notifications
You must be signed in to change notification settings - Fork 1
/
secret.sh
executable file
·40 lines (32 loc) · 3.03 KB
/
secret.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
#!/usr/bin/env bash
if [ "$(hostname)" == "kubetest01.dm.esss.dk" ]; then
kubectl create ns dmsc
openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout catanie.key -out catanie.crt -subj "/CN=kubetest01.dm.esss.dk" -days 3650
openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout catamel.key -out catamel.crt -subj "/CN=kubetest02.dm.esss.dk" -days 3650
openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout landingserver.key -out landingserver.crt -subj "/CN=kubetest03.dm.esss.dk" -days 3650
openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout fileserver.key -out fileserver.crt -subj "/CN=kubetest04.dm.esss.dk" -days 3650
kubectl create secret -ndmsc tls catanieservice --key catanie.key --cert catanie.crt
kubectl create secret -ndev tls catamelservice --key catamel.key --cert catamel.crt
kubectl create secret -ndmsc tls landingserverservice --key landingserver.key --cert landingserver.crt
kubectl create secret -ndev tls fileserverservice --key fileserver.key --cert fileserver.crt
elif [ "$(hostname)" == "scicat01.esss.lu.se" ]; then
kubectl create ns ess
openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout catanie.key -out catanie.crt -subj "/CN=scicat01.esss.lu.se" -days 3650
openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout catamel.key -out catamel.crt -subj "/CN=scicat05.esss.lu.se" -days 3650
openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout landingserver.key -out landingserver.crt -subj "/CN=scicat06.esss.lu.se" -days 3650
openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout fileserver.key -out fileserver.crt -subj "/CN=scicat07.esss.lu.se" -days 3650
kubectl create secret -ness tls catanieservice --key catanie.key --cert catanie.crt
kubectl create secret -ness tls landingserverservice --key landingserver.key --cert landingserver.crt
kubectl create secret -ndev tls catamelservice --key catamel.key --cert catamel.crt
kubectl create secret -ndev tls fileserverservice --key fileserver.key --cert fileserver.crt
elif [ "$(hostname)" == "k8-lrg-serv-prod.esss.dk" ]; then
kubectl create ns dmscprod
openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout catanie.key -out catanie.crt -subj "/CN=catanieservice.esss.dk" -days 3650
openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout catamel.key -out catamel.crt -subj "/CN=catamelservice.esss.dk" -days 3650
openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout landingserver.key -out landingserver.crt -subj "/CN=scicatlandingpageserver.esss.dk" -days 3650
openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout fileserver.key -out fileserver.crt -subj "/CN=scicatfileserver.esss.dk" -days 3650
kubectl create secret -ndmscprod tls catanieservice --key catanie.key --cert catanie.crt
kubectl create secret -ndev tls catamelservice --key catamel.key --cert catamel.crt
kubectl create secret -ndmscprod tls landingserverservice --key landingserver.key -out landingserver.crt
kubectl create secret -ndev tls fileserverservice --key fileserver.key --cert fileserver.crt
fi