Skip to content

Commit

Permalink
Feature/bff to helm (#33)
Browse files Browse the repository at this point in the history
* Added health and api prefix

* Added BFF

* Moved security into backend. Fronted should not depend on KC

* Reordered the dependencies

* Fixed a dependency problem

* Made database work for Health-Check

* Changed defaults to make them less dangerous

* Moved Health-Module into modules

* Renamed BFF-Module to backend-for-frontend

* Health module reference broke
  • Loading branch information
kristoff-kiefer authored Oct 12, 2023
1 parent 4785f52 commit 309b2b9
Show file tree
Hide file tree
Showing 20 changed files with 3,848 additions and 9,548 deletions.
2,220 changes: 2,220 additions & 0 deletions charts/dbildungs-iam/charts/dbildungs-iam-keycloak-dev/dev-realm-spsh.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
image: quay.io/keycloak/keycloak:22.0.3
args:
- start-dev
- "--import-realm"
imagePullPolicy: IfNotPresent
ports:
- name: web
Expand All @@ -31,5 +32,13 @@ spec:
value: admin
- name: KC_PROXY
value: "edge"
volumeMounts:
- mountPath: "/opt/keycloak/data/import"
name: "realm-config"
readOnly: true
restartPolicy: Always
volumes:
- name: realm-config
secret:
secretName: realm-config-secret

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: realm-config-secret
type: opaque
data:
realm-spsh.json: |-
{{.Files.Get "dev-realm-spsh.json" | b64enc}}
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
keycloakHostname: "keycloak.dev.spsh.dbildungsplattform.de"
keycloakHostname: "keycloak.dev.spsh.dbildungsplattform.de"
keycloakPublic: false
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-deployment
name: dbiam-deployment-backend
labels:
app.kubernetes.io/name: dbildungs-iam
spec:
Expand All @@ -16,7 +16,7 @@ spec:
layer: dbildungs-iam-backend
spec:
containers:
- name: dbildungs-iam
- name: dbildungs-iam-backend
image: {{.Values.dbildungsIamContainer}}
imagePullPolicy: Always
ports:
Expand Down
56 changes: 56 additions & 0 deletions charts/dbildungs-iam/templates/dbildungs-iam-deployment-bff.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: dbiam-deployment-bff
labels:
app.kubernetes.io/name: dbildungs-iam
spec:
selector:
matchLabels:
layer: dbildungs-iam-bff
replicas: {{.Values.dbildungsIamReplications}}
template:
metadata:
name: dbildungs-iam
labels:
layer: dbildungs-iam-bff
spec:
containers:
- name: dbildungs-iam-bff
image: {{.Values.dbildungsIamContainer}}
imagePullPolicy: Always
command: ["node", "dist/src/backend-for-frontend/main.js"]
ports:
- name: web
containerPort: 8080
env:
- name: NODE_ENV
value: {{.Values.environment}}
- name: DEPLOY_STAGE
value: {{.Values.environment}}
volumeMounts:
- mountPath: /app/config/
name: config
readOnly: true
resources:
limits:
cpu: {{.Values.dbildungsIamCpuMax}}
memory: {{.Values.dbildungsIamMemMax}}
livenessProbe:
initialDelaySeconds: 10
httpGet:
port: 8080
scheme: 'HTTP'
path: '/health'
readinessProbe:
initialDelaySeconds: 10
httpGet:
port: 8080
scheme: 'HTTP'
path: '/health'
restartPolicy: Always
volumes:
- name: config
secret:
secretName: {{.Values.secrets.name | default (print .Release.Name "-secret")}}

4 changes: 2 additions & 2 deletions charts/dbildungs-iam/templates/dbildungs-iam-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ spec:
pathType: Prefix
backend:
service:
name: dbiam
name: dbiam-bff
port:
number: 80
- path: /docs
pathType: Prefix
backend:
service:
name: dbiam
name: dbiam-bff
port:
number: 80
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: Service
metadata:
name: dbiam
name: dbiam-backend
labels:
app.kubernetes.io/name: dbildungs-iam
spec:
Expand Down
16 changes: 16 additions & 0 deletions charts/dbildungs-iam/templates/dbildungs-iam-service-bff.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: dbiam-bff
labels:
app.kubernetes.io/name: dbildungs-iam
spec:
selector:
layer: dbildungs-iam-bff
ports:
- protocol: TCP
name: web
port: {{.Values.dbildungsIamExternalPort}}
targetPort: web
type: ClusterIP

6 changes: 4 additions & 2 deletions charts/dbildungs-iam/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@ secrets:
# If we're running inside an environment with a Prometheus-Operator installed we configure a service monitor
enableServiceMonitor: false

keycloakEnabled: true
keycloakPublic: true
# Both of these are disabled as to make them intentional
keycloakEnabled: false
dbildungs-iam-keycloak-dev:
keycloakPublic: false
4 changes: 2 additions & 2 deletions nest-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
"tsConfigPath": "tsconfig.build.json"
}
},
"frontend": {
"backend-for-frontend": {
"type": "application",
"root": "src",
"entryFile": "src/frontend/main",
"entryFile": "src/backend-for-frontend/main",
"sourceRoot": "src",
"compilerOptions": {
"tsConfigPath": "tsconfig.build.json"
Expand Down
Loading

0 comments on commit 309b2b9

Please sign in to comment.