Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions charts/common/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ spec:
targetPort: {{ .Values.service.internalPort }}
{{- end }}
selector:
{{- if .Values.service.selector }}
{{- toYaml .Values.service.selector | nindent 4 }}
{{- else }}
app: {{ $releaseName }}
{{- end }}
type: ClusterIP
{{- end }}
11 changes: 11 additions & 0 deletions charts/common/tests/service_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,14 @@ tests:
- equal:
path: metadata.name
value: override
- it: can override selector
set:
service:
selector:
traffic-pool: override
asserts:
- equal:
path: spec.selector["traffic-pool"]
value: override
- isNull:
path: spec.selector.app
4 changes: 4 additions & 0 deletions charts/common/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@
"description": "Custom ports spec, overrides default port config",
"items": { "type": "object" },
"type": "array"
},
"selector": {
"description": "Optionally override the Service selector. Defaults to app: <release-name>",
"type": "object"
}
},
"type": "object"
Expand Down
2 changes: 2 additions & 0 deletions charts/common/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ service:
internalPort: 8080
# -- Optionally set annotations for the service
annotations: {}
# -- Optionally override the Service selector. Defaults to app: <release-name>
selector: {}

# -- Takes a list of `container` entries, you must add a `name` field for each entry
containers: []
Expand Down