diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index 6c73710e..292d4ac3 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -30,7 +30,7 @@ jobs: - uses: actions/setup-python@v5 with: # renovate: datasource=docker depName=python - python-version: '3.12' + python-version: '3.13' check-latest: true - name: Set up chart-testing diff --git a/charts/atlantis/Chart.yaml b/charts/atlantis/Chart.yaml index cdbeece9..1a2c0ec5 100644 --- a/charts/atlantis/Chart.yaml +++ b/charts/atlantis/Chart.yaml @@ -3,7 +3,7 @@ apiVersion: v1 appVersion: v0.30.0 description: A Helm chart for Atlantis https://www.runatlantis.io name: atlantis -version: 5.6.0 +version: 5.6.0 keywords: - terraform home: https://www.runatlantis.io diff --git a/charts/atlantis/README.md b/charts/atlantis/README.md index 2e8e969c..5c0eb55c 100644 --- a/charts/atlantis/README.md +++ b/charts/atlantis/README.md @@ -186,7 +186,7 @@ extraManifests: | service.nodePort | string | `nil` | | | service.port | int | `80` | | | service.portName | string | `"atlantis"` | | -| service.targetPort | int | `4141` | | +| service.targetPort | int | `4141` | [optional] Define the port you would like atlantis to run on. Defaults to 4141. | | service.type | string | `"NodePort"` | | | serviceAccount.annotations | object | `{}` | Annotations for the Service Account. Check values.yaml for examples. | | serviceAccount.create | bool | `true` | Specifies whether a ServiceAccount should be created. | diff --git a/charts/atlantis/templates/statefulset.yaml b/charts/atlantis/templates/statefulset.yaml index 856fa161..342b3b63 100644 --- a/charts/atlantis/templates/statefulset.yaml +++ b/charts/atlantis/templates/statefulset.yaml @@ -237,7 +237,7 @@ spec: {{- end }} ports: - name: atlantis - containerPort: 4141 + containerPort: {{ .Values.service.targetPort }} {{- with .Values.lifecycle }} lifecycle: {{ toYaml . | nindent 12 }} {{- end }} @@ -330,7 +330,7 @@ spec: value: {{ .Values.orgWhitelist | quote }} {{- end }} - name: ATLANTIS_PORT - value: "4141" + value: {{ .Values.service.targetPort | quote }} {{- if .Values.repoConfig }} - name: ATLANTIS_REPO_CONFIG value: /etc/atlantis/repos.yaml @@ -509,7 +509,7 @@ spec: livenessProbe: httpGet: path: /healthz - port: 4141 + port: {{ .Values.service.targetPort }} scheme: {{ .Values.livenessProbe.scheme }} initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} periodSeconds: {{ .Values.livenessProbe.periodSeconds }} @@ -521,7 +521,7 @@ spec: readinessProbe: httpGet: path: /healthz - port: 4141 + port: {{ .Values.service.targetPort }} scheme: {{ .Values.readinessProbe.scheme }} initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} periodSeconds: {{ .Values.readinessProbe.periodSeconds }} diff --git a/charts/atlantis/tests/statefulset_test.yaml b/charts/atlantis/tests/statefulset_test.yaml index 4096e8ce..f97a2529 100644 --- a/charts/atlantis/tests/statefulset_test.yaml +++ b/charts/atlantis/tests/statefulset_test.yaml @@ -168,6 +168,54 @@ tests: path: spec.template.spec.updateStrategy - notExists: path: spec.volumeClaimTemplates + - it: custom port values + template: statefulset.yaml + set: + service: + targetPort: 8888 + asserts: + - equal: + path: spec.template.spec.containers[0].ports + value: + - containerPort: 8888 + name: atlantis + - equal: + path: spec.template.spec.containers[0].env + value: + - name: PATH + value: /plugins:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + - name: ATLANTIS_DATA_DIR + value: /atlantis-data + - name: ATLANTIS_REPO_ALLOWLIST + value: + - name: ATLANTIS_PORT + value: "8888" + - name: ATLANTIS_ATLANTIS_URL + value: http:// + - equal: + path: spec.template.spec.containers[0].livenessProbe + value: + failureThreshold: 5 + httpGet: + path: /healthz + port: 8888 + scheme: HTTP + initialDelaySeconds: 5 + periodSeconds: 60 + successThreshold: 1 + timeoutSeconds: 5 + - equal: + path: spec.template.spec.containers[0].readinessProbe + value: + failureThreshold: 5 + httpGet: + path: /healthz + port: 8888 + scheme: HTTP + initialDelaySeconds: 5 + periodSeconds: 60 + successThreshold: 1 + timeoutSeconds: 5 - it: replicaCount template: statefulset.yaml set: diff --git a/charts/atlantis/values.yaml b/charts/atlantis/values.yaml index e0092bf0..d10522e6 100644 --- a/charts/atlantis/values.yaml +++ b/charts/atlantis/values.yaml @@ -291,6 +291,7 @@ service: port: 80 portName: atlantis nodePort: null + # -- (int) [optional] Define the port you would like atlantis to run on. Defaults to 4141. targetPort: 4141 loadBalancerIP: null loadBalancerSourceRanges: []