Skip to content

Commit 6596237

Browse files
committed
Support ports and hosts configurations
1 parent 73a82da commit 6596237

3 files changed

Lines changed: 22 additions & 13 deletions

File tree

.diploi/helm/app-ingress.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,24 @@ metadata:
55
annotations:
66
kubernetes.io/ingress.class: traefik
77
spec:
8+
{{- if .Values.endpoints }}
89
tls:
910
- hosts:
10-
- {{ .Values.hosts.app }}
11+
{{- range .Values.endpoints }}
12+
- {{ .url }}
13+
{{- end }}
1114
secretName: tls-secret
1215
rules:
13-
- host: {{ .Values.hosts.app }}
16+
{{- range .Values.endpoints }}
17+
- host: {{ .url }}
1418
http:
1519
paths:
1620
- path: '/'
1721
pathType: Prefix
1822
backend:
1923
service:
20-
name: app
24+
name: {{ .serviceName }}
2125
port:
22-
number: 3000
26+
number: {{ .port }}
27+
{{- end }}
28+
{{- end }}

.diploi/helm/app-service.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@ kind: Service
33
metadata:
44
name: app
55
spec:
6+
{{- if .Values.ports }}
67
ports:
7-
- port: 3000
8-
name: app
8+
{{- range .Values.ports }}
9+
{{- if eq .serviceName "app" }}
10+
- port: {{ .port }}
11+
name: {{ .identifier }}
12+
{{- end }}
13+
{{- end }}
14+
{{- end }}
915
selector:
10-
app: app
16+
app: app

diploi.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,12 @@ contexts:
77
- name: app
88
identifier: app
99

10+
supportsAdditionalHosts: { serviceName: 'app'}
11+
1012
hosts:
1113
- name: Node.js
1214
identifier: app
13-
urlFormat: '[label].[default-domain]'
14-
15-
connectionStrings:
16-
- name: Internal Address
17-
value: http://app.${DIPLOI_NAMESPACE}:3000
18-
description: This address is for requests from within the deployment and is inaccessible externally.
15+
port: 3000
1916

2017
images:
2118
- identifier: app

0 commit comments

Comments
 (0)