Skip to content

Commit

Permalink
Merge pull request #106 from codecademy-engineering/DEVOPS-6644
Browse files Browse the repository at this point in the history
[DEVOPS-6644] Extend service chart to allow ingress resource to specify a different service name for a path
  • Loading branch information
igoralveslima authored Sep 18, 2023
2 parents 088de44 + dcc60c1 commit 4c99b55
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 1 deletion.
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.8.5
version: 1.8.6
maintainers:
- email: [email protected]
name: devops
17 changes: 17 additions & 0 deletions charts/service/ci/ingress-with-custom-service-name-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
image:
command:
- nginx-debug
- '-g'
- 'daemon off;'

ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
hosts:
- host: example.internal.codecademy.com
paths:
- path: '/'
service: 'this-service'
- path: '/other'
service: 'other-service'
2 changes: 2 additions & 0 deletions charts/service/ci/keda-values.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
resources:
requests:
cpu: 5m
memory: 5M
limits:
cpu: 100m
memory: 10M

env:
- name: FOO
Expand Down
10 changes: 10 additions & 0 deletions charts/service/templates/ingress-nlb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ spec:
http:
paths:
{{- range .paths }}
{{- if (kindIs "map" .) }}
- path: {{ .path }}
pathType: ImplementationSpecific
backend:
service:
name: {{ .service }}
port:
name: http
{{- else }}
- path: {{ . }}
pathType: ImplementationSpecific
backend:
Expand All @@ -35,5 +44,6 @@ spec:
port:
name: http
{{- end }}
{{- end }}
{{- end }}
{{- end }}
10 changes: 10 additions & 0 deletions charts/service/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ spec:
http:
paths:
{{- range .paths }}
{{- if (kindIs "map" .) }}
- path: {{ .path }}
pathType: ImplementationSpecific
backend:
service:
name: {{ .service }}
port:
name: http
{{- else }}
- path: {{ . }}
pathType: ImplementationSpecific
backend:
Expand All @@ -35,5 +44,6 @@ spec:
port:
name: http
{{- end }}
{{- end }}
{{- end }}
{{- end }}

0 comments on commit 4c99b55

Please sign in to comment.