From d083ceed05e4100b5c82703044c51eeea409b67e Mon Sep 17 00:00:00 2001 From: Max Harley Date: Wed, 10 Apr 2024 12:49:01 -0400 Subject: [PATCH] Replace nginx with traefik - nlp --- helm/nemesis/templates/nlp.yaml | 65 ++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/helm/nemesis/templates/nlp.yaml b/helm/nemesis/templates/nlp.yaml index e29af56..1c9e600 100644 --- a/helm/nemesis/templates/nlp.yaml +++ b/helm/nemesis/templates/nlp.yaml @@ -1,42 +1,17 @@ --- -apiVersion: v1 -kind: Service -metadata: - name: nlp - labels: - app: nlp - component: enrichment-pipeline -spec: - type: NodePort - ports: - - name: "9803" - port: 9803 - targetPort: 9803 - nodePort: {{ .Values.nlp.nodePort }} - - name: "8000" - port: 8000 - targetPort: 8000 - nodePort: {{ .Values.nlp.prometheusNodePort }} - selector: - app: nlp ---- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: nlp-ingress annotations: - nginx.ingress.kubernetes.io/auth-type: basic - nginx.ingress.kubernetes.io/auth-secret: {{ .Values.operation.basicAuthExistingSecret }} - nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required' - nginx.ingress.kubernetes.io/ssl-redirect: "false" - nginx.ingress.kubernetes.io/rewrite-target: /$2 + traefik.ingress.kubernetes.io/router.middlewares: "{{ .Release.Namespace }}-ingress-nlp-stripprefix@kubernetescrd" spec: - ingressClassName: nginx + ingressClassName: traefik rules: - http: paths: - - path: /nlp(/|$)(.*) - pathType: ImplementationSpecific + - path: /nlp + pathType: Prefix backend: service: name: nlp @@ -179,4 +154,34 @@ spec: timeoutSeconds: 5 failureThreshold: 10 - restartPolicy: Always \ No newline at end of file + restartPolicy: Always +--- +apiVersion: v1 +kind: Service +metadata: + name: nlp + labels: + app: nlp + component: enrichment-pipeline +spec: + type: NodePort + ports: + - name: "9803" + port: 9803 + targetPort: 9803 + nodePort: {{ .Values.nlp.nodePort }} + - name: "8000" + port: 8000 + targetPort: 8000 + nodePort: {{ .Values.nlp.prometheusNodePort }} + selector: + app: nlp +--- +apiVersion: traefik.containo.us/v1alpha1 +kind: Middleware +metadata: + name: ingress-nlp-stripprefix +spec: + stripPrefix: + prefixes: + - /nlp \ No newline at end of file