gcloud-lab/trading-platform/helm/trading-platform/templates/news-service/deployment.yaml
Sirius Devops d079d1239f 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
2026-05-17 22:15:00 +00:00

85 lines
2.8 KiB
YAML

{{- if .Values.newsService.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.newsService.name }}
namespace: {{ .Values.global.namespace }}
labels:
{{- include "trading-platform.labels" . | nindent 4 }}
app: {{ .Values.newsService.name }}
spec:
{{- if not .Values.newsService.autoscaling.enabled }}
replicas: {{ .Values.global.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "trading-platform.selectorLabels" . | nindent 6 }}
app: {{ .Values.newsService.name }}
template:
metadata:
labels:
{{- include "trading-platform.selectorLabels" . | nindent 8 }}
app: {{ .Values.newsService.name }}
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "{{ .Values.newsService.port }}"
spec:
serviceAccountName: {{ .Values.newsService.name }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Values.newsService.name }}
image: "{{ .Values.newsService.image.repository }}:{{ .Values.newsService.image.tag }}"
imagePullPolicy: {{ .Values.newsService.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.newsService.port }}
protocol: TCP
env:
{{- range $key, $value := .Values.newsService.env }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
- name: KAFKA_BOOTSTRAP_SERVERS
valueFrom:
configMapKeyRef:
name: {{ include "trading-platform.fullname" . }}-config
key: KAFKA_BOOTSTRAP
envFrom:
- secretRef:
name: trading-secrets
resources:
{{- toYaml .Values.newsService.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
readinessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 10
periodSeconds: 5
timeoutSeconds: 3
volumes:
- name: tmp
emptyDir: {}
- name: mtls-certs
secret:
secretName: news-service-mtls
{{- with .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}