wip
Some checks are pending
Build and Publish / build-release (push) Waiting to run

This commit is contained in:
2026-04-13 15:30:31 -05:00
parent a52f049a29
commit 5037bc3632
44 changed files with 2210 additions and 676 deletions

14
ops/chart/Chart.yaml Normal file
View File

@@ -0,0 +1,14 @@
apiVersion: v2
name: policy-service
description: Policy service for insurance quotes and policies
type: application
version: 0.1.0
appVersion: "1.0.0"
keywords:
- elixir
- commanded
- cqrs
dependencies:
- name: common
version: "4.6.2"
repository: https://bjw-s-labs.github.io/helm-charts/

View File

@@ -0,0 +1,4 @@
{{/*
Render all resources provided by the common library
*/}}
{{- include "bjw-s.common.loader.all" . -}}

View File

@@ -0,0 +1,36 @@
{{- /*
Policy Service PostgreSQL Cluster using CNPG
*/ -}}
{{- if .Values.postgresql.enabled -}}
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: {{ include "bjw-s.common.lib.chart.names.fullname" . }}-pg
namespace: {{ .Release.Namespace }}
labels:
{{- include "bjw-s.common.lib.chart.names.labels" . | nindent 4 }}
spec:
description: "PostgreSQL cluster for {{ .Release.Name }}"
imageName: {{ .Values.postgresql.image | default "ghcr.io/cloudnative-pg/container-image:1.23.1" }}
instances: {{ .Values.postgresql.instances | default 1 }}
bootstrap:
initdb:
database: {{ .Values.postgresql.database | default "policy_service" }}
owner: {{ .Values.postgresql.owner | default "policy_service" }}
storage:
storageClass: {{ .Values.postgresql.storageClass | default "local-path" }}
size: {{ .Values.postgresql.storageSize | default "1Gi" }}
resources:
requests:
cpu: {{ .Values.postgresql.resources.requests.cpu | default "100m" }}
memory: {{ .Values.postgresql.resources.requests.memory | default "128Mi" }}
limits:
cpu: {{ .Values.postgresql.resources.limits.cpu | default "500m" }}
memory: {{ .Values.postgresql.resources.limits.memory | default "512Mi" }}
monitoring:
enablePodMonitoring: true
{{- end -}}

98
ops/chart/values.yaml Normal file
View File

@@ -0,0 +1,98 @@
controllers:
main:
enabled: true
type: deployment
replicas: 1
initContainers:
migrate:
image:
repository: gitea.corredorconect.com/software-engineering/policy-service
tag: latest
pullPolicy: IfNotPresent
command:
- sh
- -c
- >
mix ecto.create &&
mix ecto.migrate &&
mix event_store.create &&
mix event_store.init
env:
MIX_ENV: prod
containers:
main:
image:
repository: gitea.corredorconect.com/software-engineering/policy-service
tag: latest
pullPolicy: IfNotPresent
env:
MIX_ENV: prod
probes:
liveness:
enabled: true
custom: true
spec:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 30
periodSeconds: 10
readiness:
enabled: true
custom: true
spec:
httpGet:
path: /health/ready
port: 8080
initialDelaySeconds: 5
periodSeconds: 5
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 500m
memory: 512Mi
service:
main:
enabled: true
controller: main
primary: true
type: ClusterIP
ports:
http:
enabled: true
primary: true
port: 8080
protocol: HTTP
ingress:
main:
enabled: false
className: nginx
hosts:
- host: policy-service.local
paths:
- path: /
pathType: Prefix
service:
identifier: main
port: http
postgresql:
enabled: true
image: ghcr.io/cloudnative-pg/container-image:1.23.1
instances: 1
database: policy_service
owner: policy_service
storageClass: local-path
storageSize: 1Gi
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi