added repo
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "grafana-mcp.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "grafana-mcp.fullname" -}}
|
||||
{{- if .Values.fullnameOverride }}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride }}
|
||||
{{- if contains $name .Release.Name }}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "grafana-mcp.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account
|
||||
*/}}
|
||||
{{- define "grafana-mcp.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create }}
|
||||
{{- default (include "grafana-mcp.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else }}
|
||||
{{- default "default" .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{/*
|
||||
Allow the release namespace to be overridden for multi-namespace deployments in combined charts
|
||||
*/}}
|
||||
{{- define "grafana-mcp.namespace" -}}
|
||||
{{- if .Values.namespaceOverride }}
|
||||
{{- .Values.namespaceOverride }}
|
||||
{{- else }}
|
||||
{{- .Release.Namespace }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "grafana-mcp.labels" -}}
|
||||
helm.sh/chart: {{ include "grafana-mcp.chart" . }}
|
||||
{{ include "grafana-mcp.selectorLabels" . }}
|
||||
{{- if or .Chart.AppVersion .Values.image.tag }}
|
||||
app.kubernetes.io/version: {{ mustRegexReplaceAllLiteral "@sha.*" .Values.image.tag "" | default .Chart.AppVersion | trunc 63 | trimSuffix "-" | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.extraLabels }}
|
||||
{{ toYaml . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "grafana-mcp.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "grafana-mcp.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
|
||||
{{/*
|
||||
Formats imagePullSecrets. Input is (dict "root" . "imagePullSecrets" .{specific imagePullSecrets})
|
||||
*/}}
|
||||
{{- define "grafana.imagePullSecrets" -}}
|
||||
{{- $root := .root }}
|
||||
{{- range (concat .root.Values.global.imagePullSecrets .imagePullSecrets) }}
|
||||
{{- if eq (typeOf .) "map[string]interface {}" }}
|
||||
- {{ toYaml (dict "name" (tpl .name $root)) | trim }}
|
||||
{{- else }}
|
||||
- name: {{ tpl . $root }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,190 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "grafana-mcp.fullname" . }}
|
||||
namespace: {{ include "grafana-mcp.namespace" . }}
|
||||
labels:
|
||||
{{- include "grafana-mcp.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: mcp-server
|
||||
{{- with .Values.labels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
replicas: {{ .Values.replicas }}
|
||||
revisionHistoryLimit: {{ .Values.revisionHistoryLimit | default 10 }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "grafana-mcp.selectorLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: mcp-server
|
||||
{{- with .Values.deploymentStrategy }}
|
||||
strategy:
|
||||
{{- toYaml . | trim | nindent 4 }}
|
||||
{{- end }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "grafana-mcp.selectorLabels" . | nindent 8 }}
|
||||
app.kubernetes.io/component: mcp-server
|
||||
{{- with .Values.podLabels }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
annotations:
|
||||
{{- with .Values.podAnnotations }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "grafana-mcp.serviceAccountName" . }}
|
||||
automountServiceAccountToken: {{ .Values.automountServiceAccountToken }}
|
||||
{{- with .Values.hostAliases }}
|
||||
hostAliases:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.securityContext }}
|
||||
securityContext:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.priorityClassName }}
|
||||
priorityClassName: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .Values.runtimeClassName }}
|
||||
runtimeClassName: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .Values.schedulerName }}
|
||||
schedulerName: {{ . }}
|
||||
{{- end }}
|
||||
{{- if or .Values.initContainers .Values.extraInitContainers }}
|
||||
initContainers:
|
||||
{{- with .Values.initContainers }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.extraInitContainers }}
|
||||
{{- tpl (toYaml .) $ | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: mcp-grafana
|
||||
{{- $registry := .Values.image.registry -}}
|
||||
{{- if $registry }}
|
||||
image: "{{ $registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||
{{- else }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||
{{- end }}
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
{{- with .Values.readinessProbe }}
|
||||
readinessProbe:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with .Values.livenessProbe }}
|
||||
livenessProbe:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with .Values.startupProbe }}
|
||||
startupProbe:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with .Values.containerSecurityContext }}
|
||||
securityContext:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: mcp-http
|
||||
containerPort: {{ .Values.service.port }}
|
||||
protocol: TCP
|
||||
env:
|
||||
- name: GRAFANA_URL
|
||||
value: {{ .Values.grafana.url | quote }}
|
||||
{{- if or .Values.grafana.apiKey .Values.grafana.apiKeySecret.name }}
|
||||
- name: GRAFANA_SERVICE_ACCOUNT_TOKEN
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
{{- if .Values.grafana.apiKey }}
|
||||
name: {{ include "grafana-mcp.fullname" . }}
|
||||
key: api-key
|
||||
{{- else }}
|
||||
name: {{ .Values.grafana.apiKeySecret.name }}
|
||||
key: {{ .Values.grafana.apiKeySecret.key }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- range $key, $value := .Values.env }}
|
||||
- name: {{ $key | quote }}
|
||||
value: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- range $key, $value := .Values.envValueFrom }}
|
||||
- name: {{ $key | quote }}
|
||||
valueFrom:
|
||||
{{- toYaml $value | nindent 16 }}
|
||||
{{- end }}
|
||||
{{- with .Values.envFrom }}
|
||||
envFrom:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if or (.Values.debug) (.Values.metrics.enabled) (.Values.disabledCategories) (.Values.extraArgs) }}
|
||||
args:
|
||||
{{- if .Values.debug }}
|
||||
- -debug
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.enabled }}
|
||||
- --metrics
|
||||
{{- end }}
|
||||
{{- range .Values.disabledCategories }}
|
||||
- --disable-{{ . }}
|
||||
{{- end }}
|
||||
{{- with .Values.extraArgs }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- else -}}
|
||||
{{- with .Values.extraArgs }}
|
||||
args:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .Values.lifecycle }}
|
||||
lifecycle:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with .Values.resources }}
|
||||
resources:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with .Values.volumeMounts }}
|
||||
volumeMounts:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with .Values.extraContainers }}
|
||||
{{- tpl (toYaml .) $ | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.volumes }}
|
||||
volumes:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.topologySpreadConstraints }}
|
||||
topologySpreadConstraints:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.dnsPolicy }}
|
||||
dnsPolicy: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .Values.dnsConfig }}
|
||||
dnsConfig:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,27 @@
|
||||
{{- if .Values.externalSecret.enabled }}
|
||||
apiVersion: external-secrets.io/v1
|
||||
kind: ExternalSecret
|
||||
metadata:
|
||||
name: {{ .Values.externalSecret.secretName | default (printf "%s-vault" (include "grafana-mcp.fullname" .)) }}
|
||||
namespace: {{ include "grafana-mcp.namespace" . }}
|
||||
labels:
|
||||
{{- include "grafana-mcp.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
argocd.argoproj.io/sync-wave: "-5"
|
||||
spec:
|
||||
refreshInterval: {{ .Values.externalSecret.refreshInterval | default "0" | quote }}
|
||||
secretStoreRef:
|
||||
kind: ClusterSecretStore
|
||||
name: {{ .Values.externalSecret.secretStoreRef | default "vault-backend" }}
|
||||
target:
|
||||
name: {{ .Values.externalSecret.secretName | default (printf "%s-vault" (include "grafana-mcp.fullname" .)) }}
|
||||
creationPolicy: Owner
|
||||
deletionPolicy: Retain
|
||||
dataFrom:
|
||||
- extract:
|
||||
conversionStrategy: Default
|
||||
key: {{ .Values.externalSecret.path }}
|
||||
{{- with .Values.externalSecret.version }}
|
||||
version: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,36 @@
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
{{- if .Values.createContourGateway -}}
|
||||
{{- if or (eq "contour-internal" .Values.ingress.ingressClassName) (eq "contour-external" .Values.ingress.ingressClassName) (eq "contour-internal-0" .Values.ingress.ingressClassName) (eq "contour-internal-1" .Values.ingress.ingressClassName) (eq "contour-external-0" .Values.ingress.ingressClassName) (eq "contour-external-1" .Values.ingress.ingressClassName) }}
|
||||
{{- $serviceName := include "grafana-mcp.fullname" . -}}
|
||||
{{- $servicePortNumber := .Values.ingress.servicePortNumber | default .Values.service.port -}}
|
||||
apiVersion: projectcontour.io/v1
|
||||
kind: HTTPProxy
|
||||
metadata:
|
||||
namespace: {{ include "grafana-mcp.namespace" . }}
|
||||
name: {{ $serviceName }}
|
||||
labels:
|
||||
{{- include "grafana-mcp.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
projectcontour.io/ingress.class: {{ .Values.ingress.ingressClassName }}
|
||||
spec:
|
||||
ingressClassName: {{ .Values.ingress.ingressClassName }}
|
||||
routes:
|
||||
- services:
|
||||
- name: {{ $serviceName }}
|
||||
port: {{ $servicePortNumber }}
|
||||
{{- if .Values.ingress.slowStart.enabled }}
|
||||
slowStartPolicy:
|
||||
window: {{ .Values.ingress.slowStart.window }}
|
||||
aggression: {{ .Values.ingress.slowStart.aggression | float64 | squote }}
|
||||
minWeightPercent: {{ .Values.ingress.slowStart.minPercent }}
|
||||
{{- end }}
|
||||
{{- if .Values.ingress.enableWebsocket }}
|
||||
enableWebsockets: true
|
||||
{{- end }}
|
||||
{{- if .Values.contourResponseTimeout }}
|
||||
timeoutPolicy:
|
||||
response: {{ .Values.contourResponseTimeout | quote }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,46 @@
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
{{- if .Values.createContourGateway -}}
|
||||
{{- if or (eq "contour-internal" .Values.ingress.ingressClassName) (eq "contour-internal-0" .Values.ingress.ingressClassName) (eq "contour-internal-1" .Values.ingress.ingressClassName) }}
|
||||
{{- $serviceName := include "grafana-mcp.fullname" . -}}
|
||||
{{- $servicePortNumber := .Values.ingress.servicePortNumber | default .Values.service.port -}}
|
||||
|
||||
{{- $intraIngressClass := "" -}}
|
||||
{{- if eq .Values.ingress.ingressClassName "contour-internal" -}}
|
||||
{{- $intraIngressClass = "contour-internal-intra" -}}
|
||||
{{- else if eq .Values.ingress.ingressClassName "contour-internal-0" -}}
|
||||
{{- $intraIngressClass = "contour-internal-intra-0" -}}
|
||||
{{- else if eq .Values.ingress.ingressClassName "contour-internal-1" -}}
|
||||
{{- $intraIngressClass = "contour-internal-intra-1" -}}
|
||||
{{- end -}}
|
||||
|
||||
apiVersion: projectcontour.io/v1
|
||||
kind: HTTPProxy
|
||||
metadata:
|
||||
namespace: {{ include "grafana-mcp.namespace" . }}
|
||||
name: {{ $serviceName }}-intra
|
||||
labels:
|
||||
{{- include "grafana-mcp.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
projectcontour.io/ingress.class: {{ $intraIngressClass }}
|
||||
spec:
|
||||
ingressClassName: {{ $intraIngressClass }}
|
||||
routes:
|
||||
- services:
|
||||
- name: {{ $serviceName }}
|
||||
port: {{ $servicePortNumber }}
|
||||
{{- if .Values.ingress.slowStart.enabled }}
|
||||
slowStartPolicy:
|
||||
window: {{ .Values.ingress.slowStart.window }}
|
||||
aggression: {{ .Values.ingress.slowStart.aggression | float64 | squote }}
|
||||
minWeightPercent: {{ .Values.ingress.slowStart.minPercent }}
|
||||
{{- end }}
|
||||
{{- if .Values.ingress.enableWebsocket }}
|
||||
enableWebsockets: true
|
||||
{{- end }}
|
||||
{{- if .Values.contourResponseTimeout }}
|
||||
timeoutPolicy:
|
||||
response: {{ .Values.contourResponseTimeout | quote }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,48 @@
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
{{- if .Values.createContourGateway -}}
|
||||
{{- if or (eq "contour-internal" .Values.ingress.ingressClassName) (eq "contour-internal-0" .Values.ingress.ingressClassName) (eq "contour-internal-1" .Values.ingress.ingressClassName) }}
|
||||
{{- $serviceName := include "grafana-mcp.fullname" . -}}
|
||||
{{- $namespace := include "grafana-mcp.namespace" . -}}
|
||||
|
||||
{{- $intraIngressClass := "" -}}
|
||||
{{- if eq .Values.ingress.ingressClassName "contour-internal" -}}
|
||||
{{- $intraIngressClass = "contour-internal-intra" -}}
|
||||
{{- else if eq .Values.ingress.ingressClassName "contour-internal-0" -}}
|
||||
{{- $intraIngressClass = "contour-internal-intra-0" -}}
|
||||
{{- else if eq .Values.ingress.ingressClassName "contour-internal-1" -}}
|
||||
{{- $intraIngressClass = "contour-internal-intra-1" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ $count := 0 | int }}
|
||||
{{- range .Values.ingress.hosts }}
|
||||
apiVersion: projectcontour.io/v1
|
||||
kind: HTTPProxy
|
||||
metadata:
|
||||
namespace: {{ $namespace }}
|
||||
name: {{ $serviceName }}-intra-{{ $count }}
|
||||
labels:
|
||||
{{- include "grafana-mcp.labels" $ | nindent 4 }}
|
||||
annotations:
|
||||
projectcontour.io/ingress.class: {{ $intraIngressClass }}
|
||||
spec:
|
||||
ingressClassName: {{ $intraIngressClass }}
|
||||
virtualhost:
|
||||
fqdn: "{{ .host }}"
|
||||
includes:
|
||||
{{- range .paths }}
|
||||
- conditions:
|
||||
{{- if or (eq (lower .pathType) "prefix") (eq (lower .pathType) "implementationspecific") }}
|
||||
- prefix: {{ .path }}
|
||||
{{- end }}
|
||||
{{- if eq (lower .pathType) "exact" }}
|
||||
- exact: {{ .path }}
|
||||
{{- end }}
|
||||
name: {{ $serviceName }}-intra
|
||||
namespace: {{ $namespace }}
|
||||
{{- end }}
|
||||
---
|
||||
{{ $count = add1 $count }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,39 @@
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
{{- if .Values.createContourGateway -}}
|
||||
{{- if or (eq "contour-internal" .Values.ingress.ingressClassName) (eq "contour-external" .Values.ingress.ingressClassName) (eq "contour-internal-0" .Values.ingress.ingressClassName) (eq "contour-internal-1" .Values.ingress.ingressClassName) (eq "contour-external-0" .Values.ingress.ingressClassName) (eq "contour-external-1" .Values.ingress.ingressClassName) }}
|
||||
{{- $serviceName := include "grafana-mcp.fullname" . -}}
|
||||
{{- $namespace := include "grafana-mcp.namespace" . -}}
|
||||
{{- $ingressClassName := .Values.ingress.ingressClassName -}}
|
||||
{{ $count := 0 | int }}
|
||||
{{- range .Values.ingress.hosts }}
|
||||
apiVersion: projectcontour.io/v1
|
||||
kind: HTTPProxy
|
||||
metadata:
|
||||
namespace: {{ $namespace }}
|
||||
name: {{ $serviceName }}-{{ $count }}
|
||||
labels:
|
||||
{{- include "grafana-mcp.labels" $ | nindent 4 }}
|
||||
annotations:
|
||||
projectcontour.io/ingress.class: {{ $ingressClassName }}
|
||||
spec:
|
||||
ingressClassName: {{ $ingressClassName }}
|
||||
virtualhost:
|
||||
fqdn: "{{ .host }}"
|
||||
includes:
|
||||
{{- range .paths }}
|
||||
- conditions:
|
||||
{{- if or (eq (lower .pathType) "prefix") (eq (lower .pathType) "implementationspecific") }}
|
||||
- prefix: {{ .path }}
|
||||
{{- end }}
|
||||
{{- if eq (lower .pathType) "exact" }}
|
||||
- exact: {{ .path }}
|
||||
{{- end }}
|
||||
name: {{ $serviceName }}
|
||||
namespace: {{ $namespace }}
|
||||
{{- end }}
|
||||
---
|
||||
{{ $count = add1 $count }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,51 @@
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
{{- if or (eq "nginx-internal" .Values.ingress.ingressClassName) (eq "nginx-external" .Values.ingress.ingressClassName) -}}
|
||||
{{- $fullName := include "grafana-mcp.fullname" . }}
|
||||
{{- $svcPort := .Values.ingress.servicePortNumber | default .Values.service.port }}
|
||||
{{- if and .Values.ingress.ingressClassName (not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class")) }}
|
||||
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.ingressClassName}}
|
||||
{{- end }}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ $fullName }}
|
||||
namespace: {{ include "grafana-mcp.namespace" . }}
|
||||
labels:
|
||||
{{- include "grafana-mcp.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: mcp-server
|
||||
{{- with .Values.ingress.labels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.ingress.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
ingressClassName: {{ .Values.ingress.ingressClassName }}
|
||||
{{- if .Values.ingress.tls }}
|
||||
tls:
|
||||
{{- range .Values.ingress.tls }}
|
||||
- hosts:
|
||||
{{- range .hosts }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
secretName: {{ .secretName }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- range .Values.ingress.hosts }}
|
||||
- host: {{ .host | quote }}
|
||||
http:
|
||||
paths:
|
||||
{{- range .paths }}
|
||||
- path: {{ .path }}
|
||||
pathType: {{ .pathType }}
|
||||
backend:
|
||||
service:
|
||||
name: {{ $fullName }}
|
||||
port:
|
||||
number: {{ $svcPort }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,16 @@
|
||||
{{- if .Values.grafana.apiKey }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ include "grafana-mcp.fullname" . }}
|
||||
namespace: {{ include "grafana-mcp.namespace" . }}
|
||||
labels:
|
||||
{{- include "grafana-mcp.labels" . | nindent 4 }}
|
||||
{{- with .Values.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
type: Opaque
|
||||
data:
|
||||
api-key: {{ .Values.grafana.apiKey | toString | b64enc }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,55 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "grafana-mcp.fullname" . }}
|
||||
namespace: {{ include "grafana-mcp.namespace" . }}
|
||||
labels:
|
||||
{{- include "grafana-mcp.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: mcp-server
|
||||
{{- with .Values.service.labels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.service.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
{{- if .Values.service.clusterIP }}
|
||||
clusterIP: {{ .Values.service.clusterIP }}
|
||||
{{- end }}
|
||||
{{- if .Values.service.externalIPs }}
|
||||
externalIPs:
|
||||
{{- toYaml .Values.service.externalIPs | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.service.loadBalancerIP }}
|
||||
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
|
||||
{{- end }}
|
||||
{{- if .Values.service.loadBalancerSourceRanges }}
|
||||
loadBalancerSourceRanges:
|
||||
{{- toYaml .Values.service.loadBalancerSourceRanges | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if and (eq .Values.service.type "ExternalName") .Values.service.externalName }}
|
||||
externalName: {{ .Values.service.externalName }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- port: {{ .Values.service.port }}
|
||||
targetPort: mcp-http
|
||||
protocol: TCP
|
||||
name: mcp-http
|
||||
{{- if and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) .Values.service.nodePort }}
|
||||
nodePort: {{ .Values.service.nodePort }}
|
||||
{{- end }}
|
||||
{{- with .Values.service.extraPorts }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
selector:
|
||||
{{- include "grafana-mcp.selectorLabels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: mcp-server
|
||||
{{- with .Values.service.sessionAffinity }}
|
||||
sessionAffinity: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .Values.service.sessionAffinityConfig }}
|
||||
sessionAffinityConfig:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,17 @@
|
||||
{{- if .Values.serviceAccount.create }}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "grafana-mcp.labels" . | nindent 4 }}
|
||||
{{- with .Values.serviceAccount.labels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- tpl (toYaml . | nindent 4) $ }}
|
||||
{{- end }}
|
||||
name: {{ include "grafana-mcp.serviceAccountName" . }}
|
||||
namespace: {{ include "grafana-mcp.namespace" . }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,39 @@
|
||||
{{- if .Values.serviceMonitor.enabled }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: {{ include "grafana-mcp.fullname" . }}
|
||||
namespace: {{ include "grafana-mcp.namespace" . }}
|
||||
labels:
|
||||
{{- include "grafana-mcp.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: mcp-server
|
||||
{{- with .Values.serviceMonitor.labels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.serviceMonitor.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "grafana-mcp.selectorLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: mcp-server
|
||||
endpoints:
|
||||
- port: mcp-http
|
||||
path: {{ .Values.serviceMonitor.path }}
|
||||
interval: {{ .Values.serviceMonitor.interval }}
|
||||
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
|
||||
{{- with .Values.serviceMonitor.relabelings }}
|
||||
relabelings:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.serviceMonitor.metricRelabelings }}
|
||||
metricRelabelings:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.serviceMonitor.namespaceSelector }}
|
||||
namespaceSelector:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user