Skip to content

Commit

Permalink
use tcp/udp load balancing from gcp/gke (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
bueti authored Feb 11, 2022
1 parent 7a9c7e5 commit 9c3d23e
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/ct.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
target-branch: main
helm-extra-args: --timeout 300s
check-version-increment: true
excluded-charts: kafka-proxy
10 changes: 5 additions & 5 deletions charts/kafka-proxy/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: kafka-proxy
version: 0.0.1
appVersion: 0.3.0
description: Deploying the grepplabs kafka-proxy as a StatefulSet
version: 0.0.2
appVersion: 0.3.1
description: Deploying the grepplabs kafka-proxy as a StatefulSet with a GKE LoadBalancer
home: https://github.com/grepplabs/kafka-proxy
sources:
- https://github.com/grepplabs/kafka-proxy
Expand All @@ -14,7 +14,7 @@ keywords:
- kafka-proxy
annotations:
artifacthub.io/changes: |
- Initial release
- Use GKE LoadBalancer
artifacthub.io/images: |
- name: kafka-proxy
image: grepplabs/kafka-proxy:v0.3.0
image: grepplabs/kafka-proxy:v0.3.1
10 changes: 7 additions & 3 deletions charts/kafka-proxy/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# PromLens

![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) ![AppVersion: 0.3.0](https://img.shields.io/badge/AppVersion-0.3.0-informational?style=flat-square) ![Release Status](https://github.com/ricardo-ch/helm-charts/workflows/Release%20Charts/badge.svg) [![License](https://img.shields.io/github/license/ricardo-ch/helm-charts)](https://github.com/ricardo-ch/helm-charts/blob/main/LICENSE)
![Version: 0.0.2](https://img.shields.io/badge/Version-0.0.2-informational?style=flat-square) ![AppVersion: 0.3.1](https://img.shields.io/badge/AppVersion-0.3.1-informational?style=flat-square) ![Release Status](https://github.com/ricardo-ch/helm-charts/workflows/Release%20Charts/badge.svg) [![License](https://img.shields.io/github/license/ricardo-ch/helm-charts)](https://github.com/ricardo-ch/helm-charts/blob/main/LICENSE)

This chart installs [kafka-proxy](https://github.com/grepplabs/kafka-proxy).

The Kafka Proxy is based on idea of Cloud SQL Proxy. It allows a service to connect to Kafka brokers without having to deal with SASL/PLAIN authentication and SSL certificates.
The Kafka Proxy is based on the idea of Cloud SQL Proxy. It allows a service to connect to Kafka brokers without having to deal with SASL/PLAIN authentication and SSL certificates.

## Helm Chart

Expand All @@ -17,12 +17,16 @@ Simply add this Chart repository to Helm:
"ricardo" has been added to your repositories
```

This chart expects to run on GKE and makes use of [TCP/UDP load balancing](https://cloud.google.com/kubernetes-engine/docs/how-to/service-parameters).

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | Node affinity configuration |
| config.kafkaClient | object | `{"brokers":["kafka-0:9092","kafka-1:9092"],"jaas":"org.apache.kafka.common.security.plain.PlainLoginModule required username=\"username\" password=\"password\";"}` | Kafka client configuration |
| config.loadBalancerIP | string | `""` | Specifies an IP for the load balancers. If omitted, an ephemeral IP is assigned. |
| config.loadBalancerSourceRanges | list | `["0.0.0.0/0"]` | Configures optional firewall rules in GKE and in the VPC to only allow certain source ranges. If you omit this field, your Service accepts traffic from any IP address (0.0.0.0/0). |
| image | string | `"grepplabs/kafka-proxy"` | Kafka-proxy Container Image |
| nodeSelector | object | `{}` | A node selector label |
| podAnnotations | object | `{"prometheus.io/port":"9399","prometheus.io/scrape":"true"}` | Set a pod annotations |
Expand All @@ -32,7 +36,7 @@ Simply add this Chart repository to Helm:
| replicaCount | int | `1` | Number of replicas |
| resources | object | `{}` | Set kubernetes specific resource limits |
| tolerations | list | `[]` | A toleration |
| version | string | `"v0.3.0"` | Kafka-proxy Container Image Version |
| version | string | `"v0.3.1"` | Kafka-proxy Container Image Version |

## Source Code

Expand Down
4 changes: 3 additions & 1 deletion charts/kafka-proxy/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

This chart installs [kafka-proxy](https://github.com/grepplabs/kafka-proxy).

The Kafka Proxy is based on idea of Cloud SQL Proxy. It allows a service to connect to Kafka brokers without having to deal with SASL/PLAIN authentication and SSL certificates.
The Kafka Proxy is based on the idea of Cloud SQL Proxy. It allows a service to connect to Kafka brokers without having to deal with SASL/PLAIN authentication and SSL certificates.

## Helm Chart

Expand All @@ -19,6 +19,8 @@ Simply add this Chart repository to Helm:
"ricardo" has been added to your repositories
```

This chart expects to run on GKE and makes use of [TCP/UDP load balancing](https://cloud.google.com/kubernetes-engine/docs/how-to/service-parameters).

{{ template "chart.valuesSection" . }}

{{ template "chart.sourcesSection" . }}
Expand Down
9 changes: 8 additions & 1 deletion charts/kafka-proxy/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ metadata:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
type: NodePort
type: LoadBalancer
loadBalancerSourceRanges:
{{- range .Values.config.loadBalancerSourceRanges }}
- {{ . | title | quote }}
{{- end }}
{{- if .Values.config.loadBalancerIP }}
loadBalancerIP: {{ .Values.config.loadBalancerIP }}
{{- end }}
ports:
{{- range $index, $broker := .Values.config.kafkaClient.brokers }}
- name: kafka-{{ add $index}}
Expand Down
7 changes: 6 additions & 1 deletion charts/kafka-proxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ replicaCount: 1
# -- Kafka-proxy Container Image
image: "grepplabs/kafka-proxy"
# -- Kafka-proxy Container Image Version
version: "v0.3.0"
version: "v0.3.1"
# -- Kubernetes PullPolicy
pullPolicy: IfNotPresent

Expand Down Expand Up @@ -42,3 +42,8 @@ config:
brokers:
- kafka-0:9092
- kafka-1:9092
# -- Specifies an IP for the load balancers. If omitted, an ephemeral IP is assigned.
loadBalancerIP: ""
# -- Configures optional firewall rules in GKE and in the VPC to only allow certain source ranges. If you omit this field, your Service accepts traffic from any IP address (0.0.0.0/0).
loadBalancerSourceRanges:
- 0.0.0.0/0

0 comments on commit 9c3d23e

Please sign in to comment.