feat: add OSINT Dashboard Kubernetes infrastructure
- Helm chart scaffold (Chart.yaml, values.yaml, _helpers.tpl) - Namespace + RBAC manifests - PostgreSQL (CNPG, 3 replicas, PostGIS + TimescaleDB) - NATS JetStream (3 replicas, persistent, custom subjects) - Redis Sentinel (1 primary + 2 replicas, HA) - MinIO distributed (4 replicas, bucket init job) - Gateway API HTTPRoute + cert-manager TLS certificates - Monitoring stack (Prometheus, Grafana, Alertmanager, exporters) - NetworkPolicies (default deny + per-component policies) - GitHub Actions CI/CD pipeline (lint, template, security scan) - Flux CD staging overlay
This commit is contained in:
parent
36b1d637f1
commit
8255467313
31 changed files with 2818 additions and 0 deletions
|
|
@ -0,0 +1,61 @@
|
|||
{{- if .Values.minio.enabled }}
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: minio-buckets-init
|
||||
namespace: {{ .Values.namespace }}
|
||||
labels:
|
||||
{{- include "osint-dashboard.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: object-storage
|
||||
annotations:
|
||||
"helm.sh/hook": post-install,post-upgrade
|
||||
"helm.sh/hook-delete-policy": hook-succeeded
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "osint-dashboard.selectorLabels" . | nindent 8 }}
|
||||
app.kubernetes.io/component: object-storage
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
securityContext:
|
||||
runAsNonRoot: true
|
||||
runAsUser: 1000
|
||||
containers:
|
||||
- name: mc
|
||||
image: "{{ .Values.minio.image.repository }}:{{ .Values.minio.image.tag }}"
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: {{ .Values.minio.credentialsSecret }}
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
args:
|
||||
- |
|
||||
# Wait for MinIO to be ready
|
||||
until curl -sf http://minio:{{ .Values.minio.ports.api }}/minio/health/live; do
|
||||
echo "Waiting for MinIO..."
|
||||
sleep 2
|
||||
done
|
||||
|
||||
# Configure mc alias
|
||||
mc alias set myminio http://minio:{{ .Values.minio.ports.api }} $MINIO_ROOT_USER $MINIO_ROOT_PASSWORD
|
||||
|
||||
# Create buckets
|
||||
mc mb --ignore-existing myminio/osint-video-clips
|
||||
mc mb --ignore-existing myminio/osint-satellite-tiles
|
||||
mc mb --ignore-existing myminio/osint-data-dumps
|
||||
|
||||
echo "MinIO buckets initialized successfully"
|
||||
resources:
|
||||
requests:
|
||||
cpu: "100m"
|
||||
memory: "64Mi"
|
||||
limits:
|
||||
cpu: "500m"
|
||||
memory: "256Mi"
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities:
|
||||
drop: ["ALL"]
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
{{- if .Values.minio.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ .Values.minio.credentialsSecret }}
|
||||
namespace: {{ .Values.namespace }}
|
||||
labels:
|
||||
{{- include "osint-dashboard.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
# SOPS will encrypt this
|
||||
type: Opaque
|
||||
stringData:
|
||||
MINIO_ROOT_USER: CHANGE_ME_USE_SOPS
|
||||
MINIO_ROOT_PASSWORD: CHANGE_ME_USE_SOPS
|
||||
{{- end }}
|
||||
49
apps/base/osint-dashboard/templates/minio/service.yaml
Normal file
49
apps/base/osint-dashboard/templates/minio/service.yaml
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
{{- if .Values.minio.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: minio
|
||||
namespace: {{ .Values.namespace }}
|
||||
labels:
|
||||
{{- include "osint-dashboard.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: object-storage
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: {{ .Values.minio.ports.api }}
|
||||
targetPort: {{ .Values.minio.ports.api }}
|
||||
protocol: TCP
|
||||
name: api
|
||||
- port: {{ .Values.minio.ports.console }}
|
||||
targetPort: {{ .Values.minio.ports.console }}
|
||||
protocol: TCP
|
||||
name: console
|
||||
selector:
|
||||
app.kubernetes.io/name: osint-dashboard
|
||||
app.kubernetes.io/component: object-storage
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: minio-headless
|
||||
namespace: {{ .Values.namespace }}
|
||||
labels:
|
||||
{{- include "osint-dashboard.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: object-storage
|
||||
annotations:
|
||||
service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
|
||||
spec:
|
||||
clusterIP: None
|
||||
ports:
|
||||
- port: {{ .Values.minio.ports.api }}
|
||||
targetPort: {{ .Values.minio.ports.api }}
|
||||
protocol: TCP
|
||||
name: api
|
||||
- port: {{ .Values.minio.ports.console }}
|
||||
targetPort: {{ .Values.minio.ports.console }}
|
||||
protocol: TCP
|
||||
name: console
|
||||
selector:
|
||||
app.kubernetes.io/name: osint-dashboard
|
||||
app.kubernetes.io/component: object-storage
|
||||
{{- end }}
|
||||
84
apps/base/osint-dashboard/templates/minio/statefulset.yaml
Normal file
84
apps/base/osint-dashboard/templates/minio/statefulset.yaml
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
{{- if .Values.minio.enabled }}
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: minio
|
||||
namespace: {{ .Values.namespace }}
|
||||
labels:
|
||||
{{- include "osint-dashboard.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: object-storage
|
||||
spec:
|
||||
serviceName: minio-headless
|
||||
replicas: {{ .Values.minio.replicaCount }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "osint-dashboard.selectorLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: object-storage
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "osint-dashboard.selectorLabels" . | nindent 8 }}
|
||||
app.kubernetes.io/component: object-storage
|
||||
annotations:
|
||||
prometheus.io/scrape: "true"
|
||||
prometheus.io/port: "{{ .Values.minio.ports.api }}"
|
||||
prometheus.io/path: "/minio/v2/metrics/cluster"
|
||||
spec:
|
||||
securityContext:
|
||||
runAsNonRoot: true
|
||||
runAsUser: 1000
|
||||
fsGroup: 1000
|
||||
containers:
|
||||
- name: minio
|
||||
image: "{{ .Values.minio.image.repository }}:{{ .Values.minio.image.tag }}"
|
||||
ports:
|
||||
- name: api
|
||||
containerPort: {{ .Values.minio.ports.api }}
|
||||
- name: console
|
||||
containerPort: {{ .Values.minio.ports.console }}
|
||||
resources:
|
||||
{{- toYaml .Values.minio.resources | nindent 12 }}
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: {{ .Values.minio.credentialsSecret }}
|
||||
env:
|
||||
- name: MINIO_SERVER_URL
|
||||
value: "http://minio.{{ .Values.namespace }}.svc:{{ .Values.minio.ports.api }}"
|
||||
args:
|
||||
- server
|
||||
- "--console-address"
|
||||
- ":{{ .Values.minio.ports.console }}"
|
||||
- "--address"
|
||||
- ":{{ .Values.minio.ports.api }}"
|
||||
# Distributed mode: all 4 pods
|
||||
- "http://minio-{0...3}.minio-headless.{{ .Values.namespace }}.svc/data"
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /data
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /minio/health/live
|
||||
port: api
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 5
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /minio/health/live
|
||||
port: api
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 10
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
readOnlyRootFilesystem: false
|
||||
capabilities:
|
||||
drop: ["ALL"]
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: data
|
||||
spec:
|
||||
accessModes: ["ReadWriteOnce"]
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.minio.storage.size }}
|
||||
storageClassName: {{ .Values.minio.storage.storageClass }}
|
||||
{{- end }}
|
||||
Loading…
Reference in a new issue