Skip to content
This repository has been archived by the owner on Jun 13, 2022. It is now read-only.

Commit

Permalink
Merge pull request #151 from SAP/ingress-controller-rework
Browse files Browse the repository at this point in the history
Ingress controller rework
  • Loading branch information
Eike-Tobias Ostermann authored Jul 7, 2020
2 parents 1e3d88d + 2be6156 commit 3bcc3ef
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 51 deletions.
7 changes: 5 additions & 2 deletions helm/i40-aas/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@ dependencies:
- name: mongodb
repository: https://charts.bitnami.com/bitnami
version: 7.13.0
digest: sha256:f2d95d0f034749fd1efc407b609882a4d43161de4c6aa1398d4867718a602f7b
generated: "2020-04-23T12:42:05.84050605+02:00"
- name: kubernetes-ingress
repository: https://haproxytech.github.io/helm-charts
version: 1.4.1
digest: sha256:8181df5ce61074093da953f0639887ec06bfb8e76e5b461bcb9d323ef2a94e93
generated: "2020-07-03T13:43:00.11969124+02:00"
5 changes: 4 additions & 1 deletion helm/i40-aas/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 0.2.0
version: 0.3.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
Expand All @@ -32,3 +32,6 @@ dependencies:
name: mongodb
version: 7.13.0
repository: https://charts.bitnami.com/bitnami
- name: kubernetes-ingress
version: 1.4.1
repository: https://haproxytech.github.io/helm-charts
Binary file added helm/i40-aas/charts/kubernetes-ingress-1.4.1.tgz
Binary file not shown.
Binary file modified helm/i40-aas/charts/mongodb-7.13.0.tgz
Binary file not shown.
18 changes: 2 additions & 16 deletions helm/i40-aas/templates/adapter-registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ metadata:
labels:
service: adapter-registry
{{- include "i40-aas.labels" . | nindent 4 }}
annotations:
ingress.kubernetes.io/path-rewrite: "/([^/]*)(/?.*) \\2"
spec:
clusterIP: None
ports:
Expand All @@ -16,22 +18,6 @@ spec:
service: adapter-registry
{{- include "i40-aas.selectorLabels" . | nindent 4 }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-adapter-registry-api
labels:
service: adapter-registry
{{- include "i40-aas.labels" . | nindent 4 }}
spec:
ports:
- targetPort: endpoint
port: {{ .Values.core.registries.adapters.port }}
protocol: TCP
selector:
service: adapter-registry
{{- include "i40-aas.selectorLabels" . | nindent 4 }}
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
Expand Down
2 changes: 2 additions & 0 deletions helm/i40-aas/templates/data-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ metadata:
labels:
service: data-manager
{{- include "i40-aas.labels" . | nindent 4 }}
annotations:
ingress.kubernetes.io/path-rewrite: "/([^/]*)(/?.*) \\2"
spec:
ports:
- targetPort: endpoint
Expand Down
2 changes: 2 additions & 0 deletions helm/i40-aas/templates/endpoint-registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ metadata:
labels:
service: endpoint-registry
{{- include "i40-aas.labels" . | nindent 4 }}
annotations:
ingress.kubernetes.io/path-rewrite: "/([^/]*)(/?.*) \\2"
spec:
ports:
- targetPort: endpoint
Expand Down
2 changes: 2 additions & 0 deletions helm/i40-aas/templates/https-endpoint-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ metadata:
labels:
service: https-endpoint-ingress
{{- include "i40-aas.labels" . | nindent 4 }}
annotations:
ingress.kubernetes.io/path-rewrite: "/([^/]*)(/?.*) \\2"
spec:
ports:
- targetPort: endpoint
Expand Down
50 changes: 19 additions & 31 deletions helm/i40-aas/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ metadata:
service: ingress
{{- include "i40-aas.labels" . | nindent 4 }}
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/ssl-redirect: "false"
ingress.kubernetes.io/ingress.class: "haproxy"
{{- if .Values.security.tls.enabled }}
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
ingress.kubernetes.io/server-ssl: "true"
{{- end }}
{{- if .Values.ingress.certManager }}
cert-manager.io/cluster-issuer: {{ required "A valid .Values.ingress.certManager.clusterIssuer entry required!" .Values.ingress.certManager.clusterIssuer }}
Expand All @@ -29,37 +27,27 @@ spec:
{{- end }}
http:
paths:
- backend:
serviceName: {{ .Release.Name }}-https-endpoint-ingress
servicePort: {{ .Values.core.ingress.http.port }}
path: /https-endpoint/(interaction(.*))
- backend:
serviceName: {{ .Release.Name }}-grpc-endpoint-ingress
servicePort: {{ .Values.core.ingress.grpc.port }}
path: /grpc-endpoint/(.*)
- backend:
serviceName: {{ .Release.Name }}-adapter-registry-api
- path: /https-endpoint
backend:
serviceName: {{ .Release.Name }}-https-endpoint-ingress
servicePort: {{ .Values.core.ingress.http.port }}
- path: /adapter-registry
backend:
serviceName: {{ .Release.Name }}-adapter-registry
servicePort: {{ .Values.core.registries.adapters.port }}
path: /adapter-registry/(.*)
- backend:
- path: /endpoint-registry
backend:
serviceName: {{ .Release.Name }}-endpoint-registry
servicePort: {{ .Values.core.registries.endpoints.port }}
path: /endpoint-registry/(.*)
- backend:
servicePort: {{ .Values.core.registries.endpoints.port }}
- path: /data-manager
backend:
serviceName: {{ .Release.Name }}-data-manager
servicePort: {{ .Values.core.dataManager.port }}
- path: /storage-adapter-mongodb
backend:
serviceName: {{ .Release.Name }}-storage-adapter-mongodb
servicePort: {{ .Values.applicationAdapters.mongoDb.port }}
path: /storage-adapter-mongodb/(.*)
{{- /*
- backend:
serviceName: {{ .Release.Name }}-rabbitmq
servicePort: {{ .Values.rabbitmq.service.managerPort }}
path: /rabbitmq/(.*)
*/ -}}
{{- /*
- backend:
serviceName: {{ .Release.Name }}-onboardingskillmongodb
servicePort: {{ .Values.onboardingskillmongodb.service.port }}
path: /mongodb/(.*)
*/ -}}


---
2 changes: 2 additions & 0 deletions helm/i40-aas/templates/storage-adapter-mongodb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ metadata:
labels:
service: storage-adapter-mongodb
{{- include "i40-aas.labels" . | nindent 4 }}
annotations:
ingress.kubernetes.io/path-rewrite: "/([^/]*)(/?.*) \\2"
spec:
ports:
- targetPort: endpoint
Expand Down
13 changes: 12 additions & 1 deletion helm/i40-aas/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,15 @@ onboardingskillmongodb:
secondary: 0
arbiter: 0
readinessProbe:
enabled: false
enabled: false

kubernetes-ingress:
controller:
ingressClass: haproxy
service:
type: LoadBalancer
extraArgs:
- --namespace-whitelist=$(POD_NAMESPACE)
replicaCount: 1
defaultBackend:
replicaCount: 1

0 comments on commit 3bcc3ef

Please sign in to comment.