Skip to content

Commit

Permalink
Merge pull request #83 from codecademy-engineering/DEVOPS-4852-option…
Browse files Browse the repository at this point in the history
…al-pod-port

[DEVOPS-4852] Optional pod ports
  • Loading branch information
anaharris authored Oct 25, 2022
2 parents 565a1cd + 3fd3346 commit c0fffb8
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/service/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]
name: devops
2 changes: 2 additions & 0 deletions charts/service/ci/custom-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ podLabels:
annotations:
abc: def

containerPort: 80

additionalPort:
port: 10000
name: potato
Expand Down
37 changes: 37 additions & 0 deletions charts/service/ci/no-port-values.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions charts/service/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 0 additions & 2 deletions charts/service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ env: []
envKeyValue: {}
# FOO: bar

containerPort: 80

autoscaling:
enabled: false

Expand Down

0 comments on commit c0fffb8

Please sign in to comment.