Skip to content

Commit

Permalink
feat(charts): support mutiple ports (#24)
Browse files Browse the repository at this point in the history
* feat(charts): support mutiple ports

* feat(charts): increase version

* feat(charts): test case additional ports

---------

Co-authored-by: Anton Lehene <lehenea@media-saturn.com>
  • Loading branch information
gcoder75 and Anton Lehene authored May 11, 2023
1 parent 6c5d6f5 commit 526abff
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 1 deletion.
25 changes: 25 additions & 0 deletions chart-tests/application/ci/test-additional-port-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
resources:
requests:
cpu: 10m
memory: 50Mi
limits:
cpu: 100m
memory: 100Mi
spec:
values:
container:
port: 8000
service:
port: 8000
backendConfig:
enabled: true
securityPolicyName: uri-path-policy
additionalPorts:
- name: https
protocol: TCP
containerPort: 8081
servicePort: 81
- name: grpc
protocol: TCP
containerPort: 8082
servicePort: 82
2 changes: 1 addition & 1 deletion charts/application/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ maintainers:
- name: MediaMarktSaturn
url: https://github.com/MediaMarktSaturn
appVersion: 1.0.0
version: 1.0.0
version: 1.1.0
5 changes: 5 additions & 0 deletions charts/application/templates/k8s-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ spec:
- name: http
containerPort: {{ .Values.container.port }}
protocol: TCP
{{- range $ap := .Values.additionalPorts }}
- name: {{ $ap.name }}
containerPort: {{ $ap.containerPort }}
protocol: {{ $ap.protocol }}
{{- end }}
livenessProbe:
httpGet:
path: {{ .Values.livenessProbe.path }}
Expand Down
7 changes: 7 additions & 0 deletions charts/application/templates/k8s-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ spec:
targetPort: {{ .Values.container.port }}
protocol: TCP
name: http
{{- range $ap := .Values.additionalPorts }}
- port: {{ $ap.servicePort }}
targetPort: {{ $ap.containerPort }}
protocol: {{ $ap.protocol }}
name: {{ $ap.name }}
{{- end }}

selector:
{{- include "selectorLabels" . | nindent 4 }}
{{- end }}
7 changes: 7 additions & 0 deletions charts/application/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,10 @@ volumeMounts: []
# # name of a pre-existent PVC to be used. if empty, a 'emptyDir' is bound
# pvcName:
# mountPath: /data

# list of additional ports to be exposed
additionalPorts: []
# - name: grpc
# protocol: TCP
# containerPort: 8081
# servicePort: 81

0 comments on commit 526abff

Please sign in to comment.