chore(helm): add API deployment and service templates

This commit is contained in:
2025-01-15 12:00:00 -05:00
parent cda843a80e
commit f61eb6a79b
2 changed files with 78 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "incidentops.fullname" . }}-api
labels:
{{- include "incidentops.labels" . | nindent 4 }}
app.kubernetes.io/component: api
spec:
replicas: {{ .Values.api.replicas }}
selector:
matchLabels:
{{- include "incidentops.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: api
template:
metadata:
labels:
{{- include "incidentops.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: api
spec:
containers:
- name: api
image: "{{ .Values.api.image }}:{{ .Values.api.tag }}"
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: {{ .Values.api.port }}
protocol: TCP
env:
- name: ConnectionStrings__Postgres
value: {{ include "incidentops.postgresConnectionString" . | quote }}
- name: Redis__ConnectionString
value: {{ include "incidentops.redisConnectionString" . | quote }}
- name: Jwt__Issuer
value: {{ .Values.jwt.issuer | quote }}
- name: Jwt__Audience
value: {{ .Values.jwt.audience | quote }}
- name: Jwt__SigningKey
valueFrom:
secretKeyRef:
name: {{ include "incidentops.fullname" . }}-secrets
key: jwt-signing-key
- name: Jwt__AccessTokenExpirationMinutes
value: {{ .Values.jwt.accessTokenExpirationMinutes | quote }}
- name: Jwt__RefreshTokenExpirationDays
value: {{ .Values.jwt.refreshTokenExpirationDays | quote }}
- name: Cors__Origins__0
value: "http://{{ .Values.ingress.host }}"
livenessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 10
periodSeconds: 10
readinessProbe:
httpGet:
path: /readyz
port: http
initialDelaySeconds: 5
periodSeconds: 5
resources:
{{- toYaml .Values.api.resources | nindent 12 }}

View File

@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "incidentops.fullname" . }}-api
labels:
{{- include "incidentops.labels" . | nindent 4 }}
app.kubernetes.io/component: api
spec:
type: ClusterIP
ports:
- port: {{ .Values.api.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "incidentops.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: api