Skip to content

Commit a87dd79

Browse files
committed
feat(webapp): added helm chart for angular webapp deployment
anginx helm chart allow nginx webserver with angular content deployable into unprivileged containers
1 parent 0658a69 commit a87dd79

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+382
-414
lines changed

.deploy/api/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ ARG NAME=ngxapi
6868
ARG VENDOR=sumo
6969

7070
# Metadata
71-
LABEL org.label-schema.build-date=$BUILD_DATE \
71+
LABEL maintainer="Sumanth <xmlking@gmail.com>" \
72+
org.label-schema.build-date=$BUILD_DATE \
7273
org.label-schema.name=$NAME \
7374
org.label-schema.description="NGX Api" \
7475
org.label-schema.url="https://example.com" \

.deploy/api/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ Build and Deploy NgxApi
55
### Build
66

77
```bash
8-
# build, optinally use `--no-cache`
9-
VERSION=2.0.0-SNAPSHOT
8+
# build, optionally use `--no-cache`
9+
export VERSION=2.0.0-SNAPSHOT
10+
export DOCKER_BUILDKIT=1
1011
docker build \
1112
--build-arg VERSION=$VERSION \
1213
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \

.deploy/api/helm/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ kubectl apply --recursive -f generated/nodeapp/* --namespace default
8383

8484
ngxapi can be accessed:
8585

86-
* Within your cluster, at the following DNS name at port 80:
86+
* Within your cluster, at the following DNS name at port 3000:
8787

8888
```
8989
ngxapi-nodeapp.default.svc.cluster.local

.deploy/api/helm/values-dev.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ env:
4545
- name: TYPEORM_LOGGING
4646
value: 'false'
4747
- name: OIDC_ISSUER_URL
48-
value: 'https://keycloak-ngx1.1d35.starter-us-east-1.openshiftapps.com/auth/realms/ngx'
48+
value: 'https://keycloak.traefik.k8s/auth/realms/ngx'
49+
- name: OIDC_JWKS_URL
50+
value: 'http://keycloak-headless:8080/auth/realms/ngx/protocol/openid-connect/certs'
4951
- name: OIDC_CLIENT_ID
5052
value: ngxapi
5153
- name: EMAIL_HOST

.deploy/api/helm/values-prod.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ env:
5858
- name: TYPEORM_LOGGING
5959
value: 'false'
6060
- name: OIDC_ISSUER_URL
61-
value: 'https://keycloak-ngx1.1d35.starter-us-east-1.openshiftapps.com/auth/realms/ngx'
61+
value: 'https://keycloak.traefik.k8s/auth/realms/ngx'
62+
- name: OIDC_JWKS_URL
63+
value: 'http://keycloak-headless:8080/auth/realms/ngx/protocol/openid-connect/certs'
6264
- name: OIDC_CLIENT_ID
6365
value: ngxapi
6466
- name: EMAIL_HOST

.deploy/api/manual/01-ngxapi-configmap.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ data:
1212
TYPEORM_DATABASE: postgres
1313
TYPEORM_USERNAME: postgres
1414
TYPEORM_LOGGING: 'false'
15-
OIDC_ISSUER_URL: 'https://keycloak-ngx1.1d35.starter-us-east-1.openshiftapps.com/auth/realms/ngx'
15+
OIDC_ISSUER_URL: 'https://keycloak.traefik.k8s/auth/realms/ngx'
16+
OIDC_JWKS_URL: 'http://keycloak-headless:8080/auth/realms/ngx/protocol/openid-connect/certs'
1617
OIDC_CLIENT_ID: ngxapi
1718
EMAIL_HOST: mail.google.com
1819
EMAIL_PORT: '25'

.deploy/keycloak/LDAP.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ Post-Install KeyCloak Setup and LDAP Configuration
4848
Membership User LDAP Attribute: sAMAccountName
4949
LDAP Filter: (&(objectCategory=Group)(cn=IMP_GROUP_*))
5050
Member-Of LDAP Attribute: memberOf
51-
Client ID: ngxapp (optional)
51+
Client ID: ngxweb (optional)
5252
```
5353
54-
5. Add new `telephone number` for `ngxapp` client Mappers (optional)
54+
5. Add new `telephone number` for `ngxweb` client Mappers (optional)
5555
56-
> Clients > ngxapp > Mappers > telephone number
56+
> Clients > ngxweb > Mappers > telephone number
5757
5858
```
5959
Name: telephone number
@@ -63,9 +63,9 @@ Post-Install KeyCloak Setup and LDAP Configuration
6363
Claim JSON Type: String
6464
```
6565
66-
6. Add `NGX_ADMIN To Admin` for `ngxapp` client Mappers (optional)
66+
6. Add `NGX_ADMIN To Admin` for `ngxweb` client Mappers (optional)
6767
68-
> Clients > ngxapp > Mappers > my_group to admin
68+
> Clients > ngxweb > Mappers > my_group to admin
6969
7070
```
7171
Name: NGX_ADMIN to admin
@@ -74,10 +74,10 @@ Post-Install KeyCloak Setup and LDAP Configuration
7474
New Role Name: ROLE_ADMIN
7575
```
7676
77-
7. Add `groups` for `ngxapp` client Mappers (optional)
77+
7. Add `groups` for `ngxweb` client Mappers (optional)
7878
> k8s is configured to reed groups from ID_TOKEN/ACCESS_TOKEN, so create groups claim
7979
80-
> Clients > ngxapp > Mappers > groups
80+
> Clients > ngxweb > Mappers > groups
8181
8282
```
8383
Name: groups
@@ -102,9 +102,9 @@ Post-Install KeyCloak Setup and LDAP Configuration
102102
103103
9. Turn off `Full Scope Allowed` (this step is not needed - buggy)
104104
105-
> Under Clients > ngxapp > Scope
105+
> Under Clients > ngxweb > Scope
106106
107-
Turn off `Full Scope Allowed` for `ngxapp` client and select few Realm Roles
107+
Turn off `Full Scope Allowed` for `ngxweb` client and select few Realm Roles
108108
109109
110110
### FAQ

.deploy/keycloak/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ PROXY_ADDRESS_FORWARDING="true"
6565
> Open Keycloak WebConsole
6666
6767
1. Create a Keycloak realm called `ngx` via `Master > Add realm` menu, and switch to `ngx` realm
68-
2. Create a public client called `ngxapp` and `ngxapi` under realm `ngx`
68+
2. Create a public client called `ngxweb` and `ngxapi` under realm `ngx`
6969
3. Create a role `ROLE_USER` , `ROLE_ADMIN` under realm `ngx`
7070
4. Add a user `sumo`, `sumo1` , `sumo2` , `sumo3` under realm `ngx` and add the user to user role `ROLE_USER`
7171
5. Add a user `ngxadmin` under realm `ngx` and add the user to user role `ROLE_ADMIN`
@@ -75,7 +75,7 @@ PROXY_ADDRESS_FORWARDING="true"
7575
Refer https://stackoverflow.com/questions/53550321/keycloak-gatekeeper-aud-claim-and-client-id-do-not-match
7676

7777
1. add `ngxapi_audience` **Client Scopes** at Realm `ngx` with Audience mapper name: `ngxapi_audience_mapper` and adding `ngxapi` Client under `Included Client Audience`.
78-
2. for `ngxapp` client, add `ngxapi_audience` at **Client Scopes** tab
78+
2. for `ngxweb` client, add `ngxapi_audience` at **Client Scopes** tab
7979
3. for `ngxapi` client, add `ngxapi_audience` at **Client Scopes** tab (for Swagger API Docs)
8080

8181
---

.deploy/keycloak/TESTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ KeyCloak Testing
44
Pre-configured KeyCloak OpenID Connect server for testing.
55

66
* **Realm**: ngx
7-
* **Client ID**: ngxapp, ngxapi
7+
* **Client ID**: ngxweb, ngxapi
88
* **Accounts**:
99
* *ROLE_ADMIN*
1010
1. ngxadmin : ngxadmin

.deploy/keycloak/realm-import/realm-export.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@
289289
"ngxapi": [],
290290
"security-admin-console": [],
291291
"admin-cli": [],
292-
"ngxapp": [],
292+
"ngxweb": [],
293293
"broker": [
294294
{
295295
"id": "45bf247f-b7ea-4a17-b196-2f90ac8eccb6",
@@ -637,7 +637,7 @@
637637
},
638638
{
639639
"id": "805899f7-f443-45c8-b404-beb0f50a890a",
640-
"clientId": "ngxapp",
640+
"clientId": "ngxweb",
641641
"rootUrl": "http://localhost:4200",
642642
"adminUrl": "http://localhost:4200",
643643
"surrogateAuthRequired": false,
@@ -1816,4 +1816,4 @@
18161816
},
18171817
"keycloakVersion": "4.8.3.Final",
18181818
"userManagedAccessAllowed": false
1819-
}
1819+
}

0 commit comments

Comments
 (0)