Skip to content

Commit 8a2148c

Browse files
authored
feat: support service application protocol (#86)
This change adds support for `service.appProtocol` and `metrics.service.appProtocol` which allow users to specify the application protocol for the service port. This is useful for certain scenarios where the application protocol needs to be explicitly defined, such as when using Istio. Link: https://kubernetes.io/docs/concepts/services-networking/service/#application-protocol Signed-off-by: Tais P. Hansen <[email protected]>
1 parent f888623 commit 8a2148c

File tree

5 files changed

+18
-0
lines changed

5 files changed

+18
-0
lines changed

valkey/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ auth:
137137
| metrics.service.extraLabels | object | `{}` | |
138138
| metrics.service.ports.http | int | `9121` | |
139139
| metrics.service.type | string | `"ClusterIP"` | |
140+
| metrics.service.appProtocol | string | `""` | |
140141
| metrics.serviceMonitor.additionalLabels | object | `{}` | |
141142
| metrics.serviceMonitor.annotations | object | `{}` | |
142143
| metrics.serviceMonitor.enabled | bool | `false` | |
@@ -170,6 +171,7 @@ auth:
170171
| service.nodePort | int | `0` | |
171172
| service.port | int | `6379` | |
172173
| service.type | string | `"ClusterIP"` | |
174+
| service.appProtocol | string | `""` | |
173175
| serviceAccount.annotations | object | `{}` | |
174176
| serviceAccount.automount | bool | `false` | |
175177
| serviceAccount.create | bool | `true` | |

valkey/templates/metrics-svc.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ spec:
2121
port: {{ .Values.metrics.service.ports.http }}
2222
protocol: TCP
2323
targetPort: metrics
24+
{{- if .Values.metrics.service.appProtocol }}
25+
appProtocol: {{ .Values.metrics.service.appProtocol }}
26+
{{- end }}
2427
selector:
2528
{{- include "valkey.selectorLabels" . | nindent 4 }}
2629
{{- end }}

valkey/templates/service.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,8 @@ spec:
2121
{{- if and (eq .Values.service.type "NodePort") .Values.service.nodePort }}
2222
nodePort: {{ .Values.service.nodePort }}
2323
{{- end }}
24+
{{- if .Values.service.appProtocol }}
25+
appProtocol: {{ .Values.service.appProtocol }}
26+
{{- end }}
2427
selector:
2528
{{- include "valkey.selectorLabels" . | nindent 4 }}

valkey/values.schema.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@
191191
},
192192
"extraLabels": {
193193
"type": "object"
194+
},
195+
"appProtocol": {
196+
"type": "string"
194197
}
195198
}
196199
},
@@ -381,6 +384,9 @@
381384
},
382385
"clusterIP": {
383386
"type": "string"
387+
},
388+
"appProtocol": {
389+
"type": "string"
384390
}
385391
}
386392
},

valkey/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ service:
6969
nodePort: 0
7070
# ClusterIP value
7171
clusterIP: ""
72+
# Application protocol
73+
appProtocol: ""
7274

7375
# Network policy to control traffic to the pods
7476
# More info: https://kubernetes.io/docs/concepts/services-networking/network-policies/
@@ -268,6 +270,8 @@ metrics:
268270
# Optional labels for the metrics exporter service
269271
extraLabels: {}
270272
# ServiceMonitor configuration for Prometheus Operator
273+
# Application protocol
274+
appProtocol: ""
271275
serviceMonitor:
272276
# Enable ServiceMonitor resource for scraping service metrics
273277
enabled: false

0 commit comments

Comments
 (0)