-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from devops-ia/feat/add-cp-schema-registry
feat: initial cp-schema-registry version
- Loading branch information
Showing
20 changed files
with
1,029 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ jobs: | |
check-latest: true | ||
|
||
- name: Set up chart-testing | ||
uses: helm/chart-testing-action@v2.6.1 | ||
uses: helm/chart-testing-action@v2 | ||
|
||
- name: Run chart-testing (list-changed) | ||
id: list-changed | ||
|
@@ -33,12 +33,12 @@ jobs: | |
- name: Run chart-testing (lint) | ||
if: steps.list-changed.outputs.changed == 'true' | ||
run: ct lint --config .github/ct.yaml --target-branch ${{ github.event.repository.default_branch }} | ||
run: ct lint --config .github/ct.yaml | ||
|
||
- name: Create kind cluster | ||
if: steps.list-changed.outputs.changed == 'true' | ||
uses: helm/[email protected] | ||
|
||
- name: Run chart-testing (install) | ||
if: steps.list-changed.outputs.changed == 'true' | ||
run: ct install --config .github/ct.yaml --target-branch ${{ github.event.repository.default_branch }} | ||
run: ct install --config .github/ct.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
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,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
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,19 @@ | ||
apiVersion: v2 | ||
name: cp-schema-registry | ||
description: A Helm chart with cp-schema-registry for Kubernetes | ||
type: application | ||
maintainers: | ||
- name: ialejandro | ||
email: [email protected] | ||
url: https://ialejandro.rocks | ||
sources: | ||
- https://github.com/devops-ia/helm-charts/cp-schema-registry | ||
- https://github.com/m-lab/prometheus-bigquery-exporter | ||
version: 1.0.0 | ||
appVersion: 7.4.6 | ||
home: https://github.com/devops-ia/helm-charts/cp-schema-registry | ||
keywords: | ||
- cp-schema-registry | ||
- confluent | ||
- kafka | ||
- schema-registry |
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,106 @@ | ||
# cp-schema-registry | ||
|
||
## Motivation | ||
|
||
The original Helm chart for [Confluent Schema Registry](https://github.com/confluentinc/cp-helm-charts/tree/master/charts/cp-schema-registry) has been deprecated, and over time it became too bulky and outdated. That's why I've created a new, lighter, and more up-to-date Helm chart. This new chart is more streamlined and easier to customize. | ||
|
||
Some of the key changes include: | ||
|
||
* Configurations that are compatible with the latest Kubernetes features | ||
* Easier setup, with more modular and flexible options | ||
|
||
A Helm chart with cp-schema-registry for Kubernetes | ||
|
||
## Maintainers | ||
|
||
| Name | Email | Url | | ||
| ---- | ------ | --- | | ||
| ialejandro | <[email protected]> | <https://ialejandro.rocks> | | ||
|
||
## Prerequisites | ||
|
||
* Helm 3+ | ||
|
||
## Add repository | ||
|
||
```console | ||
helm repo add devops-ia https://devops-ia.github.io/helm-charts | ||
helm repo update | ||
``` | ||
|
||
## Install Helm chart (repository mode) | ||
|
||
```console | ||
helm install [RELEASE_NAME] devops-ia/cp-schema-registry | ||
``` | ||
|
||
This install all the Kubernetes components associated with the chart and creates the release. | ||
|
||
_See [helm install](https://helm.sh/docs/helm/helm_install/) for command documentation._ | ||
|
||
## Uninstall Helm chart | ||
|
||
```console | ||
helm uninstall [RELEASE_NAME] | ||
``` | ||
|
||
This removes all the Kubernetes components associated with the chart and deletes the release. | ||
|
||
_See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall/) for command documentation._ | ||
|
||
## Configuration | ||
|
||
See [Customizing the chart before installing](https://helm.sh/docs/intro/using_helm/#customizing-the-chart-before-installing). To see all configurable options with comments: | ||
|
||
```console | ||
helm show values devops-ia/cp-schema-registry | ||
``` | ||
|
||
## Values | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
| affinity | object | `{}` | Affinity for pod assignment </br> Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity | | ||
| autoscaling | object | `{"enabled":false,"maxReplicas":100,"minReplicas":1,"targetCPUUtilizationPercentage":80}` | Autoscaling with CPU or memory utilization percentage </br> Ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ | | ||
| env | object | `{"SCHEMA_REGISTRY_HEAP_OPTS":"-Xms512M -Xmx512M","SCHEMA_REGISTRY_MASTER_ELIGIBILITY":"true"}` | Environment variables to configure application </br> Ref: https://docs.cp-schema-registry.io/latest/deployment/configuration/#platform | | ||
| envFromSecrets | object | `{}` | Secrets from variables | | ||
| fullnameOverride | string | `""` | String to fully override cp-schema-registry.fullname template | | ||
| image | object | `{"pullPolicy":"IfNotPresent","repository":"confluentinc/cp-schema-registry","tag":""}` | Image registry The image configuration for the base service | | ||
| imagePullSecrets | list | `[]` | Global Docker registry secret names as an array | | ||
| ingress | object | `{"annotations":{},"className":"","enabled":false,"hosts":[{"host":"chart-example.local","paths":[{"path":"/","pathType":"ImplementationSpecific"}]}],"tls":[]}` | Ingress configuration to expose app </br> Ref: https://kubernetes.io/docs/concepts/services-networking/ingress/ | | ||
| initContainers | list | `[]` | Configure additional containers </br> Ref: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ | | ||
| livenessProbe | object | `{"enabled":true,"failureThreshold":3,"initialDelaySeconds":180,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":5}` | Configure liveness checker </br> Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-startup-probes | | ||
| livenessProbeCustom | object | `{}` | Custom livenessProbe | | ||
| metrics | object | `{"enabled":false,"exporter":{"enabled":false,"image":{"pullPolicy":"IfNotPresent","repository":"solsson/kafka-prometheus-jmx-exporter@sha256","tag":"6f82e2b0464f50da8104acd7363fb9b995001ddff77d248379f8788e78946143"},"port":5556,"resources":{}},"port":5555}` | Enable metrics | | ||
| metrics.enabled | bool | `false` | Enable or disable | | ||
| metrics.exporter | object | `{"enabled":false,"image":{"pullPolicy":"IfNotPresent","repository":"solsson/kafka-prometheus-jmx-exporter@sha256","tag":"6f82e2b0464f50da8104acd7363fb9b995001ddff77d248379f8788e78946143"},"port":5556,"resources":{}}` | prometheus-jmx-exporter configuration | | ||
| metrics.exporter.enabled | bool | `false` | Enable or disable | | ||
| metrics.exporter.image | object | `{"pullPolicy":"IfNotPresent","repository":"solsson/kafka-prometheus-jmx-exporter@sha256","tag":"6f82e2b0464f50da8104acd7363fb9b995001ddff77d248379f8788e78946143"}` | Image registry The image configuration for the base service | | ||
| metrics.exporter.port | int | `5556` | Expose exporter port | | ||
| metrics.exporter.resources | object | `{}` | Resources limits and requested </br> Ref: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ | | ||
| metrics.port | int | `5555` | Expose metrics port | | ||
| nameOverride | string | `""` | String to partially override cp-schema-registry.fullname template (will maintain the release name) | | ||
| nodeSelector | object | `{}` | Node labels for pod assignment </br> Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector | | ||
| podAnnotations | object | `{}` | Configure annotations on Pods | | ||
| podDisruptionBudget | object | `{"enabled":false,"maxUnavailable":1,"minAvailable":null}` | Pod Disruption Budget </br> Ref: https://kubernetes.io/docs/reference/kubernetes-api/policy-resources/pod-disruption-budget-v1/ | | ||
| podLabels | object | `{}` | Configure labels on Pods | | ||
| podSecurityContext | object | `{}` | Defines privilege and access control settings for a Pod </br> Ref: https://kubernetes.io/docs/concepts/security/pod-security-standards/ </br> Ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ | | ||
| readinessProbe | object | `{"enabled":true,"failureThreshold":3,"initialDelaySeconds":10,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":1}` | Configure readinessProbe checker </br> Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-startup-probes | | ||
| readinessProbeCustom | object | `{}` | Custom readinessProbe | | ||
| replicaCount | int | `1` | Number of replicas Specifies the number of replicas for the service | | ||
| resources | object | `{}` | Resources limits and requested </br> Ref: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ | | ||
| secrets | object | `{}` | Secrets values to create credentials and reference by envFromSecrets Generate Secret with following name: <release-name>-credentials | | ||
| securityContext | object | `{}` | Defines privilege and access control settings for a Container </br> Ref: https://kubernetes.io/docs/concepts/security/pod-security-standards/ </br> Ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ | | ||
| service | object | `{"port":8081,"targetPort":8081,"type":"ClusterIP"}` | Kubernetes service to expose Pod </br> Ref: https://kubernetes.io/docs/concepts/services-networking/service/ | | ||
| service.port | int | `8081` | Kubernetes Service port | | ||
| service.targetPort | int | `8081` | Pod expose port | | ||
| service.type | string | `"ClusterIP"` | Kubernetes Service type. Allowed values: NodePort, LoadBalancer or ClusterIP | | ||
| serviceAccount | object | `{"annotations":{},"automount":true,"create":true,"name":""}` | Enable creation of ServiceAccount | | ||
| serviceMonitor | object | `{"enabled":false,"interval":"30s","metricRelabelings":[],"relabelings":[],"scrapeTimeout":"10s"}` | Enable ServiceMonitor to get metrics </br> Ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#servicemonitor | | ||
| serviceMonitor.enabled | bool | `false` | Enable or disable | | ||
| startupProbe | object | `{"enabled":true,"failureThreshold":30,"initialDelaySeconds":180,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":5}` | Configure startupProbe checker </br> Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-startup-probes | | ||
| startupProbeCustom | object | `{}` | Custom startupProbe | | ||
| testConnection | bool | `false` | Enable or disable test connection | | ||
| tolerations | list | `[]` | Tolerations for pod assignment </br> Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ | | ||
| volumeMounts | list | `[]` | Additional volumeMounts on the output Deployment definition | | ||
| volumes | list | `[]` | Additional volumes on the output Deployment definition | |
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,57 @@ | ||
# {{ template "chart.name" . }} | ||
|
||
## Motivation | ||
|
||
The original Helm chart for [Confluent Schema Registry](https://github.com/confluentinc/cp-helm-charts/tree/master/charts/cp-schema-registry) has been deprecated, and over time it became too bulky and outdated. That's why I've created a new, lighter, and more up-to-date Helm chart. This new chart is more streamlined and easier to customize. | ||
|
||
Some of the key changes include: | ||
|
||
* Configurations that are compatible with the latest Kubernetes features | ||
* Easier setup, with more modular and flexible options | ||
|
||
{{ template "chart.description" . }} | ||
|
||
{{ template "chart.maintainersSection" . }} | ||
|
||
## Prerequisites | ||
|
||
* Helm 3+ | ||
|
||
{{ template "chart.requirementsSection" . }} | ||
|
||
## Add repository | ||
|
||
```console | ||
helm repo add devops-ia https://devops-ia.github.io/helm-charts | ||
helm repo update | ||
``` | ||
|
||
## Install Helm chart (repository mode) | ||
|
||
```console | ||
helm install [RELEASE_NAME] devops-ia/{{ template "chart.name" . }} | ||
``` | ||
|
||
This install all the Kubernetes components associated with the chart and creates the release. | ||
|
||
_See [helm install](https://helm.sh/docs/helm/helm_install/) for command documentation._ | ||
|
||
## Uninstall Helm chart | ||
|
||
```console | ||
helm uninstall [RELEASE_NAME] | ||
``` | ||
|
||
This removes all the Kubernetes components associated with the chart and deletes the release. | ||
|
||
_See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall/) for command documentation._ | ||
|
||
## Configuration | ||
|
||
See [Customizing the chart before installing](https://helm.sh/docs/intro/using_helm/#customizing-the-chart-before-installing). To see all configurable options with comments: | ||
|
||
```console | ||
helm show values devops-ia/{{ template "chart.name" . }} | ||
``` | ||
|
||
{{ template "chart.valuesSection" . }} |
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,22 @@ | ||
1. Get the application URL by running these commands: | ||
{{- if .Values.ingress.enabled }} | ||
{{- range $host := .Values.ingress.hosts }} | ||
{{- range .paths }} | ||
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} | ||
{{- end }} | ||
{{- end }} | ||
{{- else if contains "NodePort" .Values.service.type }} | ||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "cp-schema-registry.fullname" . }}) | ||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") | ||
echo http://$NODE_IP:$NODE_PORT | ||
{{- else if contains "LoadBalancer" .Values.service.type }} | ||
NOTE: It may take a few minutes for the LoadBalancer IP to be available. | ||
You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "cp-schema-registry.fullname" . }}' | ||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "cp-schema-registry.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") | ||
echo http://$SERVICE_IP:{{ .Values.service.port }} | ||
{{- else if contains "ClusterIP" .Values.service.type }} | ||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "cp-schema-registry.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") | ||
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") | ||
echo "Visit http://127.0.0.1:8080 to use your application" | ||
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT | ||
{{- 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,62 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "cp-schema-registry.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 "cp-schema-registry.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 "cp-schema-registry.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "cp-schema-registry.labels" -}} | ||
helm.sh/chart: {{ include "cp-schema-registry.chart" . }} | ||
{{ include "cp-schema-registry.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "cp-schema-registry.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "cp-schema-registry.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "cp-schema-registry.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "cp-schema-registry.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
Oops, something went wrong.