From ca07d2c35ef10bf3e491c1ba20803865d271c696 Mon Sep 17 00:00:00 2001 From: Keyvan Date: Wed, 31 Jul 2024 15:18:11 +0000 Subject: [PATCH] Fix push endpoint ingress --- charts/radar-push-endpoint/Chart.yaml | 2 +- charts/radar-push-endpoint/README.md | 5 +++-- .../radar-push-endpoint/templates/ingress.yaml | 17 +++++++++++++++-- charts/radar-push-endpoint/values.yaml | 5 +++-- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/charts/radar-push-endpoint/Chart.yaml b/charts/radar-push-endpoint/Chart.yaml index da95925..d2fbd68 100644 --- a/charts/radar-push-endpoint/Chart.yaml +++ b/charts/radar-push-endpoint/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: "0.2.2" description: A Helm chart for RADAR-base Push Endpoint. REST Gateway to Kafka, for incoming data from Push or Subscription based WEB APIs. It performs authentication, authorization and content validation. For more details of the configurations, see https://github.com/RADAR-base/RADAR-PushEndpoint. name: radar-push-endpoint -version: 0.3.0 +version: 0.3.1 icon: "http://radar-base.org/wp-content/uploads/2022/09/Logo_RADAR-Base-RGB.png" sources: - https://github.com/RADAR-base/radar-helm-charts/tree/main/charts/radar-push-endpoint diff --git a/charts/radar-push-endpoint/README.md b/charts/radar-push-endpoint/README.md index 8f8a594..ccb837a 100644 --- a/charts/radar-push-endpoint/README.md +++ b/charts/radar-push-endpoint/README.md @@ -3,7 +3,7 @@ # radar-push-endpoint [![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/radar-push-endpoint)](https://artifacthub.io/packages/helm/radar-base/radar-push-endpoint) -![Version: 0.3.0](https://img.shields.io/badge/Version-0.3.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.2.2](https://img.shields.io/badge/AppVersion-0.2.2-informational?style=flat-square) +![Version: 0.3.1](https://img.shields.io/badge/Version-0.3.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.2.2](https://img.shields.io/badge/AppVersion-0.2.2-informational?style=flat-square) A Helm chart for RADAR-base Push Endpoint. REST Gateway to Kafka, for incoming data from Push or Subscription based WEB APIs. It performs authentication, authorization and content validation. For more details of the configurations, see https://github.com/RADAR-base/RADAR-PushEndpoint. @@ -44,7 +44,8 @@ A Helm chart for RADAR-base Push Endpoint. REST Gateway to Kafka, for incoming d | disable_tls | bool | `false` | Disable TLS (reconfigures Ingress and sets URLs to use HTTP) | | ingress.enabled | bool | `true` | Enable ingress controller resource | | ingress.annotations | object | check values.yaml | Annotations that define default ingress class, certificate issuer and deny access to sensitive URLs | -| ingress.path | string | `"/push-endpoint/?(.*)"` | Path within the url structure | +| ingress.path | string | `"/push-endpoint"` | Path within the url structure | +| ingress.pathType | string | `"ImplementationSpecific"` | Ingress Path type | | ingress.ingressClassName | string | `"nginx"` | IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+) | | ingress.hosts | list | `["localhost"]` | Hosts to accept requests from | | ingress.tls.secretName | string | `"radar-base-tls-radar-push-endpoint"` | Name of the secret that contains TLS certificates | diff --git a/charts/radar-push-endpoint/templates/ingress.yaml b/charts/radar-push-endpoint/templates/ingress.yaml index ce22683..7054ef9 100644 --- a/charts/radar-push-endpoint/templates/ingress.yaml +++ b/charts/radar-push-endpoint/templates/ingress.yaml @@ -2,7 +2,13 @@ {{- $fullName := include "radar-push-endpoint.fullname" . -}} {{- $path := .Values.ingress.path -}} {{- $hosts := .Values.ingress.hosts -}} +{{- $svcPort := .Values.service.port -}} +{{- $pathType := .Values.ingress.pathType -}} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} apiVersion: networking.k8s.io/v1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} kind: Ingress metadata: name: {{ $fullName }} @@ -28,11 +34,18 @@ spec: http: paths: - path: {{ $path | quote }} - pathType: Prefix + {{- if and $pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ $pathType }} + {{- end }} backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} service: name: {{ $fullName }} port: - name: http + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} {{- end }} {{- end }} diff --git a/charts/radar-push-endpoint/values.yaml b/charts/radar-push-endpoint/values.yaml index 2116ef8..3d59bbc 100644 --- a/charts/radar-push-endpoint/values.yaml +++ b/charts/radar-push-endpoint/values.yaml @@ -51,7 +51,6 @@ ingress: # @default -- check values.yaml annotations: cert-manager.io/cluster-issuer: letsencrypt-prod - nginx.ingress.kubernetes.io/rewrite-target: /push/integrations/$1 nginx.ingress.kubernetes.io/server-snippet: | location /push-endpoint/garmin { # set client body size to 20M # @@ -67,7 +66,9 @@ ingress: deny all; } # -- Path within the url structure - path: "/push-endpoint/?(.*)" + path: "/push-endpoint" + # -- Ingress Path type + pathType: ImplementationSpecific # -- IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+) ingressClassName: nginx # -- Hosts to accept requests from