Skip to content
This repository was archived by the owner on Mar 17, 2020. It is now read-only.

Commit 7044c51

Browse files
igdianovmergify[bot]
authored andcommitted
fix: change Notfications service ingress base path to /notifications (#100)
* feat: expose /notifications ingress path for Notifications service * chore: move ingress annotations into values.yaml * feat: expose /notifications/actuator ingress path
1 parent 5da8784 commit 7044c51

File tree

3 files changed

+35
-21
lines changed

3 files changed

+35
-21
lines changed

charts/activiti-cloud-notifications-graphql/templates/deployment.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,16 @@ spec:
7171
value: "false"
7272
- name: ACT_CLOUD_CONFIG_SERVER_ENABLED
7373
value: "false"
74+
- name: SERVER_SERVLET_CONTEXTPATH
75+
value: {{ tpl .Values.ingress.path . | quote }}
7476
{{- with .Values.extraEnv }}
7577
{{ tpl . $ | indent 8 }}
7678
{{- end }}
7779
ports:
7880
- containerPort: {{ .Values.service.internalPort }}
7981
livenessProbe:
8082
httpGet:
81-
path: {{ .Values.probePath }}
83+
path: {{ tpl .Values.probePath . | quote }}
8284
port: {{ .Values.service.internalPort }}
8385
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
8486
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
@@ -87,7 +89,7 @@ spec:
8789
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
8890
readinessProbe:
8991
httpGet:
90-
path: {{ .Values.probePath }}
92+
path: {{ tpl .Values.probePath . | quote }}
9193
port: {{ .Values.service.internalPort }}
9294
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
9395
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}

charts/activiti-cloud-notifications-graphql/templates/ingress.yaml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,7 @@ metadata:
99
release: {{ .Release.Name }}
1010
heritage: {{ .Release.Service }}
1111
annotations:
12-
kubernetes.io/ingress.class: "nginx"
1312
{{- include "kubernetes.io/tls-acme" . | indent 4}}
14-
nginx.ingress.kubernetes.io/enable-cors: "true"
15-
nginx.ingress.kubernetes.io/cors-allow-headers: "*"
16-
nginx.ingress.kubernetes.io/cors-allow-origin: "*"
17-
nginx.ingress.kubernetes.io/cors-allow-methods: "GET,PUT,POST,DELETE,PATCH,OPTIONS"
18-
nginx.ingress.kubernetes.io/cors-allow-credentials: "true"
19-
nginx.ingress.kubernetes.io/x-forwarded-prefix: "true"
20-
nginx.ingress.kubernetes.io/affinity: cookie
21-
nginx.ingress.kubernetes.io/session-cookie-name: "activiti-cloud-notifications-graphql-route"
22-
nginx.ingress.kubernetes.io/session-cookie-hash: "md5"
23-
nginx.ingress.kubernetes.io/session-cookie-path: "/"
2413
{{- range $key, $value := .Values.global.gateway.annotations }}
2514
{{ $key }}: {{ tpl $value $ | quote }}
2615
{{- end }}
@@ -29,23 +18,29 @@ metadata:
2918
{{- end }}
3019
spec:
3120
rules:
32-
- host: {{ include "ingresshost" $ }}
21+
- host: {{ include "ingresshost" $ | quote }}
3322
http:
3423
paths:
24+
{{- if .Values.ingress.actuator.enabled }}
25+
- path: {{ tpl .Values.ingress.path . }}{{ .Values.ingress.actuator.path }}
26+
backend:
27+
serviceName: {{ template "servicename" . }}
28+
servicePort: {{ .Values.service.externalPort }}
29+
{{- end }}
3530
{{- if .Values.ingress.web.enabled }}
36-
- path: {{ .Values.ingress.web.path }}
31+
- path: {{ tpl .Values.ingress.path . }}{{ .Values.ingress.web.path }}
3732
backend:
3833
serviceName: {{ template "servicename" . }}
3934
servicePort: {{ .Values.service.externalPort }}
4035
{{- end }}
4136
{{- if .Values.ingress.ws.enabled }}
42-
- path: {{ .Values.ingress.ws.path }}
37+
- path: {{ tpl .Values.ingress.path . }}{{ .Values.ingress.ws.path }}
4338
backend:
4439
serviceName: {{ template "servicename" . }}
4540
servicePort: {{ .Values.service.externalPort }}
4641
{{- end }}
4742
{{- if .Values.ingress.graphiql.enabled }}
48-
- path: {{ .Values.ingress.graphiql.path }}
43+
- path: {{ tpl .Values.ingress.path . }}{{ .Values.ingress.graphiql.path }}
4944
backend:
5045
serviceName: {{ template "servicename" . }}
5146
servicePort: {{ .Values.service.externalPort }}

charts/activiti-cloud-notifications-graphql/values.yaml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,27 +71,31 @@ resources:
7171
requests:
7272
cpu: "200m"
7373
memory: 512Mi
74-
probePath: /actuator/health
74+
probePath: '{{ .Values.ingress.path }}/actuator/health'
7575
livenessProbe:
7676
initialDelaySeconds: 140
7777
periodSeconds: 15
7878
timeoutSeconds: 20
7979
successThreshold: 1
80-
failureThreshold: 40
80+
failureThreshold: 3
8181
readinessProbe:
8282
initialDelaySeconds: 20
8383
periodSeconds: 15
8484
timeoutSeconds: 5
8585
successThreshold: 1
86-
failureThreshold: 80
86+
failureThreshold: 3
8787
terminationGracePeriodSeconds: 20
8888

8989
ingress:
9090
## Set to true to enable ingress record generation
9191
enabled: true
92+
path: /notifications
9293
tls: # overrides .Values.global.gateway.tls
9394
tlsSecret: # overrides .Values.global.gateway.tlsSecret
9495
hostName: # overrides .Values.global.gateway.host
96+
actuator:
97+
enabled: true
98+
path: /actuator
9599
graphiql:
96100
enabled: true
97101
path: /graphiql
@@ -101,6 +105,19 @@ ingress:
101105
ws:
102106
enabled: true
103107
path: /ws/graphql
104-
annotations: {}
108+
annotations:
109+
kubernetes.io/ingress.class: "nginx"
110+
nginx.ingress.kubernetes.io/enable-cors: "true"
111+
nginx.ingress.kubernetes.io/cors-allow-headers: "*"
112+
nginx.ingress.kubernetes.io/configuration-snippet: |
113+
more_set_headers 'Access-Control-Allow-Origin: $http_origin';
114+
nginx.ingress.kubernetes.io/cors-allow-methods: "GET,PUT,POST,DELETE,PATCH,OPTIONS"
115+
nginx.ingress.kubernetes.io/cors-allow-credentials: "true"
116+
nginx.ingress.kubernetes.io/x-forwarded-prefix: "true"
117+
nginx.ingress.kubernetes.io/affinity: cookie
118+
nginx.ingress.kubernetes.io/session-cookie-name: "activiti-cloud-notifications-graphql-route"
119+
nginx.ingress.kubernetes.io/session-cookie-hash: "md5"
120+
nginx.ingress.kubernetes.io/session-cookie-path: "{{ .Values.ingress.path }}"
121+
105122

106123

0 commit comments

Comments
 (0)