-
Notifications
You must be signed in to change notification settings - Fork 26
240 lines (230 loc) · 9.38 KB
/
ldap_microk8s.yml
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
name: microk8s
# This builds, packages and tests pygluu-kubernetes
on:
push:
paths:
- "pygluu/**"
- "tests/**"
- "setup.py"
branches:
- "4.5"
workflow_dispatch:
jobs:
build:
name: Test with Microk8s
runs-on: ubuntu-latest
strategy:
max-parallel: 6
matrix:
python-version: [3.9]
gluu-version: ['"4.5.4_dev"']
test-cases: ["install", "helm-install"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update
sudo python3 -m pip install --upgrade pip
sudo pip3 install setuptools --upgrade
sudo pip3 install pyOpenSSL --upgrade
sudo pip3 install requests --upgrade
- name: Lint with flake8
run: |
sudo pip3 install flake8
# stop the build if there are Python syntax errors or undefined names
sudo flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
sudo flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Build pygluu
run: |
sudo apt-get update
sudo apt-get install build-essential
sudo pip3 install -U shiv wheel setuptools
mkdir /home/runner/work/test
cp -r ./* /home/runner/work/test/
cd /home/runner/work/test/
sudo make zipapp
- name: Test 1 settings(LDAP)
id: test1_settings
run: |
default_iface=$(awk '$2 == 00000000 { print $1 }' /proc/net/route)
ip=$(ip addr show dev "$default_iface" | awk '$1 == "inet" { sub("/.*", "", $2); print $2 }')
cat <<EOF > /home/runner/work/test/settings.json
{
"ACCEPT_GLUU_LICENSE": "Y",
"TEST_ENVIRONMENT": "Y",
"GLUU_VERSION": ${{ matrix.gluu-version }},
"GLUU_UPGRADE_TARGET_VERSION": "",
"NGINX_INGRESS_NAMESPACE": "ingress-nginx",
"GLUU_HELM_RELEASE_NAME": "gluu",
"NGINX_INGRESS_RELEASE_NAME": "ningress",
"INSTALL_POSTGRES": "Y",
"POSTGRES_NAMESPACE": "postgres",
"POSTGRES_URL": "postgres.postgres.svc.cluster.local",
"USE_ISTIO": "N",
"USE_ISTIO_INGRESS": "N",
"MIGRATION_ENABLED": "N",
"ISTIO_SYSTEM_NAMESPACE": "istio-system",
"NODES_IPS": [
"$ip"
],
"NODES_ZONES": [],
"NODES_NAMES": [],
"NODE_SSH_KEY": "",
"HOST_EXT_IP": "$ip",
"VERIFY_EXT_IP": "",
"AWS_LB_TYPE": "",
"USE_ARN": "",
"ARN_AWS_IAM": "",
"LB_ADD": "",
"REDIS_URL": "",
"REDIS_TYPE": "",
"REDIS_PW": "",
"REDIS_USE_SSL": "false",
"DEPLOYMENT_ARCH": "microk8s",
"PERSISTENCE_BACKEND": "ldap",
"INSTALL_JACKRABBIT": "Y",
"JACKRABBIT_STORAGE_SIZE": "4Gi",
"JACKRABBIT_URL": "http://jackrabbit:8080",
"JACKRABBIT_ADMIN_ID": "admin",
"JACKRABBIT_ADMIN_PASSWORD": "admin",
"JACKRABBIT_CLUSTER": "N",
"JACKRABBIT_PG_USER": "jackrabbit",
"JACKRABBIT_PG_PASSWORD": "jackrabbit",
"JACKRABBIT_DATABASE": "jackrabbit",
"INSTALL_COUCHBASE": "Y",
"COUCHBASE_NAMESPACE": "cbns",
"COUCHBASE_VOLUME_TYPE": "io1",
"COUCHBASE_CLUSTER_NAME": "cbgluu",
"COUCHBASE_URL": "cbgluu.cbns.svc.cluster.local",
"COUCHBASE_INDEX_NUM_REPLICA": "0",
"COUCHBASE_USER": "gluu",
"COUCHBASE_SUPERUSER": "admin",
"COUCHBASE_BUCKET_PREFIX": "test",
"COUCHBASE_PASSWORD": "nTB5#|",
"COUCHBASE_SUPERUSER_PASSWORD": "nTB5#2",
"COUCHBASE_CRT": "",
"COUCHBASE_CN": "Couchbase CN",
"COUCHBASE_SUBJECT_ALT_NAME": "",
"COUCHBASE_CLUSTER_FILE_OVERRIDE": "N",
"COUCHBASE_USE_LOW_RESOURCES": "Y",
"COUCHBASE_DATA_NODES": "",
"COUCHBASE_QUERY_NODES": "",
"COUCHBASE_INDEX_NODES": "",
"COUCHBASE_SEARCH_EVENTING_ANALYTICS_NODES": "",
"COUCHBASE_GENERAL_STORAGE": "",
"COUCHBASE_DATA_STORAGE": "",
"COUCHBASE_INDEX_STORAGE": "",
"COUCHBASE_QUERY_STORAGE": "",
"COUCHBASE_ANALYTICS_STORAGE": "",
"COUCHBASE_BACKUP_SCHEDULE": "*/30 * * * *",
"COUCHBASE_BACKUP_RESTORE_POINTS": 1,
"LDAP_BACKUP_SCHEDULE": "*/30 * * * *",
"NUMBER_OF_EXPECTED_USERS": "",
"EXPECTED_TRANSACTIONS_PER_SEC": "",
"USING_CODE_FLOW": "",
"USING_SCIM_FLOW": "",
"USING_RESOURCE_OWNER_PASSWORD_CRED_GRANT_FLOW": "",
"DEPLOY_MULTI_CLUSTER": "N",
"HYBRID_LDAP_HELD_DATA": "",
"LDAP_JACKRABBIT_VOLUME": "",
"APP_VOLUME_TYPE": 1,
"LDAP_STATIC_VOLUME_ID": "",
"LDAP_STATIC_DISK_URI": "",
"GLUU_CACHE_TYPE": "NATIVE_PERSISTENCE",
"GLUU_NAMESPACE": "gluu",
"GLUU_FQDN": "demoexample.gluu.org",
"COUNTRY_CODE": "US",
"STATE": "TX",
"EMAIL": "[email protected]",
"CITY": "Austin",
"ORG_NAME": "Gluu",
"GMAIL_ACCOUNT": "",
"GOOGLE_NODE_HOME_DIR": "",
"IS_GLUU_FQDN_REGISTERED": "N",
"LDAP_PW": "nTB5#|",
"ADMIN_PW": "@4n,Js",
"OXD_SERVER_PW": "n8H0NKuGTXsn",
"OXD_APPLICATION_KEYSTORE_CN": "oxd-server",
"OXD_ADMIN_KEYSTORE_CN": "oxd-server",
"OXD_SERVER_STORAGE": "h2",
"LDAP_STORAGE_SIZE": "4Gi",
"OXAUTH_REPLICAS": 1,
"OXTRUST_REPLICAS": 1,
"LDAP_REPLICAS": 1,
"FIDO2_REPLICAS": 1,
"SCIM_REPLICAS": 1,
"OXSHIBBOLETH_REPLICAS": 1,
"OXPASSPORT_REPLICAS": 1,
"OXD_SERVER_REPLICAS": 1,
"CASA_REPLICAS": 1,
"ENABLE_OXTRUST_API": "N",
"ENABLE_OXTRUST_TEST_MODE": "N",
"ENABLE_CACHE_REFRESH": "N",
"ENABLE_OXD": "Y",
"ENABLE_OXPASSPORT": "Y",
"ENABLE_OXSHIBBOLETH": "Y",
"ENABLE_FIDO2": "Y",
"ENABLE_SCIM": "Y",
"ENABLE_CASA": "Y",
"OXAUTH_KEYS_LIFE": 48,
"ENABLE_OXAUTH_KEY_ROTATE": "Y",
"ENABLE_OXTRUST_API_BOOLEAN": "true",
"ENABLE_OXTRUST_TEST_MODE_BOOLEAN": "false",
"ENABLE_OXPASSPORT_BOOLEAN": "true",
"ENABLE_CASA_BOOLEAN": "true",
"ENABLE_SAML_BOOLEAN": "true",
"EDIT_IMAGE_NAMES_TAGS": "N",
"CONFIRM_PARAMS": "Y",
"GLUU_LDAP_MULTI_CLUSTER": "N",
"GLUU_INSTALL_SQL": "N",
"GLUU_SQL_DB_DIALECT": "mysql",
"GLUU_SQL_DB_NAMESPACE": "sql",
"GLUU_SQL_DB_HOST": "gluu-postgresql.sql.svc.cluster.local",
"GLUU_SQL_DB_PORT": "3306",
"GLUU_SQL_DB_NAME": "gluu",
"GLUU_SQL_DB_USER": "gluu",
"GLUU_SQL_DB_PASSWORD": "Test1234#",
"GLUU_SCIM_PROTECTION_MODE": "OAUTH",
"NGINX_LEGACY": "N",
"SPANNER_EMULATOR_HOST": "",
"CONTAINER_REGISTRY_SECRET_NAME": "regcred",
"USE_CUSTOM_SALT": "N",
"SALT": "",
"DOCUMENT_STORE_TYPE": "DB"
}
EOF
- name: Install microk8s
run: |
sudo snap install microk8s --classic --channel=1.21
sudo snap alias microk8s.kubectl kubectl
sudo microk8s.status --wait-ready
sudo microk8s.enable dns registry ingress
- name: Install Helm
run: |
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
sudo helm version
- name: Test Pygluu kubernetes
id: test_kubernetes
run: |
cd /home/runner/work/test/
INSTALL=TRUE
[[ -f sqlfile && "${{ matrix.test-cases }}" == "install" ]] && INSTALL=FALSE
[[ "$INSTALL" == "TRUE" ]] && sudo ./pygluu-kubernetes.pyz ${{ matrix.test-cases }}
sleep 30
sudo microk8s.kubectl get po -n cbns
sudo microk8s.kubectl get po -n gluu
cat /home/runner/work/test/settings.json
sudo kubectl -n gluu wait --for=condition=available --timeout=600s deploy/gluu-oxauth || sudo kubectl logs -l app=oxauth -c oxauth -n gluu || echo "Not Found"
sudo kubectl wait -n gluu --for=condition=ready pod --timeout=300s -l statefulset.kubernetes.io/pod-name=gluu-oxtrust-0 || sudo kubectl logs -l app=oxtrust -c oxtrust -n gluu || echo "Not Found"
sudo kubectl -n gluu wait --for=condition=available --timeout=300s deploy/gluu-oxpassport || sudo kubectl logs -l app=oxpassport -c oxpassport -n gluu || echo "Not Found"
sudo kubectl -n gluu wait --for=condition=available --timeout=300s deploy/gluu-casa || sudo kubectl logs -l app=casa -c casa -n gluu || echo "Not Found"
sudo kubectl -n gluu wait --for=condition=available --timeout=300s deploy/gluu-oxd-server || sudo kubectl logs -l app=oxd-server -c oxd-server -n gluu || echo "Not Found"
sudo kubectl wait -n gluu --for=condition=ready pod --timeout=300s -l statefulset.kubernetes.io/pod-name=gluu-oxshibboleth-0 || sudo kubectl logs -l app=oxshiboleth -c oxshiboleth -n gluu || echo "Not Found"