Replace nginx with traefik - nlp

This commit is contained in:
Max Harley
2024-04-10 12:49:01 -04:00
parent c2e206b2aa
commit d083ceed05
+35 -30
View File
@@ -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
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