Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPSEXP-2991 Change sync service ingress pathType to ImplementationSpecific #430

Merged
merged 2 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/alfresco-sync-service/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ keywords:
name: alfresco-sync-service
sources:
- https://github.com/Alfresco/acs-deployment
version: 7.0.0-alpha.0
version: 7.0.0-alpha.1
appVersion: 5.1.0
icon: https://avatars0.githubusercontent.com/u/391127?s=200&v=4
dependencies:
Expand Down
10 changes: 7 additions & 3 deletions charts/alfresco-sync-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ parent: Charts Reference

# alfresco-sync-service

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

Alfresco Sync Service

Expand Down Expand Up @@ -47,9 +47,13 @@ Checkout [alfresco-content-services chart's doc](https://github.com/Alfresco/acs
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"quay.io/alfresco/service-sync"` | |
| image.tag | string | `"5.1.0"` | |
| ingress.extraAnnotations | object | `{}` | useful when running Sync service without SSL termination done by a load balancer, e.g. when ran on Minikube for testing purposes nginx.ingress.kubernetes.io/ssl-redirect: "false" |
| ingress.annotations."nginx.ingress.kubernetes.io/affinity" | string | `"cookie"` | |
| ingress.annotations."nginx.ingress.kubernetes.io/rewrite-target" | string | `"/alfresco/$2"` | |
| ingress.annotations."nginx.ingress.kubernetes.io/session-cookie-hash" | string | `"sha1"` | |
| ingress.annotations."nginx.ingress.kubernetes.io/session-cookie-name" | string | `"sync_affinity_route"` | |
| ingress.annotations."nginx.ingress.kubernetes.io/use-regex" | string | `"true"` | |
| ingress.hosts[0].paths[0].path | string | `"/syncservice(/|$)(.*)"` | |
| ingress.hosts[0].paths[0].pathType | string | `"Prefix"` | |
| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | |
gionn marked this conversation as resolved.
Show resolved Hide resolved
| ingress.tls | list | `[]` | |
| livenessProbe.httpGet.path | string | `"/alfresco/healthcheck"` | |
| livenessProbe.httpGet.port | string | `"serviceport"` | |
Expand Down
11 changes: 3 additions & 8 deletions charts/alfresco-sync-service/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,10 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "alfresco-sync-service.fullname" . }}
{{- with .Values.ingress.annotations }}
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /alfresco/$2
nginx.ingress.kubernetes.io/affinity: "cookie"
nginx.ingress.kubernetes.io/session-cookie-name: "sync_affinity_route"
nginx.ingress.kubernetes.io/session-cookie-hash: "sha1"
{{- if .Values.ingress.extraAnnotations }}
{{ toYaml .Values.ingress.extraAnnotations | indent 4 }}
{{- end }}

{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ingressClassName: nginx
{{- if .Values.ingress.tls }}
Expand Down
100 changes: 64 additions & 36 deletions charts/alfresco-sync-service/tests/ingress_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,68 @@ suite: test sync ingress
templates:
- ingress.yaml
tests:
- it: should render default rules
asserts:
- equal:
path: spec.rules
value:
- host:
http:
paths:
- backend:
service:
name: RELEASE-NAME-alfresco-sync-service
port:
number: 80
path: /syncservice(/|$)(.*)
pathType: Prefix
- it: should render rules with host
set:
ingress:
hosts:
- host: testhost
paths:
- path: /syncservice(/|$)(.*)
pathType: Prefix
asserts:
- equal:
path: spec.rules
value:
- it: should render default rules
asserts:
- equal:
path: spec.rules
value:
- host:
http:
paths:
- backend:
service:
name: RELEASE-NAME-alfresco-sync-service
port:
number: 80
path: /syncservice(/|$)(.*)
pathType: ImplementationSpecific

- it: should render rules with host
set:
ingress:
hosts:
- host: testhost
http:
paths:
- backend:
service:
name: RELEASE-NAME-alfresco-sync-service
port:
number: 80
path: /syncservice(/|$)(.*)
pathType: Prefix
paths:
- path: /syncservice(/|$)(.*)
pathType: ImplementationSpecific
asserts:
- equal:
path: spec.rules
value:
- host: testhost
http:
paths:
- backend:
service:
name: RELEASE-NAME-alfresco-sync-service
port:
number: 80
path: /syncservice(/|$)(.*)
pathType: ImplementationSpecific

- it: should render ingress with default annotations
asserts:
- equal:
path: metadata.annotations
value:
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /alfresco/$2
nginx.ingress.kubernetes.io/affinity: "cookie"
nginx.ingress.kubernetes.io/session-cookie-name: "sync_affinity_route"
nginx.ingress.kubernetes.io/session-cookie-hash: "sha1"

- it: should render ingress with custom annotations
set:
ingress:
annotations:
custom-annotation: "custom-value"
asserts:
- equal:
path: metadata.annotations
value:
custom-annotation: "custom-value"
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /alfresco/$2
nginx.ingress.kubernetes.io/affinity: "cookie"
nginx.ingress.kubernetes.io/session-cookie-name: "sync_affinity_route"
nginx.ingress.kubernetes.io/session-cookie-hash: "sha1"
12 changes: 7 additions & 5 deletions charts/alfresco-sync-service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,17 @@ database:
# -- Key within the secret holding the database password
password: DATABASE_PASSWORD
ingress:
# -- useful when running Sync service without SSL termination done by a load
# balancer, e.g. when ran on Minikube for testing purposes
# nginx.ingress.kubernetes.io/ssl-redirect: "false"
extraAnnotations: {}
annotations:
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /alfresco/$2
nginx.ingress.kubernetes.io/affinity: "cookie"
nginx.ingress.kubernetes.io/session-cookie-name: "sync_affinity_route"
nginx.ingress.kubernetes.io/session-cookie-hash: "sha1"
tls: []
hosts:
- paths:
- path: /syncservice(/|$)(.*)
pathType: Prefix
pathType: ImplementationSpecific
nodeSelector: {}
tolerations: []
terminationGracePeriodSeconds: 60
Expand Down
Loading