|
| 1 | +{{- if .Values.mcpServer.enabled }} |
| 2 | +apiVersion: apps/v1 |
| 3 | +kind: Deployment |
| 4 | +metadata: |
| 5 | + name: {{ include "grafana.fullname" . }}-mcp |
| 6 | + namespace: {{ include "grafana.namespace" . }} |
| 7 | + labels: |
| 8 | + {{- include "grafana.labels" . | nindent 4 }} |
| 9 | + app.kubernetes.io/component: mcp-server |
| 10 | + {{- with .Values.mcpServer.labels }} |
| 11 | + {{- toYaml . | nindent 4 }} |
| 12 | + {{- end }} |
| 13 | + {{- with .Values.mcpServer.annotations }} |
| 14 | + annotations: |
| 15 | + {{- toYaml . | nindent 4 }} |
| 16 | + {{- end }} |
| 17 | +spec: |
| 18 | + replicas: {{ .Values.mcpServer.replicas }} |
| 19 | + revisionHistoryLimit: {{ .Values.mcpServer.revisionHistoryLimit | default 10 }} |
| 20 | + selector: |
| 21 | + matchLabels: |
| 22 | + {{- include "grafana.selectorLabels" . | nindent 6 }} |
| 23 | + app.kubernetes.io/component: mcp-server |
| 24 | + {{- with .Values.mcpServer.deploymentStrategy }} |
| 25 | + strategy: |
| 26 | + {{- toYaml . | trim | nindent 4 }} |
| 27 | + {{- end }} |
| 28 | + template: |
| 29 | + metadata: |
| 30 | + labels: |
| 31 | + {{- include "grafana.labels" . | nindent 8 }} |
| 32 | + app.kubernetes.io/component: mcp-server |
| 33 | + {{- with .Values.mcpServer.podLabels }} |
| 34 | + {{- toYaml . | nindent 8 }} |
| 35 | + {{- end }} |
| 36 | + annotations: |
| 37 | + {{- with .Values.mcpServer.podAnnotations }} |
| 38 | + {{- toYaml . | nindent 8 }} |
| 39 | + {{- end }} |
| 40 | + spec: |
| 41 | + {{- with .Values.mcpServer.imagePullSecrets }} |
| 42 | + imagePullSecrets: |
| 43 | + {{- toYaml . | nindent 8 }} |
| 44 | + {{- end }} |
| 45 | + serviceAccountName: {{ include "grafana.serviceAccountName" . }} |
| 46 | + automountServiceAccountToken: {{ .Values.mcpServer.automountServiceAccountToken }} |
| 47 | + {{- with .Values.mcpServer.hostAliases }} |
| 48 | + hostAliases: |
| 49 | + {{- toYaml . | nindent 8 }} |
| 50 | + {{- end }} |
| 51 | + {{- with .Values.mcpServer.securityContext }} |
| 52 | + securityContext: |
| 53 | + {{- toYaml . | nindent 8 }} |
| 54 | + {{- end }} |
| 55 | + {{- with .Values.mcpServer.priorityClassName }} |
| 56 | + priorityClassName: {{ . }} |
| 57 | + {{- end }} |
| 58 | + {{- with .Values.mcpServer.runtimeClassName }} |
| 59 | + runtimeClassName: {{ . }} |
| 60 | + {{- end }} |
| 61 | + {{- with .Values.mcpServer.schedulerName }} |
| 62 | + schedulerName: {{ . }} |
| 63 | + {{- end }} |
| 64 | + {{- if or .Values.mcpServer.initContainers .Values.mcpServer.extraInitContainers }} |
| 65 | + initContainers: |
| 66 | + {{- with .Values.mcpServer.initContainers }} |
| 67 | + {{- toYaml . | nindent 8 }} |
| 68 | + {{- end }} |
| 69 | + {{- with .Values.mcpServer.extraInitContainers }} |
| 70 | + {{- tpl (toYaml .) $ | nindent 8 }} |
| 71 | + {{- end }} |
| 72 | + {{- end }} |
| 73 | + containers: |
| 74 | + - name: mcp-grafana |
| 75 | + {{- $registry := .Values.global.imageRegistry | default .Values.mcpServer.image.registry -}} |
| 76 | + {{- if $registry }} |
| 77 | + image: "{{ $registry }}/{{ .Values.mcpServer.image.repository }}:{{ .Values.mcpServer.image.tag | default .Chart.AppVersion }}" |
| 78 | + {{- else }} |
| 79 | + image: "{{ .Values.mcpServer.image.repository }}:{{ .Values.mcpServer.image.tag | default .Chart.AppVersion }}" |
| 80 | + {{- end }} |
| 81 | + imagePullPolicy: {{ .Values.mcpServer.image.pullPolicy }} |
| 82 | + {{- with .Values.mcpServer.containerSecurityContext }} |
| 83 | + securityContext: |
| 84 | + {{- toYaml . | nindent 12 }} |
| 85 | + {{- end }} |
| 86 | + ports: |
| 87 | + - name: mcp-http |
| 88 | + containerPort: {{ .Values.mcpServer.service.port }} |
| 89 | + protocol: TCP |
| 90 | + env: |
| 91 | + - name: GRAFANA_URL |
| 92 | + value: {{ .Values.mcpServer.grafana.url | quote }} |
| 93 | + - name: GRAFANA_API_KEY |
| 94 | + valueFrom: |
| 95 | + secretKeyRef: |
| 96 | + name: {{ .Values.mcpServer.grafana.apiKeySecret.name }} |
| 97 | + key: {{ .Values.mcpServer.grafana.apiKeySecret.key }} |
| 98 | + {{- range $key, $value := .Values.mcpServer.env }} |
| 99 | + - name: {{ $key | quote }} |
| 100 | + value: {{ $value | quote }} |
| 101 | + {{- end }} |
| 102 | + {{- range $key, $value := .Values.mcpServer.envValueFrom }} |
| 103 | + - name: {{ $key | quote }} |
| 104 | + valueFrom: |
| 105 | + {{- toYaml $value | nindent 16 }} |
| 106 | + {{- end }} |
| 107 | + {{- with .Values.mcpServer.envFrom }} |
| 108 | + envFrom: |
| 109 | + {{- toYaml . | nindent 12 }} |
| 110 | + {{- end }} |
| 111 | + args: |
| 112 | + {{- if .Values.mcpServer.debug }} |
| 113 | + - -debug |
| 114 | + {{- end }} |
| 115 | + {{- range .Values.mcpServer.disabledCategories }} |
| 116 | + - --disable-{{ . }} |
| 117 | + {{- end }} |
| 118 | + {{- with .Values.mcpServer.extraArgs }} |
| 119 | + {{- toYaml . | nindent 12 }} |
| 120 | + {{- end }} |
| 121 | + {{- with .Values.mcpServer.lifecycle }} |
| 122 | + lifecycle: |
| 123 | + {{- toYaml . | nindent 12 }} |
| 124 | + {{- end }} |
| 125 | + {{- with .Values.mcpServer.resources }} |
| 126 | + resources: |
| 127 | + {{- toYaml . | nindent 12 }} |
| 128 | + {{- end }} |
| 129 | + {{- with .Values.mcpServer.volumeMounts }} |
| 130 | + volumeMounts: |
| 131 | + {{- toYaml . | nindent 12 }} |
| 132 | + {{- end }} |
| 133 | + {{- with .Values.mcpServer.extraContainers }} |
| 134 | + {{- tpl (toYaml .) $ | nindent 8 }} |
| 135 | + {{- end }} |
| 136 | + {{- with .Values.mcpServer.volumes }} |
| 137 | + volumes: |
| 138 | + {{- toYaml . | nindent 8 }} |
| 139 | + {{- end }} |
| 140 | + {{- with .Values.mcpServer.nodeSelector }} |
| 141 | + nodeSelector: |
| 142 | + {{- toYaml . | nindent 8 }} |
| 143 | + {{- end }} |
| 144 | + {{- with .Values.mcpServer.affinity }} |
| 145 | + affinity: |
| 146 | + {{- toYaml . | nindent 8 }} |
| 147 | + {{- end }} |
| 148 | + {{- with .Values.mcpServer.topologySpreadConstraints }} |
| 149 | + topologySpreadConstraints: |
| 150 | + {{- toYaml . | nindent 8 }} |
| 151 | + {{- end }} |
| 152 | + {{- with .Values.mcpServer.tolerations }} |
| 153 | + tolerations: |
| 154 | + {{- toYaml . | nindent 8 }} |
| 155 | + {{- end }} |
| 156 | + {{- with .Values.mcpServer.dnsPolicy }} |
| 157 | + dnsPolicy: {{ . }} |
| 158 | + {{- end }} |
| 159 | + {{- with .Values.mcpServer.dnsConfig }} |
| 160 | + dnsConfig: |
| 161 | + {{- toYaml . | nindent 8 }} |
| 162 | + {{- end }} |
| 163 | +{{- end }} |
0 commit comments