Set appProtocol for service resources (compatibility with service mesh)
fnkr opened this issue · comments
Hi. Currently there is no way to specify the appProtocol for services created by the operator. Unfortunately Microsoft's service mesh (Open Service Mesh) assumes the appProtocol is HTTP, which breaks Kafka and ZooKeeper. Please add appProtocol to all service ports or offer a way to customize it (e.g. something like podTemplate in the CRD but for the services).
Application protocol
FEATURE STATE: Kubernetes v1.20 [stable]
The
appProtocol
field provides a way to specify an application protocol for each Service port. The value of this field is mirrored by the corresponding Endpoints and EndpointSlice objects.This field follows standard Kubernetes label syntax. Values should either be IANA standard service names or domain prefixed names such as
mycompany.com/my-custom-protocol
.
- Kubernetes docs: https://kubernetes.io/docs/concepts/services-networking/service/#application-protocol
- Open Service Mesh docs: https://release-v1-2.docs.openservicemesh.io/docs/guides/app_onboarding/app_protocol_selection/
e.g.
apiVersion: v1
kind: Service
metadata:
name: kafka
spec:
ports:
- name: external
port: 9092
protocol: tcp
appProtocol: tcp
targetPort: 9092
- name: http-external
port: 8090
protocol: tcp
appProtocol: http
targetPort: 8090
- name: internal
port: 9071
protocol: tcp
appProtocol: tcp
targetPort: 9071
- name: jmx
port: 7203
protocol: tcp
appProtocol: tcp
targetPort: 7203
- name: jolokia
port: 7777
protocol: tcp
appProtocol: http
targetPort: 7777
- name: prometheus
port: 7778
protocol: tcp
appProtocol: http
targetPort: 7778
- name: replication
port: 9072
protocol: tcp
appProtocol: tcp
targetPort: 9072
apiVersion: v1
kind: Service
metadata:
name: zookeeper
spec:
ports:
- name: client
port: 2181
protocol: tcp
appProtocol: tcp
targetPort: 2181
- name: jmx
port: 7203
protocol: tcp
appProtocol: tcp
targetPort: 7203
- name: jolokia
port: 7777
protocol: tcp
appProtocol: http
targetPort: 7777
- name: leader-election
port: 3888
protocol: tcp
appProtocol: tcp
targetPort: 3888
- name: peer
port: 2888
protocol: tcp
appProtocol: tcp
targetPort: 2888
- name: prometheus
port: 7778
protocol: tcp
appProtocol: http
targetPort: 7778