Skip to content

Commit 95c38c6

Browse files
chore: init event queue (#20)
1 parent c1b4400 commit 95c38c6

File tree

10 files changed

+285
-3
lines changed

10 files changed

+285
-3
lines changed

charts/ctrlplane/Chart.lock

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@ dependencies:
1111
- name: event-worker
1212
repository: file://charts/event-worker
1313
version: 0.1.7
14+
- name: event-queue
15+
repository: file://charts/event-queue
16+
version: 0.1.7
1417
- name: otel
1518
repository: file://charts/otel
1619
version: 0.1.0
1720
- name: pty-proxy
1821
repository: file://charts/pty-proxy
1922
version: 0.1.7
20-
digest: sha256:ee36f31f10040547ecb5a25a32c45a5bc25f70bfca315cc693e05c3efe4253d9
21-
generated: "2024-11-14T14:15:19.282865-05:00"
23+
digest: sha256:696d4172a4ce1e477df94406da1ee21a05680dc5734eeeec89ee59fc1810f376
24+
generated: "2025-09-15T17:19:06.843928-04:00"

charts/ctrlplane/Chart.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: ctrlplane
33
description: Ctrlplane Helm chart for Kubernetes
44
type: application
5-
version: 0.3.14
5+
version: 0.4.0
66
appVersion: "1.16.0"
77

88
maintainers:
@@ -27,6 +27,10 @@ dependencies:
2727
condition: event-worker.install
2828
version: "*.*.*"
2929
repository: "file://charts/event-worker"
30+
- name: event-queue
31+
condition: event-queue.install
32+
version: "*.*.*"
33+
repository: "file://charts/event-queue"
3034
- name: otel
3135
condition: otel.install
3236
version: "*.*.*"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: event-queue
3+
description: A Helm chart for Kubernetes
4+
type: application
5+
version: 0.1.7
6+
appVersion: "1.16.0"
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "event-queue.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "event-queue.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "event-queue.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "event-queue.labels" -}}
37+
helm.sh/chart: {{ include "event-queue.chart" . }}
38+
{{ include "event-queue.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "event-queue.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "event-queue.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "event-queue.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "event-queue.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
{{- $imageCfg := dict "global" $.Values.global.image "local" $.Values.image -}}
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: {{ include "event-queue.fullname" . }}
6+
labels:
7+
{{- include "event-queue.labels" . | nindent 4 }}
8+
{{- if .Values.deployment.labels -}}
9+
{{- toYaml .Values.deployment.labels | nindent 4 }}
10+
{{- end }}
11+
annotations:
12+
{{- if .Values.deployment.annotations -}}
13+
{{- toYaml .Values.deployment.annotations | nindent 4 }}
14+
{{- end }}
15+
spec:
16+
replicas: {{ .Values.replica }}
17+
selector:
18+
matchLabels:
19+
{{- include "ctrlplane.selectorLabels" $ | nindent 6 }}
20+
{{- include "event-queue.labels" . | nindent 6 }}
21+
template:
22+
metadata:
23+
labels:
24+
{{- include "event-queue.labels" . | nindent 8 }}
25+
annotations:
26+
{{- if .Values.pod.annotations -}}
27+
{{- toYaml .Values.pod.annotations | nindent 8 }}
28+
{{- end }}
29+
spec:
30+
serviceAccountName: {{ include "event-queue.serviceAccountName" . }}
31+
{{- if .tolerations }}
32+
tolerations:
33+
{{- toYaml .tolerations | nindent 8 }}
34+
{{- end }}
35+
{{- include "ctrlplane.nodeSelector" . | nindent 6 }}
36+
{{- include "ctrlplane.priorityClassName" . | nindent 6 }}
37+
{{- include "ctrlplane.podSecurityContext" .Values.pod.securityContext | nindent 6 }}
38+
containers:
39+
- name: event-queue
40+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
41+
ports:
42+
- name: health
43+
containerPort: 3123
44+
protocol: TCP
45+
livenessProbe:
46+
httpGet:
47+
path: /healthz
48+
port: health
49+
initialDelaySeconds: 15
50+
periodSeconds: 20
51+
failureThreshold: 20
52+
readinessProbe:
53+
httpGet:
54+
path: /healthz
55+
port: health
56+
initialDelaySeconds: 5
57+
periodSeconds: 10
58+
env:
59+
- name: KAFKA_BROKERS
60+
value: {{ .Values.global.kafkaBrokers | quote }}
61+
- name: POSTGRES_URL
62+
valueFrom:
63+
secretKeyRef:
64+
name: {{ .Release.Name }}-connections
65+
key: POSTGRES_URL
66+
- name: VARIABLES_AES_256_KEY
67+
valueFrom:
68+
secretKeyRef:
69+
name: {{ .Release.Name }}-encryption-key
70+
key: AES_256_KEY
71+
{{- with (include "ctrlplane.githubBot" . | fromYaml) }}
72+
- name: GITHUB_BOT_APP_ID
73+
value: {{ .appId | quote }}
74+
- name: GITHUB_BOT_CLIENT_ID
75+
value: {{ .clientId | quote }}
76+
- name: GITHUB_BOT_CLIENT_SECRET
77+
valueFrom:
78+
secretKeyRef:
79+
name: {{ .secretRef }}
80+
key: GITHUB_BOT_CLIENT_SECRET
81+
optional: true
82+
- name: GITHUB_BOT_PRIVATE_KEY
83+
valueFrom:
84+
secretKeyRef:
85+
name: {{ .secretRef }}
86+
key: GITHUB_BOT_PRIVATE_KEY
87+
optional: true
88+
- name: GITHUB_BOT_NAME
89+
value: {{ .name }}
90+
{{- end }}
91+
{{- include "ctrlplane.extraEnv" . | nindent 12 }}
92+
{{- include "ctrlplane.extraEnvFrom" (dict "root" $ "local" .) | nindent 12 }}
93+
- name: ENABLE_NEW_POLICY_ENGINE
94+
value: {{ .Values.global.enableNewPolicyEngine | quote }}
95+
resources:
96+
{{- toYaml .Values.resources | nindent 12 }}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
apiVersion: autoscaling/v2
2+
kind: HorizontalPodAutoscaler
3+
metadata:
4+
name: {{ include "event-queue.fullname" . }}
5+
namespace: {{ $.Release.Namespace }}
6+
labels:
7+
{{- include "event-queue.labels" . | nindent 4 }}
8+
{{- if .Values.hpa.labels -}}
9+
{{- toYaml .Values.hpa.labels | nindent 4 }}
10+
{{- end }}
11+
annotations:
12+
{{- if .Values.hpa.annotations -}}
13+
{{- toYaml .Values.hpa.annotations | nindent 4 }}
14+
{{- end }}
15+
spec:
16+
scaleTargetRef:
17+
apiVersion: apps/v1
18+
kind: Deployment
19+
name: {{ include "event-queue.fullname" . }}
20+
minReplicas: {{ .Values.hpa.minReplicas }}
21+
maxReplicas: {{ .Values.hpa.maxReplicas }}
22+
metrics:
23+
- type: Resource
24+
resource:
25+
name: cpu
26+
target:
27+
type: Utilization
28+
averageUtilization: 70
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{{- if .Values.serviceAccount.create -}}
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: {{ include "event-queue.serviceAccountName" . }}
6+
namespace: {{ $.Release.Namespace }}
7+
labels:
8+
{{- include "event-queue.labels" . | nindent 4 }}
9+
{{- if .Values.serviceAccount.labels -}}
10+
{{- toYaml .Values.serviceAccount.labels | nindent 4 }}
11+
{{- end }}
12+
annotations:
13+
{{- if .Values.serviceAccount.annotations -}}
14+
{{- toYaml .Values.serviceAccount.annotations | nindent 4 }}
15+
{{- end }}
16+
{{- end }}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
nameOverride: ""
2+
fullnameOverride: ""
3+
4+
replica: 1
5+
6+
image:
7+
repository: ctrlplane/event-queue
8+
tag: latest
9+
pullPolicy: Always
10+
11+
extraEnv: {}
12+
extraEnvFrom: {}
13+
14+
deployment:
15+
labels: {}
16+
annotations: {}
17+
18+
hpa:
19+
labels: {}
20+
annotations: {}
21+
minReplicas: 1
22+
maxReplicas: 5
23+
24+
tolerations: []
25+
pod: {}
26+
27+
serviceAccount:
28+
create: false
29+
name: ""
30+
labels: {}
31+
annotations: {}
32+
33+
resources:
34+
requests:
35+
cpu: 1000m
36+
memory: 1Gi
37+
limits:
38+
cpu: 4000m
39+
memory: 4Gi

charts/ctrlplane/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ global:
3232
port: "5432"
3333
database: "ctrlplane"
3434

35+
kafkaBrokers: localhost:9092
36+
3537
integrations:
3638
github:
3739
url: "https://github.com"
@@ -64,6 +66,9 @@ ingress:
6466
event-worker:
6567
install: true
6668

69+
event-queue:
70+
install: true
71+
6772
otel:
6873
install: true
6974

0 commit comments

Comments
 (0)