Skip to content

Commit

Permalink
#1135 - Revise helm charts and update k8s deployment (#1256)
Browse files Browse the repository at this point in the history
  • Loading branch information
nashtech-diepnguyenngoc1 authored Nov 4, 2024
1 parent 1e78a14 commit af2c942
Show file tree
Hide file tree
Showing 16 changed files with 203 additions and 352 deletions.
17 changes: 14 additions & 3 deletions k8s/charts/backoffice-bff/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ backend:
fullnameOverride: backoffice-bff
deployment:
annotations:
configmap.reloader.stakater.com/reload: "yas-gateway-routes-config-configmap"
configmap.reloader.stakater.com/reload: "yas-gateway-routes-config-configmap,backoffice-bff-extra-configmap"
ingress:
enabled: true
host: backoffice.yas.local.com
Expand All @@ -17,12 +17,23 @@ backend:
value: prod
- name: UI_HOST
value: http://backoffice-ui:3000
extraEnvFroms:
- secretRef:
name: yas-keycloak-credentials-secret
- secretRef:
name: yas-redis-credentials-secret
extraVolumes:
- name: yas-gateway-routes-config
configMap:
name: yas-gateway-routes-config-configmap
- name: backoffice-bff-extra-config
configMap:
name: backoffice-bff-extra-configmap
extraVolumeMounts:
- name: yas-gateway-routes-config
mountPath: /opt/yas/backoffice-bff
mountPath: /opt/yas/gateway-routes-config
- name: backoffice-bff-extra-config
mountPath: /opt/yas/extra-config
extraApplicationConfigPaths:
- /opt/yas/backoffice-bff/gateway-routes-config.yaml
- /opt/yas/gateway-routes-config/gateway-routes-config.yaml
- /opt/yas/extra-config/backoffice-bff-extra-config.yaml
17 changes: 14 additions & 3 deletions k8s/charts/storefront-bff/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ backend:

deployment:
annotations:
configmap.reloader.stakater.com/reload: "yas-gateway-routes-config-configmap"
configmap.reloader.stakater.com/reload: "yas-gateway-routes-config-configmap,storefront-bff-extra-configmap"

ingress:
enabled: true
Expand All @@ -20,12 +20,23 @@ backend:
value: prod
- name: UI_HOST
value: http://storefront-ui:3000
extraEnvFroms:
- secretRef:
name: yas-keycloak-credentials-secret
- secretRef:
name: yas-redis-credentials-secret
extraVolumes:
- name: yas-gateway-routes-config
configMap:
name: yas-gateway-routes-config-configmap
- name: storefront-bff-extra-config
configMap:
name: storefront-bff-extra-configmap
extraVolumeMounts:
- name: yas-gateway-routes-config
mountPath: /opt/yas/storefront-bff
mountPath: /opt/yas/gateway-routes-config
- name: storefront-bff-extra-config
mountPath: /opt/yas/extra-config
extraApplicationConfigPaths:
- /opt/yas/storefront-bff/gateway-routes-config.yaml
- /opt/yas/gateway-routes-config/gateway-routes-config.yaml
- /opt/yas/extra-config/storefront-bff-extra-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,28 @@ data:
gateway-routes-config.yaml: |
{{- toYaml .Values.gatewayRoutesConfig | nindent 4 }}
---
#Configmap for backoffice-bff extra
apiVersion: v1
kind: ConfigMap
metadata:
name: backoffice-bff-extra-configmap
annotations:
reloader.stakater.com/match: "true"
data:
backoffice-bff-extra-config.yaml: |
{{- toYaml .Values.backofficeBffExtraConfig | nindent 4 }}
---
#Configmap for storefront-bff extra
apiVersion: v1
kind: ConfigMap
metadata:
name: storefront-bff-extra-configmap
annotations:
reloader.stakater.com/match: "true"
data:
storefront-bff-extra-config.yaml: |
{{- toYaml .Values.storefrontBffExtraConfig | nindent 4 }}
---
# Configmap for media application config custom
apiVersion: v1
kind: ConfigMap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,17 @@ metadata:
reloader.stakater.com/match: "true"
type: Opaque
data:
KEYCLOAK_CUSTOMER_MANAGEMENT_CLIENT_SECRET: {{ .Values.credentials.keycloak.customerManagementClientSecret | b64enc }}
KEYCLOAK_BACKOFFICE_BFF_CLIENT_SECRET: {{ .Values.credentials.keycloak.backofficeBffClientSecret | b64enc }}
KEYCLOAK_STOREFRONT_BFF_CLIENT_SECRET: {{ .Values.credentials.keycloak.storefrontBffClientSecret | b64enc }}
KEYCLOAK_CUSTOMER_MANAGEMENT_CLIENT_SECRET: {{ .Values.credentials.keycloak.customerManagementClientSecret | b64enc }}

---
apiVersion: v1
kind: Secret
metadata:
name: yas-redis-credentials-secret
annotations:
reloader.stakater.com/match: "true"
type: Opaque
data:
REDIS_PASSWORD: {{ .Values.credentials.redis.password | b64enc }}
50 changes: 44 additions & 6 deletions k8s/charts/yas-configuration/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ credentials:
username: yas
password: LarUmB3A49NTg9YmgW4=
keycloak:
backofficeBffClientSecret: TVacLC0cQ8tiiEKiTVerTb2YvwQ1TRJF
storefrontBffClientSecret: ZrU9I0q2uXBglBnmvyJdkl1lf0ncr8tn
customerManagementClientSecret: NKAr3rnjwm9jlakgKpelukZGFaHYqIWE
redis:
password: redis

#Genneral application.yaml for all microservice
applicationConfig:
Expand Down Expand Up @@ -89,12 +93,6 @@ applicationConfig:
# Gateway config for bff microservices
gatewayRoutesConfig:
spring:
security:
oauth2:
client:
provider:
keycloak:
issuer-uri: http://identity.yas.local.com/realms/Yas
cloud:
gateway:
routes:
Expand Down Expand Up @@ -180,6 +178,46 @@ gatewayRoutesConfig:
predicates:
- Path=/**

backofficeBffExtraConfig:
spring:
data:
redis:
host: redis-master.redis
password: ${REDIS_PASSWORD}
port: 6379
security:
oauth2:
client:
provider:
keycloak:
issuer-uri: http://identity.yas.local.com/realms/Yas
registration:
api-client:
provider: keycloak
client-id: backoffice-bff
client-secret: ${KEYCLOAK_BACKOFFICE_BFF_CLIENT_SECRET}
scope: openid, profile, email, roles

storefrontBffExtraConfig:
spring:
data:
redis:
host: redis-master.redis
password: ${REDIS_PASSWORD}
port: 6379
security:
oauth2:
client:
provider:
keycloak:
issuer-uri: http://identity.yas.local.com/realms/Yas
registration:
api-client:
provider: keycloak
client-id: storefront-bff
client-secret: ${KEYCLOAK_STOREFRONT_BFF_CLIENT_SECRET}
scope: openid, profile, email, roles

# Media application config custom
mediaApplicationConfig:
server:
Expand Down
Loading

0 comments on commit af2c942

Please sign in to comment.