From f4bb5f93a2a3d20df79b68080fe7095e62cfe5ef Mon Sep 17 00:00:00 2001 From: Andrew Kozin Date: Tue, 20 Sep 2022 10:11:13 +0100 Subject: [PATCH 1/3] Add features.ingress.pathSuffix See the issue: https://github.com/imgproxy/imgproxy-helm/issues/90 This is a shortcut for the inconsistency discussed here: https://github.com/kubernetes-sigs/aws-load-balancer-controller/issues/667 --- imgproxy/templates/_helpers.tpl | 7 +++++++ imgproxy/templates/ingress.yaml | 2 +- imgproxy/values.yaml | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/imgproxy/templates/_helpers.tpl b/imgproxy/templates/_helpers.tpl index 32f6493..8fb2ded 100644 --- a/imgproxy/templates/_helpers.tpl +++ b/imgproxy/templates/_helpers.tpl @@ -102,3 +102,10 @@ https://docs.aws.amazon.com/eks/latest/userguide/specify-service-account-role.ht {{- $custom := $.Values.resources.deployment.resources | default dict -}} {{- merge $custom $default | toYaml -}} {{- end -}} + +{{/* Combine ingress path from server.pathPrefix and ingress.pathSuffix */}} +{{- define "imgproxy.ingressPath" -}} +{{- $prefix := ($.Values.features.server.pathPrefix | default "" | trimSuffix "/") -}} +{{- $suffix := ($.Values.resources.ingress.pathSuffix | default "" | trimPrefix "/") -}} +{{- printf "%s/%s" $prefix $suffix -}} +{{- end -}} diff --git a/imgproxy/templates/ingress.yaml b/imgproxy/templates/ingress.yaml index 157f669..7cfb88a 100644 --- a/imgproxy/templates/ingress.yaml +++ b/imgproxy/templates/ingress.yaml @@ -40,7 +40,7 @@ spec: http: paths: {{- $name := include "imgproxy.fullname" $ }} - {{- $path := default "/" $.Values.features.server.pathPrefix }} + {{- $path := include "imgproxy.ingressPath" $ }} {{- if eq $apiVersion "networking.k8s.io/v1" }} - path: {{ $path | quote }} pathType: {{ $pathType | quote }} diff --git a/imgproxy/values.yaml b/imgproxy/values.yaml index 614dcdd..e89c672 100644 --- a/imgproxy/values.yaml +++ b/imgproxy/values.yaml @@ -158,6 +158,9 @@ resources: ingress: enabled: false + # Add this prefix to ingress host paths. For example, use '*' for AWS load balancer + # This is a shortcut for the issue: https://github.com/kubernetes-sigs/aws-load-balancer-controller/issues/667 + pathSuffix: # the custom name for the ingress resource className: health: From a17fa34ab713fb437639d7d65f130d3bedd98013 Mon Sep 17 00:00:00 2001 From: Andrew Kozin Date: Tue, 20 Sep 2022 10:19:13 +0100 Subject: [PATCH 2/3] Prepare version 0.8.20 --- CHANGELOG.md | 4 ++++ Readme.md | 1 + imgproxy/Chart.yaml | 2 +- imgproxy/README.md | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bf0a71..f9d9549 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.8.20 (2022-09-20) + +* Add new setting `features.ingress.pathSuffix` + ## 0.8.19 (2022-07-31) * Fix broken env variables for imgproxy formats diff --git a/Readme.md b/Readme.md index 78c46d3..5d96c6a 100644 --- a/Readme.md +++ b/Readme.md @@ -344,6 +344,7 @@ Deployment specific options. |**resources.ingress.enabled**|When true, enables ingress resource for imgproxy|`false`| |**resources.ingress.health.whitelist**|Comma separated string of CIDR addresses that are allowed to access `/health` url of imgproxy|| |**resources.ingress.hosts**|Hostnames for the ingress resource to use|`["example.com"]`| +|**resources.ingress.pathSuffix**|Suffix to be added to path prefix, for example wildcard '*' for AWS balancer|| |**resources.ingress.tls**|TLS config array|| |**resources.ingress.tls[].hosts**|Hostnames this tls secret is used for|`["example.com"]`| |**resources.ingress.tls[].secretName**|Name of the k8s Secret resource which stores crt & key for the ingress resource|| diff --git a/imgproxy/Chart.yaml b/imgproxy/Chart.yaml index a297103..01b43df 100644 --- a/imgproxy/Chart.yaml +++ b/imgproxy/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 description: A fast and secure standalone server for resizing and converting remote images. The main principles of imgproxy are simplicity, speed, and security. name: imgproxy icon: https://cdn.rawgit.com/imgproxy/imgproxy/master/logo.svg -version: 0.8.19 +version: 0.8.20 appVersion: 3.7.0 keywords: - imgproxy diff --git a/imgproxy/README.md b/imgproxy/README.md index 54970c1..e964b9d 100644 --- a/imgproxy/README.md +++ b/imgproxy/README.md @@ -402,6 +402,7 @@ Deployment specific options. |**resources.ingress.enabled**|When true, enables ingress resource for imgproxy|`false`| |**resources.ingress.health.whitelist**|Comma separated string of CIDR addresses that are allowed to access `/health` url of imgproxy|| |**resources.ingress.hosts**|Hostnames for the ingress resource to use|`["example.com"]`| +|**resources.ingress.pathSuffix**|Suffix to be added to path prefix, for example wildcard '*' for AWS balancer|| |**resources.ingress.pathType**|Set the pathType for ingress rules explicitly (use `Prefix` for AWS ELB Controllers)|`ImplementationSpecific`| |**resources.ingress.tls**|TLS config array|| |**resources.ingress.tls[].hosts**|Hostnames this tls secret is used for|`["example.com"]`| From 5edf0ed3aab531f8204fd71243dfb05909eaa34f Mon Sep 17 00:00:00 2001 From: Andrew Kozin Date: Tue, 20 Sep 2022 10:23:22 +0100 Subject: [PATCH 3/3] Fix typo --- imgproxy/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgproxy/values.yaml b/imgproxy/values.yaml index e89c672..4694a66 100644 --- a/imgproxy/values.yaml +++ b/imgproxy/values.yaml @@ -158,7 +158,7 @@ resources: ingress: enabled: false - # Add this prefix to ingress host paths. For example, use '*' for AWS load balancer + # Add this suffix to ingress host paths. For example, use '*' for AWS load balancer # This is a shortcut for the issue: https://github.com/kubernetes-sigs/aws-load-balancer-controller/issues/667 pathSuffix: # the custom name for the ingress resource