Skip to content

Commit 363dbfd

Browse files
authored
fix(openbanking): update the script to use the latest values.yaml (#1916)
* fix(openbanking): update the script to use the latest values.yaml configuration * fix(openbanking): add a condition that the deployment is ready
1 parent 1468428 commit 363dbfd

File tree

3 files changed

+48
-88
lines changed

3 files changed

+48
-88
lines changed

automation/startopenabankingdemo.sh

+39-82
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,71 @@
11
#!/bin/bash
22
set -e
3-
if [[ ! "$JANS_FQDN" ]]; then
4-
read -rp "Enter Hostname [demoexample.jans.io]: " JANS_FQDN
3+
if [[ ! "$GLUU_FQDN" ]]; then
4+
read -rp "Enter Hostname [demoexample.gluu.org]: " GLUU_FQDN
55
fi
6-
if ! [[ $JANS_FQDN == *"."*"."* ]]; then
6+
if ! [[ $GLUU_FQDN == *"."*"."* ]]; then
77
echo "[E] Hostname provided is invalid or empty.
8-
Please enter a FQDN with the format demoexample.jans.io"
8+
Please enter a FQDN with the format demoexample.gluu.org"
99
exit 1
1010
fi
1111
sudo apt-get update
12-
sudo apt-get install python3-pip -y
13-
sudo pip3 install pip --upgrade
14-
sudo pip3 install setuptools --upgrade
15-
sudo pip3 install pyOpenSSL --upgrade
16-
sudo apt-get update
17-
sudo apt-get install build-essential unzip -y
18-
sudo pip3 install requests --upgrade
19-
sudo pip3 install shiv
2012
sudo snap install microk8s --classic
2113
sudo microk8s.status --wait-ready
22-
sudo microk8s.enable dns registry ingress
14+
sudo microk8s.enable dns registry ingress helm3
15+
sudo snap alias microk8s.kubectl kubectl
16+
sudo snap alias microk8s.helm3 helm
2317
sudo microk8s kubectl get daemonset.apps/nginx-ingress-microk8s-controller -n ingress -o yaml | sed -s "s@ingress-class=public@ingress-class=nginx@g" | microk8s kubectl apply -f -
2418
sudo apt-get update
25-
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common -y
26-
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
27-
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
28-
sudo apt-get update
29-
sudo apt-get install net-tools
30-
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
31-
chmod 700 get_helm.sh
32-
./get_helm.sh
33-
sudo apt-get install docker-ce docker-ce-cli containerd.io -y
3419
sudo microk8s config > config
3520
KUBECONFIG="$PWD"/config
36-
sudo microk8s.kubectl create namespace jans --kubeconfig="$KUBECONFIG" || echo "namespace exists"
21+
sudo microk8s.kubectl create namespace gluu --kubeconfig="$KUBECONFIG" || echo "namespace exists"
3722
sudo helm repo add bitnami https://charts.bitnami.com/bitnami
3823
sudo microk8s.kubectl get po --kubeconfig="$KUBECONFIG"
39-
sudo helm install my-release --set auth.rootPassword=Test1234#,auth.database=jans bitnami/mysql -n jans --kubeconfig="$KUBECONFIG"
40-
EXT_IP=$(dig +short myip.opendns.com @resolver1.opendns.com)
41-
sudo echo "$EXT_IP $JANS_FQDN" >> /etc/hosts
24+
sudo helm install my-release --set auth.rootPassword=Test1234#,auth.database=gluu -n gluu oci://registry-1.docker.io/bitnamicharts/mysql --kubeconfig="$KUBECONFIG"
25+
EXT_IP=$(curl ipinfo.io/ip)
26+
sudo echo "$EXT_IP $GLUU_FQDN" >> /etc/hosts
4227
cat << EOF > override.yaml
4328
config:
4429
countryCode: US
4530
4631
orgName: Gluu
4732
city: Austin
4833
configmap:
49-
cnSqlDbName: jans
34+
cnSqlDbName: gluu
5035
cnSqlDbPort: 3306
5136
cnSqlDbDialect: mysql
52-
cnSqlDbHost: my-release-mysql.jans.svc
37+
cnSqlDbHost: my-release-mysql.gluu.svc
5338
cnSqlDbUser: root
5439
cnSqlDbTimezone: UTC
5540
cnSqldbUserPassword: Test1234#
5641
nginx-ingress:
5742
ingress:
58-
adminUiEnabled: false
59-
openidConfigEnabled: true
60-
uma2ConfigEnabled: true
61-
webfingerEnabled: true
62-
webdiscoveryEnabled: true
63-
scimConfigEnabled: false
64-
scimEnabled: false
65-
configApiEnabled: true
66-
u2fConfigEnabled: true
67-
fido2ConfigEnabled: false
68-
authServerEnabled: true
6943
path: /
7044
hosts:
71-
- $JANS_FQDN
45+
- $GLUU_FQDN
7246
# -- Secrets holding HTTPS CA cert and key.
7347
tls:
7448
- secretName: tls-certificate
7549
hosts:
76-
- $JANS_FQDN
77-
authServerProtectedToken: true
78-
authServerProtectedRegister: true
50+
- $GLUU_FQDN
7951
additionalAnnotations:
8052
nginx.ingress.kubernetes.io/auth-tls-verify-client: "optional"
81-
nginx.ingress.kubernetes.io/auth-tls-secret: "gluu/ca-secret"
53+
nginx.ingress.kubernetes.io/auth-tls-secret: "gluu/tls-ob-ca-certificates"
8254
nginx.ingress.kubernetes.io/auth-tls-verify-depth: "1"
8355
nginx.ingress.kubernetes.io/auth-tls-pass-certificate-to-upstream: "true"
8456
global:
57+
cloud:
58+
testEnviroment: true
59+
admin-ui:
60+
enabled: false
61+
auth-server:
62+
ingress:
63+
authServerProtectedToken: true
64+
authServerProtectedRegister: true
8565
auth-server-key-rotation:
8666
enabled: false
67+
casa:
68+
enabled: false
8769
config-api:
8870
enabled: true
8971
fido2:
@@ -92,43 +74,18 @@ global:
9274
enabled: false
9375
isFqdnRegistered: false
9476
lbIp: $EXT_IP
77+
fqdn: $GLUU_FQDN
9578
EOF
96-
sudo helm repo add jans https://gluufederation.github.io/flex/flex-cn-setup/pygluu/kubernetes/templates/helm
79+
sudo helm repo add gluu-flex https://docs.gluu.org/charts
9780
sudo helm repo update
98-
sudo helm install jans jans/gluu -n jans --version=5.0.2 -f override.yaml --kubeconfig="$KUBECONFIG"
99-
echo "Waiting for auth-server to come up....Please do not cancel out...This will wait for the auth-server to be ready.."
100-
sleep 120
101-
cat << EOF > testendpoints.sh
102-
# get certs and keys. This will also generate the client crt and key to be used to access protected endpoints
103-
mkdir quicktestcerts || echo "directory exists"
104-
cd quicktestcerts
105-
sudo microk8s config > config
106-
KUBECONFIG="$PWD"/config
107-
rm ca.crt ca.key server.crt server.key client.csr client.crt client.key
108-
sudo microk8s.kubectl delete secret generic ca-secret -n gluu --kubeconfig="$KUBECONFIG" || echo "secret ca-secret does not exist and will be created."
109-
sudo microk8s.kubectl get secret cn -o json -n gluu --kubeconfig="$KUBECONFIG" | grep '"ssl_ca_cert":' | sed -e 's#.*:\(\)#\1#' | tr -d '"' | tr -d "," | tr -d '[:space:]' | base64 -d > ca.crt
110-
sudo microk8s.kubectl get secret cn -o json -n gluu --kubeconfig="$KUBECONFIG" | grep '"ssl_ca_key":' | sed -e 's#.*:\(\)#\1#' | tr -d '"' | tr -d "," | tr -d '[:space:]' | base64 -d > ca.key
111-
sudo microk8s.kubectl get secret cn -o json -n gluu --kubeconfig="$KUBECONFIG" | grep '"ssl_cert":' | sed -e 's#.*:\(\)#\1#' | tr -d '"' | tr -d "," | tr -d '[:space:]' | base64 -d > server.crt
112-
sudo microk8s.kubectl get secret cn -o json -n gluu --kubeconfig="$KUBECONFIG" | grep '"ssl_key":' | sed -e 's#.*:\(\)#\1#' | tr -d '"' | tr -d "," | tr -d '[:space:]' | base64 -d > server.key
113-
openssl req -new -newkey rsa:4096 -keyout client.key -out client.csr -nodes -subj '/CN=Openbanking'
114-
openssl x509 -req -sha256 -days 365 -in client.csr -CA ca.crt -CAkey ca.key -set_serial 02 -out client.crt
115-
sudo microk8s.kubectl create secret generic ca-secret -n gluu --from-file=tls.crt=server.crt --from-file=tls.key=server.key --from-file=ca.crt=ca.crt
116-
echo -e "Starting simple test to endpoints. \n"
117-
sleep 10
118-
echo -e "Testing openid-configuration endpoint.. \n"
119-
curl -k https://demoexample.gluu.org/.well-known/openid-configuration
120-
TESTCLIENT=$(microk8s.kubectl get cm cn -o json -n gluu --kubeconfig="$KUBECONFIG" | grep '"jca_client_id":' | sed -e 's#.*:\(\)#\1#' | tr -d '"' | tr -d "," | tr -d '[:space:]')
121-
TESTCLIENTSECRET=$(microk8s.kubectl get secret cn -o json -n gluu --kubeconfig="$KUBECONFIG" | grep '"jca_client_pw":' | sed -e 's#.*:\(\)#\1#' | tr -d '"' | tr -d "," | tr -d '[:space:]' | base64 -d)
122-
echo -e "Testing protected endpoint /token without client crt and key. This should show a 403, showing mTLS works \n"
123-
curl -X POST -k -u $TESTCLIENT:$TESTCLIENTSECRET https://demoexample.gluu.org/jans-auth/restv1/token -d grant_type=client_credentials
124-
echo -e "Testing protected endpoint /token with client crt and key. This should recieve a token, showing mTLS works \n"
125-
curl -X POST -k --cert client.crt --key client.key -u $TESTCLIENT:$TESTCLIENTSECRET https://demoexample.gluu.org/jans-auth/restv1/token -d grant_type=client_credentials
126-
echo -e "Testing protected endpoint /register without client crt and key. This should show a 403, showing mTLS works \n"
127-
curl -X POST -k -u $TESTCLIENT:$TESTCLIENTSECRET https://demoexample.gluu.org/jans-auth/restv1/register
128-
echo -e "Testing protected endpoint /register with client crt and key. This should still recieve an error but from the AS showing mTLS works \n"
129-
curl -X POST -k --cert client.crt --key client.key -u $TESTCLIENT:$TESTCLIENTSECRET https://demoexample.gluu.org/jans-auth/restv1/register
130-
cd ..
131-
EOF
132-
sudo microk8s.kubectl -n jans wait --for=condition=available --timeout=600s deploy/jans-auth-server --kubeconfig="$KUBECONFIG"
133-
sudo bash testendpoints.sh
134-
echo -e "You may re-execute bash testendpoints.sh to do a quick test to protected endpoints and openid-configuration endpoint."
81+
sudo helm install gluu gluu-flex/gluu -n gluu -f override.yaml --kubeconfig="$KUBECONFIG"
82+
echo "Waiting for the configuration job to complete. Please do not cancel out. This can take up to 3 minutes."
83+
sudo microk8s.kubectl -n gluu wait --for=condition=complete --timeout=180s deploy/gluu-config --kubeconfig="$KUBECONFIG"
84+
sudo microk8s.kubectl get secret cn -n gluu --kubeconfig="$KUBECONFIG" --template={{.data.ssl_ca_cert}} | base64 -d > ca.crt
85+
sudo microk8s.kubectl get secret cn -n gluu --kubeconfig="$KUBECONFIG" --template={{.data.ssl_cert}} | base64 -d > server.crt
86+
sudo microk8s.kubectl get secret cn -n gluu --kubeconfig="$KUBECONFIG" --template={{.data.ssl_key}} | base64 -d > server.key
87+
sudo microk8s.kubectl create secret generic tls-ob-ca-certificates -n gluu --kubeconfig="$KUBECONFIG" --from-file=tls.crt=server.crt --from-file=tls.key=server.key --from-file=ca.crt=ca.crt
88+
sudo microk8s.kubectl rollout restart deployment gluu-auth-server -n gluu --kubeconfig="$KUBECONFIG"
89+
sudo microk8s.kubectl rollout restart deployment gluu-config-api -n gluu --kubeconfig="$KUBECONFIG"
90+
echo "Waiting for gluu-flex to come up. Please do not cancel out. This can take up to 5 minutes."
91+
sudo microk8s.kubectl -n gluu wait --for=condition=available --timeout=300s deploy/gluu-auth-server --kubeconfig="$KUBECONFIG"

docs/install/helm-install/local.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ For local deployments like `minikube` and `MicroK8s` or cloud installations in d
1515
- 4 CPU cores
1616
- 50 GB hard-disk
1717

18-
Use the listing below for detailed estimation of minimum required resources. Table contains the default resources recommendations per service. Depending on the use of each service the resources needs may increase or decrease.
18+
Use the listing below for a detailed estimation of minimum required resources. The table contains the default resources recommendation per service. Depending on the use of each service the resources need may increase or decrease.
1919

2020
| Service | CPU Unit | RAM | Disk Space | Processor Type | Required |
2121
|-------------------|----------|-------|------------|----------------|------------------------------------|
@@ -24,7 +24,7 @@ Use the listing below for detailed estimation of minimum required resources. Tab
2424
| scim | 1 | 1GB | N/A | 64 Bit | No |
2525
| config - job | 0.3 | 0.3GB | N/A | 64 Bit | Yes on fresh installs |
2626
| persistence - job | 0.3 | 0.3GB | N/A | 64 Bit | Yes on fresh installs |
27-
| nginx | 1 | 1GB | N/A | 64 Bit | Yes ALB/Istio not used |
27+
| nginx | 1 | 1GB | N/A | 64 Bit | Yes if ALB/Istio not used |
2828
| auth-key-rotation | 0.3 | 0.3GB | N/A | 64 Bit | No [Strongly recommended] |
2929
| config-api | 1 | 1GB | N/A | 64 Bit | No |
3030
| casa | 0.5 | 0.5GB | N/A | 64 Bit | No |

docs/openbanking/install-cn.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ Use the listing below for a detailed estimation of the minimum required resource
2424
|OB Issuing CA | Used in nginx as a certificate authority |
2525
|OB Root CA | Used in nginx as a certificate authority |
2626
|OB Signing CA | Used in nginx as a certificate authority |
27-
|OB AS Transport key | Used for mTLS. This will also be added to the JVM |
28-
|OB AS Transport crt | Used for mTLS. This will also be added to the JVM |
27+
|OB AS Transport key | Used for mTLS. This will also be added to the JVM |
28+
|OB AS Transport crt | Used for mTLS. This will also be added to the JVM |
2929
|OB AS signing crt | Added to the JVM. Used in SSA Validation |
3030
|OB AS signing key | Added to the JVM. Used in SSA Validation |
3131
|OB transport truststore | Used in SSA Validation. Generated from OB Root CA nd Issuing CA |
@@ -159,18 +159,21 @@ Use the listing below for a detailed estimation of the minimum required resource
159159
```
160160

161161
### Install on microK8s(development/testing)
162+
163+
On your Ubuntu VM, run the following commands:
164+
162165
```bash
163166
sudo su -
164167
wget https://raw.githubusercontent.com/GluuFederation/flex/main/automation/startopenabankingdemo.sh && chmod u+x startopenabankingdemo.sh && ./startopenabankingdemo.sh
165168
```
166169

167-
Running this script will install the Gluu Open Banking Platform along with th mysql persistence.
170+
Running this script will install the Gluu Open Banking Platform with mTLS enabled along with the mysql backend as a persistence.
168171

169172
After running the script, you can go ahead and [test the setup](#testing-the-setup).
170173

171174
## Testing the setup
172175

173-
After successful installation, you can access and test the Gluu Open Banking Platform using either [curl](https://docs.gluu.org/vreplace-flex-version/openbanking/curl/) or [Jans-CLI](https://docs.gluu.org/vreplace-flex-version/openbanking/jans-cli/).
176+
After successful installation, you can access and test the Gluu Open Banking Platform using either [curl](https://docs.gluu.org/head/openbanking/curl/) or [Jans-CLI](https://docs.gluu.org/head/openbanking/jans-cli/).
174177

175178

176179
## Changing the signing key kid for the AS dynamically

0 commit comments

Comments
 (0)