Skip to content

Commit 6bc39f5

Browse files
prachi-shah-harnessHarness
authored andcommitted
feat: [ML-1255]: add manifest file for mcp-server (#196)
* 9a92c2 fix acm * 10498e code format * 7f788f Merge remote-tracking branch 'origin/master' into add-manifest-file * e90ceb resolve conflicts * 89ed04 Apply suggestion from code review * 41754a fix lint error * 113d17 make replicacount 3 * 8df7e0 make replicacount 3 * 6fbe5c remove duplicate flag * 2052db final updates * df5f61 remove duplicate keys from values.yaml * b53446 add pipeline service specific flags * a7743e add pipeline service specific flags * e0fe68 add pipeline service specific flags * aff5f8 add session affinity * 5baf3e correct the command * 8f2d66 tempcommit * 6c3eb4 change param value * ac8931 change param value * 06f3ea change param value * 70f559 change desc and resolve other review comments * 79b2ca add runtime arg to run in http mode * 4e4005 fix helm chart build issues * 9bf735 fix typing error * 089f53 modify manifest file and remove extra folder in between * 1b60be add helm charts * 7e10df feat: [ML-1255]: add manifest file for mcp-se
1 parent b6fa5a0 commit 6bc39f5

File tree

17 files changed

+868
-6
lines changed

17 files changed

+868
-6
lines changed

chart/Chart.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
apiVersion: v2
2+
name: mcp-server
3+
description: A Helm chart for the Harness MCP Server
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 0.1.0
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
# It is recommended to use it with quotes.
24+
appVersion: "1.1.0"
25+
dependencies:
26+
- name: harness-common
27+
version: 1.x.x
28+
repository: https://harness.github.io/helm-common

chart/templates/_helpers.tpl

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "mcp-server.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "mcp-server.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "mcp-server.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "mcp-server.labels" -}}
37+
helm.sh/chart: {{ include "mcp-server.chart" . }}
38+
{{ include "mcp-server.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "mcp-server.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "mcp-server.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "mcp-server.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "mcp-server.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
63+
64+
{{/*
65+
Helper function for pullSecrets at chart level or global level.
66+
*/}}
67+
{{- define "mcp-server.pullSecrets" -}}
68+
{{- if .Values.waitForInitContainer }}
69+
{{ include "common.images.pullSecrets" (dict "images" (list .Values.image .Values.waitForInitContainer.image) "global" .Values.global ) }}
70+
{{- else }}
71+
{{ include "common.images.pullSecrets" (dict "images" (list .Values.image .Values.global.waitForInitContainer.image) "global" .Values.global ) }}
72+
{{- end }}
73+
{{- end -}}

chart/templates/config.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: v1
2+
kind: ConfigMap
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+
data:
14+
{{- include "harnesscommon.tplvalues.render" ( dict "value" .Values.config "context" $) | nindent 2}}

chart/templates/deployment.yaml

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
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 }}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{{- if eq (include "harnesscommon.secrets.hasESOSecrets" (dict "secretsCtx" .Values.secrets)) "true" }}
2+
{{- $localESOSecretIdentifier := (include "harnesscommon.secrets.localESOSecretCtxIdentifier" (dict "ctx" $ )) }}
3+
{{ include "harnesscommon.secrets.generateExternalSecret" (dict "secretsCtx" .Values.secrets "secretNamePrefix" $localESOSecretIdentifier) }}
4+
{{- print "\n---" }}
5+
{{- end }}

chart/templates/hpa.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{- include "harnesscommon.hpa.renderHPA" (dict "ctx" $ "kind" "deployment") }}

chart/templates/ingress.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{- include "harnesscommon.v1.renderIngress" (dict "ctx" $) }}

chart/templates/pdb.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{{- if and .Values.pdb.create }}
2+
apiVersion: policy/v1
3+
kind: PodDisruptionBudget
4+
metadata:
5+
name: {{ include "mcp-server.name" . }}
6+
namespace: {{ .Release.Namespace }}
7+
labels:
8+
{{- include "mcp-server.labels" . | nindent 4 }}
9+
{{- if .Values.global.commonLabels }}
10+
{{- include "harnesscommon.tplvalues.render" ( dict "value" .Values.global.commonLabels "context" $ ) | nindent 4 }}
11+
{{- end }}
12+
{{- if .Values.global.commonAnnotations }}
13+
annotations: {{- include "harnesscommon.tplvalues.render" ( dict "value" .Values.global.commonAnnotations "context" $ ) | nindent 4 }}
14+
{{- end }}
15+
spec:
16+
{{- if .Values.pdb.minAvailable }}
17+
minAvailable: {{ .Values.pdb.minAvailable }}
18+
{{- end }}
19+
{{- if .Values.pdb.maxUnavailable }}
20+
maxUnavailable: {{ .Values.pdb.maxUnavailable }}
21+
{{- end }}
22+
selector:
23+
matchLabels:
24+
app: {{ include "mcp-server.name" . }}
25+
{{- end }}

chart/templates/podmonitor.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{ include "harnesscommon.monitoring.podMonitor" (dict "name" "mcp-server" "ctx" $ "label" "app.kubernetes.io/name") }}

chart/templates/secret.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: {{ include "mcp-server.name" . }}
5+
namespace: {{ .Release.Namespace }}
6+
labels:
7+
{{- include "mcp-server.labels" . | nindent 4 }}
8+
{{- if .Values.global.commonLabels }}
9+
{{- include "harnesscommon.tplvalues.render" ( dict "value" .Values.global.commonLabels "context" $ ) | nindent 4 }}
10+
{{- end }}
11+
{{- if .Values.global.commonAnnotations }}
12+
annotations: {{- include "harnesscommon.tplvalues.render" ( dict "value" .Values.global.commonAnnotations "context" $ ) | nindent 4 }}
13+
{{- end }}
14+
type: Opaque
15+
data:
16+
{{- include "harnesscommon.generateSecretsInHelpers" (dict "ctx" $) | indent 2}}

0 commit comments

Comments
 (0)