Skip to content

Commit

Permalink
Add dynamic application.server config to streams app chart (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp94831 authored Jun 12, 2024
1 parent 2880ef1 commit 14827e7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
10 changes: 5 additions & 5 deletions charts/streams-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ Alternatively, a YAML file that specifies the values for the parameters can be p

### Service

| Parameter | Description | Default |
| ----------------- | ---------------------------------------------------------------------------------------------- | ----------- |
| `service.enabled` | Whether to create a service. This requires the definition of at least one `ports.servicePort`. | `false` |
| `service.labels` | Additional service labels. | `{}` |
| `service.type` | Service type. | `ClusterIP` |
| Parameter | Description | Default |
|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------|
| `service.enabled` | Whether to create a service. This requires the definition of at least one `ports.servicePort`. This also configures `application.server` for the streams app | `false` |
| `service.labels` | Additional service labels. | `{}` |
| `service.type` | Service type. | `ClusterIP` |
10 changes: 10 additions & 0 deletions charts/streams-app/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@ spec:
- name: {{ printf "STREAMS_%s" $key | replace "." "_" | upper | quote }}
value: {{ $value | quote }}
{{- end }}
{{- range .Values.ports }}
{{- if .servicePort }} # TODO verify that there is at most one service port. Currently, if there are multiple service ports, the first one will be used
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: STREAMS_APPLICATION_SERVER
value: "$(POD_IP):{{ .containerPort }}"
{{- end }}
{{- end }}
{{- if .Values.streams.staticMembership }}
- name: STREAMS_GROUP_INSTANCE_ID
valueFrom:
Expand Down
2 changes: 1 addition & 1 deletion charts/streams-app/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ spec:
protocol: {{ .protocol }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
type: {{ .Values.service.type }}
{{- end }}

0 comments on commit 14827e7

Please sign in to comment.