[bitnami/kafka] Add external connection to cluster LB (#3343)

* Add external connection to cluster LB

Signed-off-by: joancafom <jcarmona@bitnami.com>

* Chart version bump

* Document the change in Upgrading section

Co-authored-by: Carlos Rodríguez Hernández <carlosrh@vmware.com>
This commit is contained in:
Jose Antonio Carmona
2020-08-07 12:23:07 +02:00
committed by GitHub
co-authored by Carlos Rodríguez Hernández
parent 87e6ea49e4
commit 5e38c481eb
5 changed files with 36 additions and 7 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
apiVersion: v1
name: kafka
version: 11.7.3
version: 11.8.0
appVersion: 2.6.0
description: Apache Kafka is a distributed streaming platform.
keywords:
+12 -2
View File
@@ -161,8 +161,10 @@ The following tables lists the configurable parameters of the Kafka chart and th
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
| `service.type` | Kubernetes Service type | `ClusterIP` |
| `service.port` | Kafka port for client connections | `9092` |
| `service.internalPort` | Kafka port for inter-broker connectionsKafka port for inter-broker connections | `9093` |
| `service.nodePort` | Nodeport for client connections | `""` |
| `service.internalPort` | Kafka port for inter-broker connections | `9093` |
| `service.externalPort` | Kafka port for external connections | `9094` |
| `service.nodePorts.client` | Nodeport for client connections | `""` |
| `service.nodePorts.external` | Nodeport for external connections | `""` |
| `service.loadBalancerIP` | loadBalancerIP for Kafka Service | `nil` |
| `service.loadBalancerSourceRanges` | Address(es) that are allowed when service is LoadBalancer | `[]` |
| `service.annotations` | Service annotations | `{}`(evaluated as a template) |
@@ -523,6 +525,8 @@ Note: You need to know in advance the node ports that will be exposed so each Ka
The pod will try to get the external ip of the node using `curl -s https://ipinfo.io/ip` unless `externalAccess.service.domain` is provided.
Following the aforementioned steps will also allow to connect the brokers from the outside using the cluster's default service (when `service.type` is `LoadBalancer` or `NodePort`). Use the property `service.externalPort` to specify the port used for external connections.
### Sidecars
If you have a need for additional containers to run within the same pod as Kafka (e.g. an additional metrics or logging exporter), you can do so via the `sidecars` config parameter. Simply define your container according to the Kubernetes container spec.
@@ -631,6 +635,12 @@ You can enable this initContainer by setting `volumePermissions.enabled` to `tru
## Upgrading
### To 11.8.0
External access to brokers can now be achived through the cluster's Kafka service.
- `service.nodePort` -> deprecated in favor of `service.nodePorts.client` and `service.nodePorts.external`
### To 11.7.0
The way to configure the users and passwords changed. Now it is allowed to create multiple users during the installation by providing the list of users and passwords.
+11 -2
View File
@@ -31,10 +31,19 @@ spec:
port: {{ .Values.service.port }}
protocol: TCP
targetPort: kafka-client
{{- if and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (not (empty .Values.service.nodePort)) }}
nodePort: {{ .Values.service.nodePort }}
{{- if and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (not (empty .Values.service.nodePorts.client)) }}
nodePort: {{ .Values.service.nodePorts.client }}
{{- else if eq .Values.service.type "ClusterIP" }}
nodePort: null
{{- end }}
{{- if and .Values.externalAccess.enabled (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) }}
- name: tcp-external
port: {{ .Values.service.externalPort }}
protocol: TCP
targetPort: kafka-external
{{- if (not (empty .Values.service.nodePorts.external)) }}
nodePort: {{ .Values.service.nodePorts.external }}
{{- end }}
{{- end }}
selector: {{- include "kafka.matchLabels" . | nindent 4 }}
app.kubernetes.io/component: kafka
+6 -1
View File
@@ -474,10 +474,15 @@ service:
## Kafka port for inter-broker connections
##
internalPort: 9093
## Kafka port for external connections
##
externalPort: 9094
## Specify the nodePort value for the LoadBalancer and NodePort service types.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
##
nodePort: ""
nodePorts:
client: ""
external: ""
## Set the LoadBalancer service type to internal only.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
##
+6 -1
View File
@@ -479,10 +479,15 @@ service:
## Kafka port for inter-broker connections
##
internalPort: 9093
## Kafka port for external connections
##
externalPort: 9094
## Specify the nodePort value for the LoadBalancer and NodePort service types.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
##
nodePort: ""
nodePorts:
client: ""
external: ""
## Set the LoadBalancer service type to internal only.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
##