workloads.yaml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. apiVersion: v1
  2. kind: ServiceAccount
  3. metadata:
  4. name: dataops-runtime
  5. namespace: {{ .Values.namespace }}
  6. automountServiceAccountToken: false
  7. ---
  8. apiVersion: apps/v1
  9. kind: Deployment
  10. metadata:
  11. name: dataops-backend
  12. namespace: {{ .Values.namespace }}
  13. spec:
  14. replicas: {{ .Values.replicas.backend }}
  15. selector: {matchLabels: {app: dataops-backend}}
  16. template:
  17. metadata: {labels: {app: dataops-backend}}
  18. spec:
  19. serviceAccountName: dataops-runtime
  20. automountServiceAccountToken: false
  21. securityContext: {seccompProfile: {type: RuntimeDefault}}
  22. topologySpreadConstraints:
  23. - maxSkew: 1
  24. topologyKey: topology.kubernetes.io/zone
  25. whenUnsatisfiable: DoNotSchedule
  26. labelSelector: {matchLabels: {app: dataops-backend}}
  27. affinity:
  28. podAntiAffinity:
  29. requiredDuringSchedulingIgnoredDuringExecution:
  30. - labelSelector: {matchLabels: {app: dataops-backend}}
  31. topologyKey: kubernetes.io/hostname
  32. containers:
  33. - name: backend
  34. image: "{{ .Values.images.backend }}"
  35. securityContext:
  36. runAsNonRoot: true
  37. allowPrivilegeEscalation: false
  38. readOnlyRootFilesystem: true
  39. capabilities: {drop: ["ALL"]}
  40. env:
  41. - name: DATABASE_URL
  42. valueFrom: {secretKeyRef: {name: "{{ .Values.secrets.database }}", key: url}}
  43. resources:
  44. {{ toYaml .Values.resources | nindent 10 }}
  45. ports: [{containerPort: 5500}]
  46. readinessProbe: {httpGet: {path: /health, port: 5500}}
  47. livenessProbe: {httpGet: {path: /health, port: 5500}}
  48. startupProbe: {httpGet: {path: /health, port: 5500}, failureThreshold: 30, periodSeconds: 5}
  49. ---
  50. apiVersion: apps/v1
  51. kind: Deployment
  52. metadata:
  53. name: dataops-runner
  54. namespace: {{ .Values.namespace }}
  55. spec:
  56. replicas: {{ .Values.replicas.runner }}
  57. selector: {matchLabels: {app: dataops-runner}}
  58. template:
  59. metadata: {labels: {app: dataops-runner}}
  60. spec:
  61. serviceAccountName: dataops-runtime
  62. automountServiceAccountToken: false
  63. securityContext: {seccompProfile: {type: RuntimeDefault}}
  64. topologySpreadConstraints: [{maxSkew: 1, topologyKey: topology.kubernetes.io/zone, whenUnsatisfiable: DoNotSchedule, labelSelector: {matchLabels: {app: dataops-runner}}}]
  65. affinity: {podAntiAffinity: {requiredDuringSchedulingIgnoredDuringExecution: [{labelSelector: {matchLabels: {app: dataops-runner}}, topologyKey: kubernetes.io/hostname}]}}
  66. containers:
  67. - name: runner
  68. image: "{{ .Values.images.runner }}"
  69. securityContext: {runAsNonRoot: true, allowPrivilegeEscalation: false, readOnlyRootFilesystem: true, capabilities: {drop: ["ALL"]}}
  70. env: [{name: DATABASE_URL, valueFrom: {secretKeyRef: {name: "{{ .Values.secrets.database }}", key: url}}}]
  71. resources:
  72. {{ toYaml .Values.resources | nindent 10 }}
  73. readinessProbe: {httpGet: {path: /health, port: 5600}}
  74. livenessProbe: {httpGet: {path: /health, port: 5600}}
  75. startupProbe: {httpGet: {path: /health, port: 5600}, failureThreshold: 30, periodSeconds: 5}