Skip to content

Commit

Permalink
Add support for custom annotations on headless service (helm#7086)
Browse files Browse the repository at this point in the history
* Add support for custom annotations & targetPort on the Kafka headless service

* Add docs for headless.

* Add missing starting space in comment
  • Loading branch information
Chris Vest authored and k8s-ci-robot committed Aug 8, 2018
1 parent eb70660 commit 1b3c4eb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion incubator/kafka/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
description: Apache Kafka is publish-subscribe messaging rethought as a distributed
commit log.
name: kafka
version: 0.8.5
version: 0.8.6
appVersion: 4.1.1
keywords:
- kafka
Expand Down
3 changes: 3 additions & 0 deletions incubator/kafka/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ following configurable parameters:
| `schedulerName` | Name of Kubernetes scheduler (other than the default) | `nil` |
| `affinity` | Defines affinities and anti-affinities for pods as defined in: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity preferences | `{}` |
| `tolerations` | List of node tolerations for the pods. https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ | `[]` |
| `headless.annotations` | List of annotations for the headless service. https://kubernetes.io/docs/concepts/services-networking/service/#headless-services | `[]` |
| `headless.targetPort` | Target port to be used for the headless service. This is not a required value. | `nil` |
| `headless.port` | Port to be used for the headless service. https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ | `9092` |
| `external.enabled` | If True, exposes Kafka brokers via NodePort (PLAINTEXT by default) | `false` |
| `external.servicePort` | TCP port configured at external services (one per pod) to relay from NodePort to the external listener port. | '19092' |
| `external.firstListenerPort` | TCP port which is added pod index number to arrive at the port used for NodePort and external listener port. | '31090' |
Expand Down
8 changes: 7 additions & 1 deletion incubator/kafka/templates/service-headless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@ metadata:
heritage: {{ .Release.Service }}
annotations:
service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
{{- if .Values.headless.annotations }}
{{ .Values.headless.annotations | toYaml | trimSuffix "\n" | indent 4 }}
{{- end }}
spec:
ports:
- name: broker
port: 9092
port: {{ .Values.headless.port }}
{{- if .Values.headless.targetPort }}
targetPort: {{ .Values.headless.targetPort }}
{{- end }}
clusterIP: None
selector:
app: {{ include "kafka.name" . }}
Expand Down
7 changes: 7 additions & 0 deletions incubator/kafka/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ tolerations: []
# value: "value"
# effect: "NoSchedule"

## Headless service.
##
headless:
# annotations:
# targetPort:
port: 9092

## External access.
##
external:
Expand Down

0 comments on commit 1b3c4eb

Please sign in to comment.