Skip to content

Commit

Permalink
adding appProtocol as an option in listeners admin configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
lemonprogis authored and RafalKorepta committed Aug 9, 2024
1 parent db92933 commit cf51815
Show file tree
Hide file tree
Showing 9 changed files with 1,623 additions and 94 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
`statefulset.podTemplate.spec.securityContext` and
`statefulset.podTemplate.spec.containers[*].securityContext` may be used to
set/override the pod and container security contexts respectively.
* `appProtocol` added to the `listeners.admin` configuration
#### Changed
* The container name of the post-upgrade job is now statically set to
`post-upgrade` to facilitate strategic merge patching.
Expand Down
12 changes: 7 additions & 5 deletions charts/redpanda/service_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,16 @@ func ServiceInternal(dot *helmette.Dot) *corev1.Service {
// the stateful set and allow the serviceMonitor to target the pods.
// This service should not be used by any client application.
values := helmette.Unwrap[Values](dot.Values)

ports := []corev1.ServicePort{}

ports = append(ports, corev1.ServicePort{
Name: "admin",
Protocol: "TCP",
Port: values.Listeners.Admin.Port,
TargetPort: intstr.FromInt32(values.Listeners.Admin.Port),
Name: "admin",
Protocol: "TCP",
AppProtocol: values.Listeners.Admin.AppProtocol,
Port: values.Listeners.Admin.Port,
TargetPort: intstr.FromInt32(values.Listeners.Admin.Port),
})

if values.Listeners.HTTP.Enabled {
ports = append(ports, corev1.ServicePort{
Name: "http",
Expand Down
2 changes: 1 addition & 1 deletion charts/redpanda/templates/_service.internal.go.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{{- $_is_returning := false -}}
{{- $values := $dot.Values.AsMap -}}
{{- $ports := (list ) -}}
{{- $ports = (concat (default (list ) $ports) (list (mustMergeOverwrite (dict "port" 0 "targetPort" 0 ) (dict "name" "admin" "protocol" "TCP" "port" ($values.listeners.admin.port | int) "targetPort" ($values.listeners.admin.port | int) )))) -}}
{{- $ports = (concat (default (list ) $ports) (list (mustMergeOverwrite (dict "port" 0 "targetPort" 0 ) (dict "name" "admin" "protocol" "TCP" "appProtocol" $values.listeners.admin.appProtocol "port" ($values.listeners.admin.port | int) "targetPort" ($values.listeners.admin.port | int) )))) -}}
{{- if $values.listeners.http.enabled -}}
{{- $ports = (concat (default (list ) $ports) (list (mustMergeOverwrite (dict "port" 0 "targetPort" 0 ) (dict "name" "http" "protocol" "TCP" "port" ($values.listeners.http.port | int) "targetPort" ($values.listeners.http.port | int) )))) -}}
{{- end -}}
Expand Down
Loading

0 comments on commit cf51815

Please sign in to comment.