From 3fd33462608c6d5252d80f0d0a4c046150d547ef Mon Sep 17 00:00:00 2001 From: Ana Harris Date: Mon, 17 Oct 2022 10:32:33 -0400 Subject: [PATCH] make pod ports optional, add test values.yaml file & bump version Signed-off-by: Ana Harris --- charts/service/Chart.yaml | 2 +- charts/service/ci/custom-values.yaml | 2 ++ charts/service/ci/no-port-values.yaml | 37 ++++++++++++++++++++++++ charts/service/templates/deployment.yaml | 2 ++ charts/service/values.yaml | 2 -- 5 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 charts/service/ci/no-port-values.yaml diff --git a/charts/service/Chart.yaml b/charts/service/Chart.yaml index 12d7c26..15876ef 100644 --- a/charts/service/Chart.yaml +++ b/charts/service/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: service description: A generic k8s service chart type: application -version: 1.1.4 +version: 1.2.0 maintainers: - email: devops@codecademy.com name: devops diff --git a/charts/service/ci/custom-values.yaml b/charts/service/ci/custom-values.yaml index e480874..1f35666 100644 --- a/charts/service/ci/custom-values.yaml +++ b/charts/service/ci/custom-values.yaml @@ -51,6 +51,8 @@ podLabels: annotations: abc: def +containerPort: 80 + additionalPort: port: 10000 name: potato diff --git a/charts/service/ci/no-port-values.yaml b/charts/service/ci/no-port-values.yaml new file mode 100644 index 0000000..01647d9 --- /dev/null +++ b/charts/service/ci/no-port-values.yaml @@ -0,0 +1,37 @@ +resources: + requests: + cpu: 5m + limits: + cpu: 100m + +env: + - name: FOO + value: bar + - name: POTATO + value: potato + +envKeyValue: + ABCDEF: ghijkl + STUFF: things + NUMBER: 7 + +image: + command: + - nginx-debug + - '-g' + - 'daemon off;' + +annotations: + abc: def + +autoscaling: + enabled: true + minReplicas: 1 + maxReplicas: 2 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 50 diff --git a/charts/service/templates/deployment.yaml b/charts/service/templates/deployment.yaml index 1585980..cdb90a5 100644 --- a/charts/service/templates/deployment.yaml +++ b/charts/service/templates/deployment.yaml @@ -95,10 +95,12 @@ spec: fieldRef: fieldPath: metadata.labels['tags.datadoghq.com/version'] {{- end }} + {{- if .Values.containerPort }} ports: - name: http containerPort: {{ .Values.containerPort }} protocol: TCP + {{- end }} {{- with .Values.service.additionalPort }} - name: {{ .name }} containerPort: {{ .port }} diff --git a/charts/service/values.yaml b/charts/service/values.yaml index 0a23698..efc13ed 100644 --- a/charts/service/values.yaml +++ b/charts/service/values.yaml @@ -48,8 +48,6 @@ env: [] envKeyValue: {} # FOO: bar -containerPort: 80 - autoscaling: enabled: false