-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
320 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: v2 | ||
name: kafka-proxy | ||
version: 0.0.1 | ||
appVersion: 0.3.0 | ||
description: Deploying the grepplabs kafka-proxy as a StatefulSet | ||
home: https://github.com/grepplabs/kafka-proxy | ||
sources: | ||
- https://github.com/grepplabs/kafka-proxy | ||
- https://github.com/ricardo-ch/helm-charts/tree/main/charts/kafka-proxy | ||
maintainers: | ||
- name: ricardo-ch | ||
email: [email protected] | ||
keywords: | ||
- kafka-proxy | ||
annotations: | ||
artifacthub.io/changes: | | ||
- Initial release | ||
artifacthub.io/images: | | ||
- name: kafka-proxy | ||
image: grepplabs/kafka-proxy:v0.3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# 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) | ||
|
||
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. | ||
|
||
## Helm Chart | ||
|
||
### How To Install | ||
|
||
Simply add this Chart repository to Helm: | ||
|
||
```sh | ||
➜ helm repo add ricardo https://ricardo-ch.github.io/helm-charts/ | ||
"ricardo" has been added to your repositories | ||
``` | ||
|
||
## 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 | | ||
| 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 | | ||
| podAnnotations."prometheus.io/port" | string | `"9399"` | Set a Prometheus scrape port | | ||
| podAnnotations."prometheus.io/scrape" | string | `"true"` | Set a flag to mark pod for scrapping | | ||
| pullPolicy | string | `"IfNotPresent"` | Kubernetes PullPolicy | | ||
| 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 | | ||
|
||
## Source Code | ||
|
||
* <https://github.com/grepplabs/kafka-proxy> | ||
* <https://github.com/ricardo-ch/helm-charts/tree/main/charts/kafka-proxy> | ||
|
||
---------------------------------------------- | ||
Autogenerated from chart metadata using [helm-docs v1.6.0](https://github.com/norwoodj/helm-docs/releases/v1.6.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# PromLens | ||
|
||
{{ template "chart.deprecationWarning" . }} | ||
|
||
{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }}![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. | ||
|
||
## Helm Chart | ||
|
||
### How To Install | ||
|
||
Simply add this Chart repository to Helm: | ||
|
||
```sh | ||
➜ helm repo add ricardo https://ricardo-ch.github.io/helm-charts/ | ||
"ricardo" has been added to your repositories | ||
``` | ||
|
||
{{ template "chart.valuesSection" . }} | ||
|
||
{{ template "chart.sourcesSection" . }} | ||
|
||
{{ template "helm-docs.versionFooter" . }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "kafka-proxy.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "kafka-proxy.fullname" -}} | ||
{{- if .Values.fullnameOverride -}} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- if contains $name .Release.Name -}} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "kafka-proxy.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ include "kafka-proxy.fullname" . }}-config | ||
labels: | ||
app.kubernetes.io/name: {{ include "kafka-proxy.name" . }} | ||
helm.sh/chart: {{ include "kafka-proxy.chart" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
type: Opaque | ||
data: | ||
jaas.config: {{ .Values.config.kafkaClient.jaas | b64enc | quote }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "kafka-proxy.fullname" . }} | ||
labels: | ||
app.kubernetes.io/name: {{ include "kafka-proxy.name" . }} | ||
helm.sh/chart: {{ include "kafka-proxy.chart" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
spec: | ||
type: NodePort | ||
ports: | ||
{{- range $index, $broker := .Values.config.kafkaClient.brokers }} | ||
- name: kafka-{{ add $index}} | ||
nodePort: {{ add 32400 $index }} | ||
port: {{ add 32400 $index }} | ||
targetPort: {{ add 32400 $index }} | ||
{{- end }} | ||
- name: metrics | ||
nodePort: 32480 | ||
port: 9080 | ||
targetPort: 9080 | ||
selector: | ||
app.kubernetes.io/name: {{ include "kafka-proxy.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: {{ include "kafka-proxy.fullname" . }} | ||
labels: | ||
app.kubernetes.io/name: {{ include "kafka-proxy.name" . }} | ||
helm.sh/chart: {{ include "kafka-proxy.chart" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
release: production | ||
spec: | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: {{ include "kafka-proxy.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
replicas: {{ .Values.replicaCount }} | ||
serviceName: {{ include "kafka-proxy.name" . }} | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: {{ include "kafka-proxy.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
annotations: | ||
{{- with .Values.podAnnotations }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
spec: | ||
containers: | ||
- name: {{ include "kafka-proxy.name" . }} | ||
image: "{{ .Values.image }}:{{ .Values.version }}" | ||
args: | ||
- 'server' | ||
- '--log-format=json' | ||
{{- range $index, $broker := .Values.config.kafkaClient.brokers }} | ||
- '--bootstrap-server-mapping={{ $broker }},0.0.0.0:{{ add 32400 $index}}{{ if ne $index 0}},$(MY_POD_IP):{{ add 32400 $index }}{{ end }}' | ||
{{- end }} | ||
- '--tls-enable' | ||
- '--sasl-enable' | ||
- '--sasl-plugin-mechanism=PLAIN' | ||
- '--sasl-jaas-config-file=/var/run/secret/jaas.config' | ||
- '--proxy-request-buffer-size=32768' | ||
- '--proxy-response-buffer-size=32768' | ||
- '--proxy-listener-read-buffer-size=32768' | ||
- '--proxy-listener-write-buffer-size=131072' | ||
- '--kafka-connection-read-buffer-size=131072' | ||
- '--kafka-connection-write-buffer-size=32768' | ||
env: | ||
- name: MY_POD_IP | ||
valueFrom: | ||
fieldRef: | ||
apiVersion: v1 | ||
fieldPath: status.podIP | ||
volumeMounts: | ||
- name: "proxy-config" | ||
mountPath: "/var/run/secret" | ||
ports: | ||
- name: metrics | ||
containerPort: 9080 | ||
{{- range $index, $broker := .Values.config.brokers }} | ||
- name: kafka-{{ add $index }} | ||
containerPort: {{ add 32400 $index }} | ||
{{- end }} | ||
livenessProbe: | ||
httpGet: | ||
path: /health | ||
port: 9080 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 3 | ||
readinessProbe: | ||
httpGet: | ||
path: /health | ||
port: 9080 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 10 | ||
timeoutSeconds: 5 | ||
successThreshold: 2 | ||
failureThreshold: 5 | ||
resources: | ||
{{ toYaml .Values.resources | indent 12 }} | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{ toYaml . | indent 8 }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{ toYaml . | indent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{ toYaml . | indent 8 }} | ||
{{- end }} | ||
restartPolicy: Always | ||
volumes: | ||
- name: proxy-config | ||
secret: | ||
secretName: {{ include "kafka-proxy.fullname" . }}-config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# -- Number of replicas | ||
replicaCount: 1 | ||
# -- Kafka-proxy Container Image | ||
image: "grepplabs/kafka-proxy" | ||
# -- Kafka-proxy Container Image Version | ||
version: "v0.3.0" | ||
# -- Kubernetes PullPolicy | ||
pullPolicy: IfNotPresent | ||
|
||
# -- Set kubernetes specific resource limits | ||
resources: {} | ||
# requests: | ||
# memory: 128Mi | ||
# cpu: 1000m | ||
# limits: | ||
# cpu: 2000m | ||
# memory: 256Mi | ||
|
||
# -- Set a pod annotations | ||
podAnnotations: | ||
# -- Set a Prometheus scrape port | ||
prometheus.io/port: "9399" | ||
# -- Set a flag to mark pod for scrapping | ||
prometheus.io/scrape: "true" | ||
|
||
# -- A toleration | ||
tolerations: [] | ||
# - key: "test" | ||
# operator: "Exists" | ||
# effect: "NoSchedule" | ||
|
||
# -- A node selector label | ||
nodeSelector: {} | ||
|
||
# -- Node affinity configuration | ||
affinity: {} | ||
|
||
config: | ||
# -- Kafka client configuration | ||
kafkaClient: | ||
jaas: org.apache.kafka.common.security.plain.PlainLoginModule required username="username" password="password"; | ||
brokers: | ||
- kafka-0:9092 | ||
- kafka-1:9092 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.