Skip to content

Commit

Permalink
Increase configurability for Service in daemonset chart (closes #63)
Browse files Browse the repository at this point in the history
  • Loading branch information
jparavisini committed Sep 29, 2022
1 parent be85ffe commit ed21199
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 3 additions & 1 deletion charts/daemonset/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ helm delete daemonset
| hostPaths | list | `[]` | List of host paths to mount to the deployment |
| resources | object | `{}` | Map of resource constraints for the service |
| terminationGracePeriodSeconds | int | `60` | Grace period for termination of the service |
| service.deploy | bool | `true` | Whether to setup service bindings (note: only NodePort is supported) |
| service.deploy | bool | `true` | Whether to setup service bindings |
| service.type | string | `"NodePort"` | Configures ServiceType for this service |
| service.name | string | `"http"` | Prefix of port name for service (appended with '-port') |
| service.port | int | `8000` | Port to bind and expose the service on |
| service.targetPort | int | `80` | The Target Port that the actual application is being exposed on |
| service.protocol | string | `"TCP"` | Protocol that the service leverages (note: TCP or UDP) |
Expand Down
8 changes: 6 additions & 2 deletions charts/daemonset/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ apiVersion: v1
kind: Service
metadata:
name: {{ include "app.fullname" . }}
labels:
{{- range $k, $v := .Values.service.labels }}
{{ $k }}: {{ $v }}
{{- end }}
spec:
type: NodePort
type: {{ .Values.service.type }}
selector:
app: {{ include "app.fullname" . }}
ports:
- name: http-port
- name: {{ .Values.service.name }}-port
port: {{ .Values.service.port }}
protocol: {{ .Values.service.protocol }}
targetPort: {{ .Values.service.targetPort }}
Expand Down
5 changes: 4 additions & 1 deletion charts/daemonset/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@ resources: {}
terminationGracePeriodSeconds: 60

service:
# -- Whether to setup service bindings (note: only NodePort is supported)
deploy: true
# -- Whether to setup service bindings
type: NodePort
# -- Name of service
name: "http"
# -- Port to bind and expose the service on
port: 8000
# -- The Target Port that the actual application is being exposed on
Expand Down

0 comments on commit ed21199

Please sign in to comment.