gcloud-lab/apps/base/osint-dashboard/templates/api/deployment.yaml
sirius0xdev 54f2f42710 fix(osint-dashboard): fix critical manifest issues found during audit
- Fix PostgreSQL topologySpreadConstraints label selector (cnpg.io/cluster)
- Fix Ingress HTTPRoutes: route API and WS traffic to correct backends
- Fix API NetworkPolicy port mismatch (4000 -> 8000)
- Fix MinIO bucket index syntax (_0 -> 0) in ConfigMap
- Add postgresql.port and postgresql.database to values.yaml
- Add container-level securityContext to API deployment
- Restrict monitoring NetworkPolicy ingress to monitoring namespace
- Enable readOnlyRootFilesystem for MinIO container
- Add activeDeadlineSeconds (3600s) to all 4 CronJobs
2026-05-23 04:38:51 +00:00

88 lines
2.7 KiB
YAML

{{- if .Values.api.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "osint-dashboard.fullname" . }}-api
namespace: {{ .Values.namespace }}
labels:
{{- include "osint-dashboard.labels" . | nindent 4 }}
app.kubernetes.io/component: api
spec:
replicas: {{ .Values.api.replicaCount }}
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
selector:
matchLabels:
{{- include "osint-dashboard.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: api
template:
metadata:
labels:
{{- include "osint-dashboard.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: api
annotations:
checksum/config: {{ include "osint-dashboard.fullname" . }}-api-config
spec:
terminationGracePeriodSeconds: 30
securityContext:
{{- toYaml .Values.securityContext | nindent 8 }}
containers:
- name: api
image: "{{ .Values.api.image.repository }}:{{ .Values.api.image.tag }}"
imagePullPolicy: {{ .Values.api.image.pullPolicy | default "Always" }}
ports:
- containerPort: 8000
name: http
protocol: TCP
resources:
{{- toYaml .Values.api.resources | nindent 12 }}
envFrom:
- configMapRef:
name: {{ include "osint-dashboard.fullname" . }}-api-config
env:
- name: DB_USER
valueFrom:
secretKeyRef:
name: {{ .Values.postgresql.credentialsSecret }}
key: username
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.postgresql.credentialsSecret }}
key: password
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]
startupProbe:
httpGet:
path: /api/health
port: 8000
initialDelaySeconds: 15
periodSeconds: 5
failureThreshold: 12
livenessProbe:
httpGet:
path: /api/health
port: 8000
initialDelaySeconds: 30
periodSeconds: 30
readinessProbe:
httpGet:
path: /api/health
port: 8000
initialDelaySeconds: 15
periodSeconds: 10
{{- with .Values.api.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.api.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}