@@ -142,11 +142,13 @@ func (r *Reconciler) generateClusterPrimaryService(
142142 service .Spec .ClusterIP = corev1 .ClusterIPNone
143143 service .Spec .Selector = nil
144144
145+ appProtocol := naming .AppProtocolTCP
145146 service .Spec .Ports = []corev1.ServicePort {{
146147 Name : naming .PortPostgreSQL ,
147148 Port : * cluster .Spec .Port ,
148149 Protocol : corev1 .ProtocolTCP ,
149150 TargetPort : intstr .FromString (naming .PortPostgreSQL ),
151+ AppProtocol : & appProtocol ,
150152 }}
151153
152154 // Resolve to the ClusterIP for which Patroni has configured the Endpoints.
@@ -220,11 +222,13 @@ func (r *Reconciler) generateClusterReplicaService(
220222 // The TargetPort must be the name (not the number) of the PostgreSQL
221223 // ContainerPort. This name allows the port number to differ between Pods,
222224 // which can happen during a rolling update.
225+ appProtocol := naming .AppProtocolTCP
223226 service .Spec .Ports = []corev1.ServicePort {{
224227 Name : naming .PortPostgreSQL ,
225228 Port : * cluster .Spec .Port ,
226229 Protocol : corev1 .ProtocolTCP ,
227230 TargetPort : intstr .FromString (naming .PortPostgreSQL ),
231+ AppProtocol : & appProtocol ,
228232 }}
229233
230234 err := errors .WithStack (r .setControllerReference (cluster , service ))
0 commit comments