|
| 1 | +apiVersion: apps/v1 |
| 2 | +kind: Deployment |
| 3 | +metadata: |
| 4 | + name: {{ include "mcp-server.name" . }} |
| 5 | + namespace: {{ .Release.Namespace }} |
| 6 | + {{- if .Values.global.commonLabels }} |
| 7 | + labels: |
| 8 | + {{- include "harnesscommon.tplvalues.render" ( dict "value" .Values.global.commonLabels "context" $ ) | nindent 4 }} |
| 9 | + {{- end }} |
| 10 | + {{- if .Values.global.commonAnnotations }} |
| 11 | + annotations: {{- include "harnesscommon.tplvalues.render" ( dict "value" .Values.global.commonAnnotations "context" $ ) | nindent 4 }} |
| 12 | + {{- end }} |
| 13 | +spec: |
| 14 | + progressDeadlineSeconds: {{ .Values.progressDeadlineSeconds }} |
| 15 | + {{- if not .Values.autoscaling.enabled }} |
| 16 | + replicas: {{ .Values.replicaCount }} |
| 17 | + {{- end }} |
| 18 | + {{- if .Values.updateStrategy }} |
| 19 | + strategy: {{- toYaml .Values.updateStrategy | nindent 4 }} |
| 20 | + {{- end }} |
| 21 | + selector: |
| 22 | + matchLabels: |
| 23 | + {{- include "mcp-server.selectorLabels" . | nindent 6 }} |
| 24 | + template: |
| 25 | + metadata: |
| 26 | + annotations: |
| 27 | + checksum/credentials-secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }} |
| 28 | + checksum/config: {{ include (print $.Template.BasePath "/config.yaml") . | sha256sum }} |
| 29 | + {{- with .Values.podAnnotations }} |
| 30 | + {{- toYaml . | nindent 8 }} |
| 31 | + {{- end }} |
| 32 | + {{- if .Values.global.commonAnnotations }} |
| 33 | + {{- include "harnesscommon.tplvalues.render" ( dict "value" .Values.global.commonAnnotations "context" $ ) | nindent 8 }} |
| 34 | + {{- end }} |
| 35 | + {{- include "harnesscommon.monitoring.annotations" . | nindent 8 }} |
| 36 | + labels: |
| 37 | + app: mcp-server |
| 38 | + {{- include "mcp-server.selectorLabels" . | nindent 8 }} |
| 39 | + {{- if .Values.global.commonLabels }} |
| 40 | + {{- include "harnesscommon.tplvalues.render" ( dict "value" .Values.global.commonLabels "context" $ ) | nindent 8 }} |
| 41 | + {{- end }} |
| 42 | + {{- if .Values.podLabels }} |
| 43 | + {{- include "harnesscommon.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }} |
| 44 | + {{- end }} |
| 45 | + spec: |
| 46 | + {{- include "mcp-server.pullSecrets" . | nindent 6 }} |
| 47 | + {{- if .Values.schedulerName }} |
| 48 | + schedulerName: {{ .Values.schedulerName }} |
| 49 | + {{- end }} |
| 50 | + serviceAccountName: {{ include "mcp-server.serviceAccountName" . }} |
| 51 | + {{- with .Values.podSecurityContext }} |
| 52 | + securityContext: |
| 53 | + {{- toYaml . | nindent 8 }} |
| 54 | + {{- end }} |
| 55 | + {{- if .Values.terminationGracePeriodSeconds }} |
| 56 | + terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} |
| 57 | + {{- end }} |
| 58 | + {{- if .Values.initContainers }} |
| 59 | + initContainers: |
| 60 | + {{- include "harnesscommon.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }} |
| 61 | + {{- end }} |
| 62 | + containers: |
| 63 | + - name: {{ include "mcp-server.name" . }} |
| 64 | + image: {{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }} |
| 65 | + imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 66 | + {{- with .Values.securityContext }} |
| 67 | + securityContext: |
| 68 | + {{- toYaml . | nindent 12 }} |
| 69 | + {{- end }} |
| 70 | + {{- if .Values.command }} |
| 71 | + command: {{ toYaml .Values.command | nindent 12 }} |
| 72 | + {{- end }} |
| 73 | + {{- if .Values.args }} |
| 74 | + args: {{ toYaml .Values.args | nindent 12 }} |
| 75 | + {{- end }} |
| 76 | + env: |
| 77 | + {{- include "harnesscommon.renderSecretsAsEnvironmentVariables" (dict "ctx" $) | indent 10 }} |
| 78 | + envFrom: |
| 79 | + - configMapRef: |
| 80 | + name: {{ include "mcp-server.fullname" . }} |
| 81 | + ports: |
| 82 | + - name: mcp |
| 83 | + containerPort: {{ .Values.service.port }} |
| 84 | + protocol: TCP |
| 85 | + {{- with .Values.livenessProbe }} |
| 86 | + livenessProbe: |
| 87 | + {{- toYaml . | nindent 12 }} |
| 88 | + {{- end }} |
| 89 | + {{- with .Values.readinessProbe }} |
| 90 | + readinessProbe: |
| 91 | + {{- toYaml . | nindent 12 }} |
| 92 | + {{- end }} |
| 93 | + {{- if .Values.resources }} |
| 94 | + resources: |
| 95 | + {{- include "harnesscommon.tplvalues.render" (dict "value" .Values.resources "context" $) | nindent 10 }} |
| 96 | + {{- end }} |
| 97 | + {{- with .Values.volumeMounts }} |
| 98 | + volumeMounts: |
| 99 | + {{- if .Values.extraVolumeMounts }} |
| 100 | + {{- include "harnesscommon.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 10 }} |
| 101 | + {{- end }} |
| 102 | + {{- include "harnesscommon.mountRenderedSecretsAsVolumeMounts" (dict "ctx" $) | indent 10 }} |
| 103 | + {{- end}} |
| 104 | + {{- with .Values.nodeSelector }} |
| 105 | + nodeSelector: |
| 106 | + {{- toYaml . | nindent 8 }} |
| 107 | + {{- end }} |
| 108 | + affinity: |
| 109 | + podAntiAffinity: |
| 110 | + requiredDuringSchedulingIgnoredDuringExecution: |
| 111 | + - labelSelector: |
| 112 | + matchExpressions: |
| 113 | + - key: app |
| 114 | + operator: In |
| 115 | + values: |
| 116 | + - {{ include "mcp-server.name" . }} |
| 117 | + topologyKey: "kubernetes.io/hostname" |
| 118 | + {{- with .Values.tolerations }} |
| 119 | + tolerations: |
| 120 | + {{- toYaml . | nindent 8 }} |
| 121 | + {{- end }} |
| 122 | + volumes: |
| 123 | + {{- if .Values.extraVolumes }} |
| 124 | + {{- include "harnesscommon.tplvalues.render" ( dict "value" .Values.extraVolumes "context" $ ) | nindent 8 }} |
| 125 | + {{- end }} |
| 126 | + {{- include "harnesscommon.renderSecretsAsVolumes" (dict "ctx" $) | indent 8 }} |
0 commit comments