confluentinc / confluentinc/confluent-kubernetes-examples
Set appProtocol for service resources (compatibility with service mesh)
- Dominant language
- Shell
- Stars
- 72
- Forks
- 202
- Avg merge
- 10h 2m
- Merged PRs (30d)
- 2
Description
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](https://www.iana.org/assignments/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.
```yaml
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
```
```yaml
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
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Search the repository for Service manifests and the operator's CRD or service templates, then inspect how Kafka and ZooKeeper ports are defined. Done means relevant generated Service ports expose the intended appProtocol values or a documented customization path, with examples matching the requested protocols.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kubernetes
- Domain
- infrastructure
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100