Skip to content

Commit 9239420

Browse files
authored
feat(atlantis): add service.extraPorts for additional service ports (#560)
Allow exposing extra ports on the Atlantis Service (e.g. an auth-proxy sidecar) without forking the chart. Renders nothing when empty, so the default service output is unchanged. Signed-off-by: DrFaust92 <ilia.lazebnik@placer.ai>
1 parent 7608f24 commit 9239420

6 files changed

Lines changed: 34 additions & 1 deletion

File tree

charts/atlantis/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: v1
33
appVersion: v0.44.0
44
description: A Helm chart for Atlantis https://www.runatlantis.io
55
name: atlantis
6-
version: 6.6.0
6+
version: 6.7.0
77
keywords:
88
- terraform
99
home: https://www.runatlantis.io

charts/atlantis/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ Optionally, set `service.internalTrafficPolicy: Local` or `Cluster` depending on
265265
| secret.annotations | object | `{}` | Annotations for the Secrets. Check values.yaml for examples. |
266266
| service.annotations | object | `{}` | |
267267
| service.externalTrafficPolicy | string | `nil` | |
268+
| service.extraPorts | list | `[]` | [optional] Additional ports to expose on the service, e.g. for an auth proxy sidecar. Each entry is a standard Service port object. |
268269
| service.internalTrafficPolicy | string | `nil` | [optional] Internal traffic policy for the Service. One of: Cluster, Local. |
269270
| service.loadBalancerIP | string | `nil` | |
270271
| service.loadBalancerSourceRanges | list | `[]` | |

charts/atlantis/templates/service.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ spec:
4444
{{- end }}
4545
protocol: TCP
4646
name: {{ .Values.service.portName }}
47+
{{- with .Values.service.extraPorts }}
48+
{{- toYaml . | nindent 4 }}
49+
{{- end }}
4750
selector:
4851
app: {{ template "atlantis.name" . }}
4952
release: {{ .Release.Name }}

charts/atlantis/tests/service_test.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,22 @@ tests:
103103
- equal:
104104
path: metadata.labels.team
105105
value: infra
106+
- it: extraPorts
107+
set:
108+
service:
109+
extraPorts:
110+
- name: auth-proxy
111+
port: 4180
112+
protocol: TCP
113+
targetPort: auth-proxy
114+
asserts:
115+
- equal:
116+
path: spec.ports[1]
117+
value:
118+
name: auth-proxy
119+
port: 4180
120+
protocol: TCP
121+
targetPort: auth-proxy
122+
- lengthEqual:
123+
path: spec.ports
124+
count: 2

charts/atlantis/values.schema.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,14 @@
568568
],
569569
"default": 4141
570570
},
571+
"extraPorts": {
572+
"description": "Additional ports to expose on the service, e.g. for an auth proxy sidecar.",
573+
"type": "array",
574+
"items": {
575+
"type": "object"
576+
},
577+
"default": []
578+
},
571579
"externalTrafficPolicy": {
572580
"description": "externalTrafficPolicy to set on service.",
573581
"type": [

charts/atlantis/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,8 @@ service:
311311
nodePort: null
312312
# -- (int) [optional] Define the port you would like atlantis to run on. Defaults to 4141.
313313
targetPort: 4141
314+
# -- (list) [optional] Additional ports to expose on the service, e.g. for an auth proxy sidecar. Each entry is a standard Service port object.
315+
extraPorts: []
314316
loadBalancerIP: null
315317
loadBalancerSourceRanges: []
316318
externalTrafficPolicy: null

0 commit comments

Comments
 (0)