-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OPSEXP-2592: alfresco-process-service - update ingress template to ma…
…tch other charts (#257)
- Loading branch information
Showing
6 changed files
with
188 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 32 additions & 16 deletions
48
charts/alfresco-process-services/templates/ingress-admin.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,46 @@ | ||
{{- if .Values.ingress.enabled }} | ||
{{- $serviceName := printf "%s-%s" (include "alfresco-process-services.fullname" .) "admin" -}} | ||
{{- if .Values.adminApp.ingress.enabled }} | ||
{{- $serviceName := include "alfresco-process-services.service-admin.name" . }} | ||
{{- $servicePort := .Values.adminApp.service.externalPort -}} | ||
{{/* | ||
We only support latest apiVersion which is stable now. | ||
*/}} | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: {{ template "alfresco-process-services.ingress-admin.name" . }} | ||
labels: | ||
{{- include "alfresco-process-services.admin.labels" . | nindent 4 }} | ||
{{- include "alfresco-process-services.aps.labels" . | nindent 4 }} | ||
{{- with .Values.adminApp.ingress.annotations }} | ||
annotations: | ||
ingress.kubernetes.io/ssl-redirect: "false" | ||
{{- with .Values.adminApp.ingress.maxUploadSize }} | ||
nginx.ingress.kubernetes.io/proxy-body-size: {{ . }} | ||
{{- end }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
ingressClassName: {{ .Values.adminApp.ingress.className }} | ||
{{- if .Values.adminApp.ingress.tls }} | ||
tls: | ||
{{- range .Values.adminApp.ingress.tls }} | ||
- hosts: | ||
{{- range .hosts }} | ||
- {{ . | quote }} | ||
{{- end }} | ||
secretName: {{ .secretName }} | ||
{{- end }} | ||
{{- end }} | ||
rules: | ||
{{- if .Values.adminApp.ingress.hostName }} | ||
- host: {{ tpl .Values.adminApp.ingress.hostName $ }} | ||
{{- range .Values.adminApp.ingress.hosts }} | ||
- host: {{ .host | quote }} | ||
http: | ||
{{- else }} | ||
- http: | ||
{{- end }} | ||
paths: | ||
- path: {{ tpl .Values.adminApp.ingress.path . }} | ||
{{- if eq "true" (include "common.ingress.supportsPathType" .) }} | ||
pathType: Prefix | ||
{{- range .paths }} | ||
- path: {{ .path }} | ||
{{- if .pathType }} | ||
pathType: {{ .pathType }} | ||
{{- end }} | ||
backend: {{- include "common.ingress.backend" (dict "serviceName" $serviceName "servicePort" $servicePort "context" $) | nindent 14 }} | ||
backend: | ||
service: | ||
name: {{ $serviceName }} | ||
port: | ||
number: {{ $servicePort }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
45 changes: 31 additions & 14 deletions
45
charts/alfresco-process-services/templates/ingress-aps.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,46 @@ | ||
{{- if .Values.ingress.enabled }} | ||
{{- $serviceName := printf "%s-%s" (include "alfresco-process-services.fullname" .) "aps" -}} | ||
{{- if .Values.processEngine.ingress.enabled }} | ||
{{- $serviceName := include "alfresco-process-services.service-aps.name" . }} | ||
{{- $servicePort := .Values.processEngine.service.externalPort -}} | ||
{{/* | ||
We only support latest apiVersion which is stable now. | ||
*/}} | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: {{ template "alfresco-process-services.ingress-aps.name" . }} | ||
labels: | ||
{{- include "alfresco-process-services.aps.labels" . | nindent 4 }} | ||
{{- with .Values.processEngine.ingress.annotations }} | ||
annotations: | ||
{{- with .Values.processEngine.ingress.maxUploadSize }} | ||
nginx.ingress.kubernetes.io/proxy-body-size: {{ . }} | ||
{{- end }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
ingressClassName: {{ .Values.processEngine.ingress.className }} | ||
{{- if .Values.processEngine.ingress.tls }} | ||
tls: | ||
{{- range .Values.processEngine.ingress.tls }} | ||
- hosts: | ||
{{- range .hosts }} | ||
- {{ . | quote }} | ||
{{- end }} | ||
secretName: {{ .secretName }} | ||
{{- end }} | ||
{{- end }} | ||
rules: | ||
{{- if .Values.processEngine.ingress.hostName }} | ||
- host: {{ tpl .Values.processEngine.ingress.hostName $ }} | ||
{{- range .Values.processEngine.ingress.hosts }} | ||
- host: {{ .host | quote }} | ||
http: | ||
{{- else }} | ||
- http: | ||
{{- end }} | ||
paths: | ||
- path: {{ tpl .Values.processEngine.ingress.path . }} | ||
{{- if eq "true" (include "common.ingress.supportsPathType" .) }} | ||
pathType: Prefix | ||
{{- range .paths }} | ||
- path: {{ .path }} | ||
{{- if .pathType }} | ||
pathType: {{ .pathType }} | ||
{{- end }} | ||
backend: {{- include "common.ingress.backend" (dict "serviceName" $serviceName "servicePort" $servicePort "context" $) | nindent 14 }} | ||
backend: | ||
service: | ||
name: {{ $serviceName }} | ||
port: | ||
number: {{ $servicePort }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
--- | ||
suite: test repository manifest | ||
templates: | ||
- ingress-aps.yaml | ||
- ingress-admin.yaml | ||
tests: | ||
- it: should render default ingress | ||
asserts: | ||
- equal: | ||
path: metadata.name | ||
value: RELEASE-NAME-ingress-aps | ||
template: ingress-aps.yaml | ||
- contains: | ||
path: spec.rules[0].http.paths | ||
content: | ||
backend: | ||
service: | ||
name: RELEASE-NAME-service-aps | ||
port: | ||
number: 80 | ||
path: /activiti-app | ||
pathType: Prefix | ||
template: ingress-aps.yaml | ||
- contains: | ||
path: spec.rules[0].http.paths | ||
content: | ||
backend: | ||
service: | ||
name: RELEASE-NAME-service-admin | ||
port: | ||
number: 80 | ||
path: /activiti-admin | ||
pathType: Prefix | ||
template: ingress-admin.yaml | ||
- it: should not render any ingress | ||
set: | ||
processEngine: | ||
ingress: | ||
enabled: false | ||
adminApp: | ||
ingress: | ||
enabled: false | ||
asserts: | ||
- hasDocuments: | ||
count: 0 | ||
template: ingress-aps.yaml | ||
- hasDocuments: | ||
count: 0 | ||
template: ingress-admin.yaml | ||
- it: should render TLS ingresses | ||
set: | ||
processEngine: | ||
ingress: | ||
tls: | ||
- secretName: my-tls-secret | ||
hosts: | ||
- app.activiti.com | ||
adminApp: | ||
ingress: | ||
tls: | ||
- secretName: my-tls-secret | ||
hosts: | ||
- app.activiti.com | ||
asserts: | ||
- contains: | ||
path: spec.tls | ||
content: | ||
secretName: my-tls-secret | ||
hosts: | ||
- app.activiti.com | ||
template: ingress-aps.yaml | ||
- contains: | ||
path: spec.tls | ||
content: | ||
secretName: my-tls-secret | ||
hosts: | ||
- app.activiti.com | ||
template: ingress-admin.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters