feat: add trading platform K8s deployment infrastructure

- Add Helm chart with 19 templates (Deployments, Services, Ingress,
  ConfigMaps, Secrets, NetworkPolicy, cert-manager)
- Add Dockerfiles for 4 microservices (dashboard, data-service,
  execute-service, news-service)
- Add CI/CD workflows (build-test, build-push, deploy)
- Add raw K8s manifests, per-service Helm charts, and deploy scripts
- Add SOPS-encrypted secrets template and config
- Configure deployment to customer1 namespace
- Include infrastructure components: PostgreSQL, Redis, Kafka
This commit is contained in:
Sirius Devops 2026-05-17 22:15:00 +00:00
commit d079d1239f
115 changed files with 5917 additions and 0 deletions

View file

@ -0,0 +1,112 @@
{{- if .Values.executeService.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.executeService.name }}
namespace: {{ .Values.global.namespace }}
labels:
{{- include "trading-platform.labels" . | nindent 4 }}
app: {{ .Values.executeService.name }}
spec:
{{- if not .Values.executeService.autoscaling.enabled }}
replicas: {{ .Values.global.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "trading-platform.selectorLabels" . | nindent 6 }}
app: {{ .Values.executeService.name }}
template:
metadata:
labels:
{{- include "trading-platform.selectorLabels" . | nindent 8 }}
app: {{ .Values.executeService.name }}
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "{{ .Values.executeService.port }}"
spec:
serviceAccountName: {{ .Values.executeService.name }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Values.executeService.name }}
image: "{{ .Values.executeService.image.repository }}:{{ .Values.executeService.image.tag }}"
imagePullPolicy: {{ .Values.executeService.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.executeService.port }}
protocol: TCP
env:
{{- range $key, $value := .Values.executeService.env }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
# Shared config from ConfigMap
- name: DB_HOST
valueFrom:
configMapKeyRef:
name: {{ include "trading-platform.fullname" . }}-config
key: POSTGRES_HOST
- name: REDIS_HOST
valueFrom:
configMapKeyRef:
name: {{ include "trading-platform.fullname" . }}-config
key: REDIS_HOST
- name: KAFKA_BOOTSTRAP_SERVERS
valueFrom:
configMapKeyRef:
name: {{ include "trading-platform.fullname" . }}-config
key: KAFKA_BOOTSTRAP
envFrom:
- secretRef:
name: trading-secrets
resources:
{{- toYaml .Values.executeService.resources | nindent 12 }}
securityContext:
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
volumeMounts:
- name: tmp
mountPath: /tmp
- name: mtls-certs
mountPath: /etc/mtls
readOnly: true
livenessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 15
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 10
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 3
volumes:
- name: tmp
emptyDir: {}
- name: mtls-certs
secret:
secretName: execute-service-mtls
{{- with .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
nodeSelector:
kubernetes.io/os: linux
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{ .Values.executeService.name }}
topologyKey: kubernetes.io/hostname
{{- end }}

View file

@ -0,0 +1,50 @@
{{- if .Values.executeService.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.executeService.name }}
namespace: {{ .Values.global.namespace }}
labels:
app: {{ .Values.executeService.name }}
spec:
type: ClusterIP
ports:
- port: {{ .Values.executeService.port }}
targetPort: http
protocol: TCP
name: http
selector:
app: {{ .Values.executeService.name }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.executeService.name }}
namespace: {{ .Values.global.namespace }}
labels:
app: {{ .Values.executeService.name }}
annotations:
iam.gke.io/gcp-service-account: execute-service@{{ .Values.global.clusterName }}.iam.gserviceaccount.com
---
{{- if .Values.executeService.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Values.executeService.name }}
namespace: {{ .Values.global.namespace }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Values.executeService.name }}
minReplicas: {{ .Values.executeService.autoscaling.minReplicas }}
maxReplicas: {{ .Values.executeService.autoscaling.maxReplicas }}
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.executeService.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- end }}