Skip to content

Commit

Permalink
Merge pull request #3 from pbufio/0.4.0-rc.1
Browse files Browse the repository at this point in the history
rollup to v0.4.0-rc.1
  • Loading branch information
aatarasoff authored Dec 7, 2023
2 parents 9bee9a5 + 1e001aa commit 6168fe2
Show file tree
Hide file tree
Showing 6 changed files with 224 additions and 82 deletions.
104 changes: 56 additions & 48 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pbuf-registry/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: pbuf-registry
description: A Helm chart for PBUF Registry
type: application
version: 0.3.0
appVersion: "v0.3.0"
version: 0.4.0-rc.1
appVersion: "v0.4.0-rc.1"

maintainers:
- name: aatarasoff
Expand Down
45 changes: 45 additions & 0 deletions pbuf-registry/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,48 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}


{{/*
Environment variables helper
*/}}
{{- define "pbuf-registry.env" -}}
- name: DATA_DATABASE_DSN
valueFrom:
secretKeyRef:
name: {{ include "pbuf-registry.fullname" . }}
key: DATA_DATABASE_DSN
- name: SERVER_STATIC_TOKEN
valueFrom:
secretKeyRef:
name: {{ include "pbuf-registry.fullname" . }}
key: SERVER_STATIC_TOKEN
- name: SERVER_GRPC_TLS_ENABLED
value: "{{ .Values.service.grpc.tls.enabled }}"
- name: SERVER_GRPC_TLS_CERTFILE
value: /app/certs/server-cert.pem
- name: SERVER_GRPC_TLS_KEYFILE
value: /app/certs/server-key.pem
- name: SERVER_GRPC_AUTH_ENABLED
value: "{{ .Values.service.grpc.auth.enabled }}"
- name: SERVER_GRPC_AUTH_TYPE
value: "{{ .Values.service.grpc.auth.type }}"
- name: SERVER_HTTP_AUTH_ENABLED
value: "{{ .Values.service.http.auth.enabled }}"
- name: SERVER_HTTP_AUTH_TYPE
value: "{{ .Values.service.http.auth.type }}"
{{- end }}

{{/*
Volume mounts
*/}}
{{- define "pbuf-registry.volumeMounts" -}}
- mountPath: /app/certs/server-cert.pem
name: secret
readOnly: true
subPath: server-cert.pem
- mountPath: /app/certs/server-key.pem
name: secret
readOnly: true
subPath: server-key.pem
{{- end }}
93 changes: 93 additions & 0 deletions pbuf-registry/templates/background.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Create background deployments helm template with 1 replica
{{- range $name, $spec := $.Values.background }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "pbuf-registry.fullname" $ }}-{{ $name }}
labels:
helm.sh/chart: {{ include "pbuf-registry.chart" $ }}
{{- if $.Chart.AppVersion }}
app.kubernetes.io/version: {{ $.Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ $.Release.Service }}
app.kubernetes.io/name: {{ include "pbuf-registry.name" $ }}-{{ $name }}
app.kubernetes.io/instance: {{ $.Release.Name }}
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: {{ include "pbuf-registry.name" $ }}-{{ $name }}
app.kubernetes.io/instance: {{ $.Release.Name }}
template:
metadata:
{{- with $.Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
helm.sh/chart: {{ include "pbuf-registry.chart" $ }}
{{- if $.Chart.AppVersion }}
app.kubernetes.io/version: {{ $.Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ $.Release.Service }}
app.kubernetes.io/name: {{ include "pbuf-registry.name" $ }}-{{ $name }}
app.kubernetes.io/instance: {{ $.Release.Name }}
{{- with $.Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
date: "{{ now | unixEpoch }}"
spec:
{{- with $.Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "pbuf-registry.serviceAccountName" $ }}
securityContext:
{{- toYaml $.Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ $.Chart.Name }}
securityContext:
{{- toYaml $.Values.securityContext | nindent 12 }}
image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag | default $.Chart.AppVersion }}"
imagePullPolicy: {{ $.Values.image.pullPolicy }}
command: {{ $spec.command }}
args: {{ $spec.args }}
env:
{{- include "pbuf-registry.env" $ | nindent 12 }}
ports:
- name: debug
containerPort: 8082
protocol: TCP
livenessProbe:
httpGet:
path: /healthz
port: debug
readinessProbe:
httpGet:
path: /healthz
port: debug
resources:
{{- toYaml $spec.resources | nindent 12 }}
volumeMounts:
{{- include "pbuf-registry.volumeMounts" $ | nindent 12 }}
{{- with $.Values.customSidecarContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with $.Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with $.Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with $.Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: secret
secret:
secretName: {{ include "pbuf-registry.fullname" $ }}
{{- end }}
34 changes: 2 additions & 32 deletions pbuf-registry/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,30 +41,7 @@ spec:
- -c
- /app/pbuf-migrations && /app/pbuf-registry
env:
- name: DATA_DATABASE_DSN
valueFrom:
secretKeyRef:
name: {{ include "pbuf-registry.fullname" . }}
key: DATA_DATABASE_DSN
- name: SERVER_STATIC_TOKEN
valueFrom:
secretKeyRef:
name: {{ include "pbuf-registry.fullname" . }}
key: SERVER_STATIC_TOKEN
- name: SERVER_GRPC_TLS_ENABLED
value: "{{ .Values.service.grpc.tls.enabled }}"
- name: SERVER_GRPC_TLS_CERTFILE
value: /app/certs/server-cert.pem
- name: SERVER_GRPC_TLS_KEYFILE
value: /app/certs/server-key.pem
- name: SERVER_GRPC_AUTH_ENABLED
value: "{{ .Values.service.grpc.auth.enabled }}"
- name: SERVER_GRPC_AUTH_TYPE
value: "{{ .Values.service.grpc.auth.type }}"
- name: SERVER_HTTP_AUTH_ENABLED
value: "{{ .Values.service.http.auth.enabled }}"
- name: SERVER_HTTP_AUTH_TYPE
value: "{{ .Values.service.http.auth.type }}"
{{- include "pbuf-registry.env" . | nindent 12 }}
ports:
- name: http
containerPort: 8080
Expand All @@ -86,14 +63,7 @@ spec:
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- mountPath: /app/certs/server-cert.pem
name: secret
readOnly: true
subPath: server-cert.pem
- mountPath: /app/certs/server-key.pem
name: secret
readOnly: true
subPath: server-key.pem
{{- include "pbuf-registry.volumeMounts" . | nindent 12 }}
{{- with .Values.customSidecarContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
26 changes: 26 additions & 0 deletions pbuf-registry/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,29 @@ tolerations: []
affinity: {}

customSidecarContainers: []

background:
compaction:
enabled: true
resources: {}
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
command: /app/pbuf-registry
args:
- compaction
protoparser:
enabled: true
resources: {}
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
command: /app/pbuf-registry
args:
- proto-parsing

0 comments on commit 6168fe2

Please sign in to comment.