Skip to content

Commit

Permalink
[#4141] Schema Registry Manager (#4143)
Browse files Browse the repository at this point in the history
  • Loading branch information
AitorAlgorta committed Feb 16, 2024
1 parent 8a6d819 commit 40f7aa4
Show file tree
Hide file tree
Showing 14 changed files with 540 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ jobs:
run: |
bazel test --test_tag_filters=-lint //...
- name: Cleanup space
run: |
df -h
sudo apt-get autoremove -y
sudo apt-get clean
docker images prune -a
sudo rm -rf /usr/local/share/powershell
sudo rm -rf /opt/hostedtoolcache
df -h
- name: Build all artifacts
run: |
bazel build //...
Expand Down
19 changes: 19 additions & 0 deletions backend/components/schema-registry-manager/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:18

WORKDIR /app

COPY ./src/package*.json ./
COPY ./src/tsconfig*.json ./

RUN npm install
RUN npm install typescript -g

COPY ./src/app.ts ./
COPY ./src/types.ts ./
COPY ./src/providers/karapace.ts ./providers/

RUN tsc

EXPOSE 3000

CMD [ "node", "app.js" ]
6 changes: 6 additions & 0 deletions backend/components/schema-registry-manager/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
build:
docker build -t schema-registry-manager .

release: build
docker tag schema-registry-manager ghcr.io/airyhq/backend/schema-registry-manager:release
docker push ghcr.io/airyhq/backend/schema-registry-manager:release
3 changes: 3 additions & 0 deletions backend/components/schema-registry-manager/helm/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
load("//tools/build:helm.bzl", "helm_ruleset_core_version")

helm_ruleset_core_version()
5 changes: 5 additions & 0 deletions backend/components/schema-registry-manager/helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v2
appVersion: "1.0"
description: Schema registry component to manage different providers
name: schema-registry-manager
version: 1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.component }}
labels:
core.airy.co/managed: "true"
core.airy.co/mandatory: "{{ .Values.mandatory }}"
core.airy.co/component: "{{ .Values.component }}"
annotations:
core.airy.co/enabled: "{{ .Values.enabled }}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.component }}
labels:
app: {{ .Values.component }}
core.airy.co/managed: "true"
core.airy.co/mandatory: "{{ .Values.mandatory }}"
core.airy.co/component: {{ .Values.component }}
spec:
replicas: {{ if .Values.enabled }} 1 {{ else }} 0 {{ end }}
selector:
matchLabels:
app: {{ .Values.component }}
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: {{ .Values.component }}
spec:
containers:
- name: app
image: "ghcr.io/airyhq/{{ .Values.image }}:{{ .Values.imageTag }}"
imagePullPolicy: Always
envFrom:
- configMapRef:
name: security
- configMapRef:
name: kafka-config
- configMapRef:
name: {{ .Values.component }}
env:
- name: KAFKA_TOPIC_NAME
value: {{ .Values.kafka.topic }}
livenessProbe:
httpGet:
path: /actuator/health
port: {{ .Values.port }}
httpHeaders:
- name: Health-Check
value: health-check
initialDelaySeconds: 43200
periodSeconds: 10
failureThreshold: 3
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.component }}
labels:
app: {{ .Values.component }}
spec:
type: ClusterIP
clusterIP: None
ports:
- name: {{ .Values.component }}
port: 80
targetPort: {{ .Values.port }}
selector:
app: {{ .Values.component }}
9 changes: 9 additions & 0 deletions backend/components/schema-registry-manager/helm/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
component: schema-registry-manager
mandatory: false
enabled: false
image: backend/schema-registry-manager
imageTag: release
port: 3000
resources:
kafka:
topic: application.communication.messages
Loading

0 comments on commit 40f7aa4

Please sign in to comment.