Skip to content

Commit

Permalink
OPSEXP-2592: alfresco-process-service - update ingress template to ma…
Browse files Browse the repository at this point in the history
…tch other charts (#257)
  • Loading branch information
alxgomz authored Mar 27, 2024
1 parent bec3725 commit f1a4376
Show file tree
Hide file tree
Showing 6 changed files with 188 additions and 52 deletions.
2 changes: 1 addition & 1 deletion charts/alfresco-process-services/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
description: A Helm chart for Alfresco Process Services
name: alfresco-process-services
version: 1.0.0-alpha.0
version: 1.0.0-alpha.1
appVersion: 24.1.0
dependencies:
- name: alfresco-common
Expand Down
25 changes: 15 additions & 10 deletions charts/alfresco-process-services/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# alfresco-process-services

![Version: 1.0.0-alpha.0](https://img.shields.io/badge/Version-1.0.0--alpha.0-informational?style=flat-square) ![AppVersion: 24.1.0](https://img.shields.io/badge/AppVersion-24.1.0-informational?style=flat-square)
![Version: 1.0.0-alpha.1](https://img.shields.io/badge/Version-1.0.0--alpha.1-informational?style=flat-square) ![AppVersion: 24.1.0](https://img.shields.io/badge/AppVersion-24.1.0-informational?style=flat-square)

A Helm chart for Alfresco Process Services

Expand All @@ -26,9 +26,13 @@ A Helm chart for Alfresco Process Services
| adminApp.image.pullPolicy | string | `"IfNotPresent"` | |
| adminApp.image.repository | string | `"quay.io/alfresco/alfresco-process-services-admin"` | |
| adminApp.image.tag | string | `"24.1.0"` | |
| adminApp.ingress.className | string | `"nginx"` | |
| adminApp.ingress.maxUploadSize | string | `"5G"` | |
| adminApp.ingress.path | string | `"/activiti-admin"` | |
| adminApp.ingress.annotations."nginx.ingress.kubernetes.io/affinity" | string | `"cookie"` | |
| adminApp.ingress.annotations."nginx.ingress.kubernetes.io/proxy-body-size" | string | `"5g"` | |
| adminApp.ingress.className | string | `"nginx"` | supported ingress class |
| adminApp.ingress.enabled | bool | `true` | Toggle ingress for APS admin |
| adminApp.ingress.hosts[0].paths[0].path | string | `"/activiti-admin"` | |
| adminApp.ingress.hosts[0].paths[0].pathType | string | `"Prefix"` | |
| adminApp.ingress.tls | list | `[]` | |
| adminApp.livenessProbe.failureThreshold | int | `5` | |
| adminApp.livenessProbe.initialDelaySeconds | int | `25` | |
| adminApp.livenessProbe.path | string | `"/activiti-admin/"` | |
Expand Down Expand Up @@ -59,9 +63,6 @@ A Helm chart for Alfresco Process Services
| database.url | object | `{"admin":null,"aps":null}` | JDBC url to connect to the external DB |
| database.username | string | `nil` | JDBC username to use to connect to the DB |
| global.alfrescoRegistryPullSecrets | string | `"quay-registry-secret"` | |
| ingress.enabled | bool | `true` | |
| ingress.hostName | string | `""` | |
| ingress.protocol | string | `"http"` | |
| license.secretName | string | `nil` | |
| processEngine.affinity | object | `{}` | |
| processEngine.environment.ACTIVITI_CORS_ALLOWED_HEADERS | string | `"Authorization,Content-Type,Cache-Control,X-Requested-With,accept,Origin,Access-Control-Request-Method,Access-Control-Request-Headers,X-CSRF-Token"` | Cross Origin Resource Sharing configuration allowed http headers |
Expand All @@ -88,9 +89,13 @@ A Helm chart for Alfresco Process Services
| processEngine.image.pullPolicy | string | `"IfNotPresent"` | |
| processEngine.image.repository | string | `"quay.io/alfresco/alfresco-process-services"` | |
| processEngine.image.tag | string | `"24.1.0"` | |
| processEngine.ingress.className | string | `"nginx"` | |
| processEngine.ingress.maxUploadSize | string | `"5G"` | |
| processEngine.ingress.path | string | `"/activiti-app"` | |
| processEngine.ingress.annotations."nginx.ingress.kubernetes.io/affinity" | string | `"cookie"` | |
| processEngine.ingress.annotations."nginx.ingress.kubernetes.io/proxy-body-size" | string | `"5g"` | |
| processEngine.ingress.className | string | `"nginx"` | supported ingress class |
| processEngine.ingress.enabled | bool | `true` | Toggle ingress for APS application |
| processEngine.ingress.hosts[0].paths[0].path | string | `"/activiti-app"` | |
| processEngine.ingress.hosts[0].paths[0].pathType | string | `"Prefix"` | |
| processEngine.ingress.tls | list | `[]` | |
| processEngine.livenessProbe.failureThreshold | int | `5` | |
| processEngine.livenessProbe.initialDelaySeconds | int | `25` | |
| processEngine.livenessProbe.path | string | `"/activiti-app/app/rest/locale"` | |
Expand Down
48 changes: 32 additions & 16 deletions charts/alfresco-process-services/templates/ingress-admin.yaml
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 charts/alfresco-process-services/templates/ingress-aps.yaml
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 }}
78 changes: 78 additions & 0 deletions charts/alfresco-process-services/tests/ingress_test.yaml
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
42 changes: 31 additions & 11 deletions charts/alfresco-process-services/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
global:
alfrescoRegistryPullSecrets: quay-registry-secret

ingress:
enabled: true
protocol: http
hostName: ''

processEngine:
replicaCount: 1
podLabels: {}
Expand All @@ -28,9 +23,22 @@ processEngine:
type: ClusterIP
externalPort: 80
ingress:
className: "nginx"
path: /activiti-app
maxUploadSize: "5G"
# -- Toggle ingress for APS application
enabled: true
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 5g
nginx.ingress.kubernetes.io/affinity: "cookie"
# -- supported ingress class
className: nginx
hosts:
- paths:
- path: /activiti-app
pathType: Prefix
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

persistence:
# -- Persist processEngine data
enabled: false
Expand Down Expand Up @@ -146,9 +154,21 @@ adminApp:
timeoutSeconds: 5
readinessProbe: *adminProbe
ingress:
className: "nginx"
path: /activiti-admin
maxUploadSize: "5G"
# -- Toggle ingress for APS admin
enabled: true
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 5g
nginx.ingress.kubernetes.io/affinity: "cookie"
# -- supported ingress class
className: nginx
hosts:
- paths:
- path: /activiti-admin
pathType: Prefix
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
environment:
# -- Set the JDBC driver Class
ACTIVITI_ADMIN_DATASOURCE_DRIVER: "org.postgresql.Driver"
Expand Down

0 comments on commit f1a4376

Please sign in to comment.