-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add in kafdrop helm subchart for alert-stream-broker and enable value…
…s for usdf-dev-alert-stream-broker. Add kafdrop kafa user template. The usdf-dev-alert-stream-broker is connecting to the external bootstrap because TLS is disabled for that listener.
- Loading branch information
Showing
15 changed files
with
414 additions
and
0 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,7 @@ | ||
apiVersion: v2 | ||
name: kafdrop | ||
version: 1.0.0 | ||
description: A subchart to deploy the Kafdrop UI for Sasquatch. | ||
sources: | ||
- https://github.com/obsidiandynamics/kafdrop | ||
appVersion: 3.30.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,36 @@ | ||
# kafdrop | ||
|
||
A subchart to deploy the Kafdrop UI for Sasquatch. | ||
|
||
## Source Code | ||
|
||
* <https://github.com/obsidiandynamics/kafdrop> | ||
|
||
## Values | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
| affinity | object | `{}` | Affinity configuration | | ||
| cmdArgs | string | See `values.yaml` | Command line arguments to Kafdrop | | ||
| existingSecret | string | Do not use a secret | Existing Kubernetes secrect use to set kafdrop environment variables. Set `SCHEMAREGISTRY_AUTH` for basic auth credentials in the form `<username>:<password>` | | ||
| host | string | `"localhost"` | The hostname to report for the RMI registry (used for JMX) | | ||
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy | | ||
| image.repository | string | `"obsidiandynamics/kafdrop"` | Kafdrop Docker image repository | | ||
| image.tag | string | `"4.0.1"` | Kafdrop image version | | ||
| ingress.annotations | object | `{}` | Additional ingress annotations | | ||
| ingress.enabled | bool | `false` | Whether to enable the ingress | | ||
| ingress.hostname | string | None, must be set if ingress is enabled | Ingress hostname | | ||
| ingress.path | string | `"/kafdrop"` | Ingress path | | ||
| jmx.port | int | `8686` | Port to use for JMX. If unspecified, JMX will not be exposed. | | ||
| jvm.opts | string | `""` | JVM options | | ||
| kafka.broker | string | `""` | Bootstrap list of Kafka host/port pairs | | ||
| nodeSelector | object | `{}` | Node selector configuration | | ||
| podAnnotations | object | `{}` | Pod annotations | | ||
| replicaCount | int | `1` | Number of kafdrop pods to run in the deployment. | | ||
| resources | object | See `values.yaml` | Kubernetes requests and limits for Kafdrop | | ||
| schemaregistry | string | `""` | The endpoint of Schema Registry | | ||
| server.port | int | `9000` | The web server port to listen on | | ||
| server.servlet.contextPath | string | `"/kafdrop"` | The context path to serve requests on | | ||
| service.annotations | object | `{}` | Additional annotations to add to the service | | ||
| service.port | int | `9000` | Service port | | ||
| tolerations | list | `[]` | Tolerations configuration | |
9 changes: 9 additions & 0 deletions
9
applications/alert-stream-broker/charts/kafdrop/templates/NOTES.txt
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,9 @@ | ||
1. Get the application URL by running these commands: | ||
{{- if .Values.ingress.enabled }} | ||
{{- range .Values.ingress.hosts }} | ||
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }} | ||
{{- end }} | ||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "chart.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") | ||
echo "Visit http://127.0.0.1:8080 to use your application" | ||
kubectl port-forward $POD_NAME 8080:80 | ||
{{- end }} |
52 changes: 52 additions & 0 deletions
52
applications/alert-stream-broker/charts/kafdrop/templates/_helpers.tpl
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,52 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "chart.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 "chart.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 "chart.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "kafdrop.labels" -}} | ||
helm.sh/chart: {{ include "chart.name" . }} | ||
{{ include "kafdrop.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "kafdrop.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "chart.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} |
95 changes: 95 additions & 0 deletions
95
applications/alert-stream-broker/charts/kafdrop/templates/deployment.yaml
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,95 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "chart.fullname" . }} | ||
labels: | ||
{{- include "kafdrop.labels" . | nindent 4 }} | ||
spec: | ||
replicas: {{ .Values.replicaCount }} | ||
selector: | ||
matchLabels: | ||
{{- include "kafdrop.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
labels: | ||
{{- include "kafdrop.selectorLabels" . | nindent 8 }} | ||
annotations: | ||
{{- with .Values.podAnnotations }} | ||
{{ toYaml . | indent 8 }} | ||
{{- end }} | ||
spec: | ||
automountServiceAccountToken: false | ||
securityContext: | ||
runAsNonRoot: true | ||
runAsUser: 1000 | ||
runAsGroup: 1000 | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
drop: | ||
- ALL | ||
{{- if .Values.existingSecret -}} | ||
envFrom: | ||
- secretRef: | ||
name: {{ .Values.existingSecret }} | ||
{{- end }} | ||
env: | ||
- name: KAFKA_BROKERCONNECT | ||
value: {{ .Values.kafka.broker | quote }} | ||
- name: JVM_OPTS | ||
value: {{ .Values.jvm.opts | quote }} | ||
- name: HOST | ||
value: {{ .Values.host | quote }} | ||
- name: JMX_PORT | ||
value: {{ .Values.jmx.port | quote }} | ||
- name: SERVER_SERVLET_CONTEXTPATH | ||
value: {{ .Values.server.servlet.contextPath | trimSuffix "/" | quote }} | ||
- name: SERVER_PORT | ||
value: {{ .Values.server.port | quote }} | ||
- name: CMD_ARGS | ||
value: {{ .Values.cmdArgs | quote }} | ||
- name: SCHEMAREGISTRY_CONNECT | ||
value: {{ .Values.schemaregistry | quote }} | ||
- name: KAFKA_PROPERTIES_FILE | ||
value: "/tmp/kafka.properties" | ||
- name: KAFKA_PROPERTIES | ||
valueFrom: | ||
secretKeyRef: | ||
name: alert-stream-broker-secrets | ||
key: kafdrop-kafka-properties | ||
ports: | ||
- name: http | ||
containerPort: {{ .Values.server.port }} | ||
protocol: TCP | ||
livenessProbe: | ||
httpGet: | ||
path: "{{ .Values.server.servlet.contextPath | trimSuffix "/" }}/actuator/health" | ||
port: http | ||
initialDelaySeconds: 180 | ||
periodSeconds: 30 | ||
timeoutSeconds: 10 | ||
readinessProbe: | ||
httpGet: | ||
path: "{{ .Values.server.servlet.contextPath | trimSuffix "/" }}/actuator/health" | ||
port: http | ||
initialDelaySeconds: 20 | ||
periodSeconds: 5 | ||
timeoutSeconds: 10 | ||
resources: | ||
{{- toYaml .Values.resources | nindent 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 }} |
27 changes: 27 additions & 0 deletions
27
applications/alert-stream-broker/charts/kafdrop/templates/ingress.yaml
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,27 @@ | ||
{{- if .Values.ingress.enabled -}} | ||
{{- $fullName := include "chart.fullname" . -}} | ||
{{- $ingressPath := .Values.ingress.path -}} | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: {{ $fullName }} | ||
labels: | ||
{{- include "kafdrop.labels" . | nindent 4 }} | ||
annotations: | ||
{{- with .Values.ingress.annotations }} | ||
{{ toYaml . | indent 4 }} | ||
{{- end }} | ||
spec: | ||
ingressClassName: "nginx" | ||
rules: | ||
- host: {{ .Values.ingress.hostname | quote }} | ||
http: | ||
paths: | ||
- path: {{ $ingressPath }} | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: {{ $fullName }} | ||
port: | ||
number: {{ .Values.service.port }} | ||
{{- end }} |
15 changes: 15 additions & 0 deletions
15
applications/alert-stream-broker/charts/kafdrop/templates/service.yaml
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,15 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "chart.fullname" . }} | ||
labels: | ||
{{- include "kafdrop.labels" . | nindent 4 }} | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- port: {{ .Values.service.port }} | ||
targetPort: http | ||
protocol: TCP | ||
name: http | ||
selector: | ||
{{- include "kafdrop.selectorLabels" . | nindent 4 }} |
Oops, something went wrong.