diff --git a/charts/streams-app/README.md b/charts/streams-app/README.md index 97e88b36..4698348c 100644 --- a/charts/streams-app/README.md +++ b/charts/streams-app/README.md @@ -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` | diff --git a/charts/streams-app/templates/deployment.yaml b/charts/streams-app/templates/deployment.yaml index 8c6d73fa..5b98e856 100644 --- a/charts/streams-app/templates/deployment.yaml +++ b/charts/streams-app/templates/deployment.yaml @@ -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: diff --git a/charts/streams-app/templates/service.yaml b/charts/streams-app/templates/service.yaml index 0a4588c8..df54dc0a 100644 --- a/charts/streams-app/templates/service.yaml +++ b/charts/streams-app/templates/service.yaml @@ -24,6 +24,6 @@ spec: protocol: {{ .protocol }} {{- end }} {{- end }} - {{- end }} + {{- end }} type: {{ .Values.service.type }} {{- end }}