Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

control-service: ingress allow for multiple hosts #2911

Merged
merged 3 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
kind: Ingress
metadata:
name: {{ include "common.names.fullname" . }}
namespace: {{ .Release.Namespace }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
annotations: {{- toYaml .Values.ingress.annotations | nindent 4 }}
apiVersion: networking.k8s.io/v1
Expand All @@ -15,29 +16,26 @@ spec:
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
rules:
- host: {{ .Values.ingress.host | quote }}
http:
paths:
{{- if .Values.operationsUi.enabled }}
- path: {{ .Values.ingress.path | default "/" }}
pathType: "ImplementationSpecific"
backend:
service:
name: {{ .Release.Name }}-ui
port:
number: 8091
{{- end }}
- path: {{ .Values.ingress.path | default "/data-jobs" }}
pathType: "ImplementationSpecific"
backend:
service:
name: {{ .Release.Name }}-svc
port:
number: {{ .Values.service.internalPort }}
{{- if .Values.ingress.tls_secret }}
{{- range .Values.ingress.hosts }}
- host: {{ .name }}
http:
paths:
{{- range .paths }}
- path: {{ default "/" .path | quote }}
pathType: "ImplementationSpecific"
backend:
service:
name: {{ tpl .serviceName $ }}
port:
number: {{ .servicePort }}
{{- end }}
{{- end }}
tls:
- hosts:
- {{ .Values.ingress.host | quote}}
secretName: {{ .Values.ingress.tls_secret }}
{{- end }}
{{- end }}
{{- range .Values.ingress.hosts }}
{{- if .tls }}
- hosts:
- {{ .name }}
secretName: {{ .tlsSecretName }}
{{- end }}
{{- end }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ deploymentBuilder:

## Service configuration
service:
internalPort: 8092
internalPort: &controlServicePort 8092
type: LoadBalancer # NodePort
externalTrafficPolicy: Cluster
# nodePort:
Expand Down Expand Up @@ -104,17 +104,21 @@ ingress:
annotations: {}
# kubernetes.io/ingress.class: nginx
## Configure hostname to use in named-based virtual host.
host:
## hosts:
## - name: "sc-dp-cs-stg.vdp-stg.oc.vmware.com"
## paths:
## URI path/endpoint to the service
## This should be unique path to instruct the ingress controller which path is served by the downstream service.
## Defaults to '/'
## This allows the service to co-exist and share the same hostname with other services.
path: ""
## - path: /data-jobs
## serviceName: "{{ .Release.Name }}-svc"
## servicePort: *controlServicePort
## tls: true
## Provide existing secret which holds TLS certificate/key.
## This is will instruct the ingress controller to use specific TLS certificate on this ingress resource. By default,
## we use community Nginx controller which supports SNI, thus a signle IP could terminate all connections.
## https://github.com/kubernetes/ingress-nginx/
tls_secret: ""
## tlsSecretName: "tpcs-test-tls-secret"
## It is used to associate an Ingress resource with a specific Ingress controller or implementation.
className: ""

Expand Down