From 16db5bbef2e9e441542751b7c8844effceba168b Mon Sep 17 00:00:00 2001 From: sHa Date: Sat, 18 Apr 2026 18:21:55 +0300 Subject: [PATCH] feat: Add initial Helm chart for Home Assistant MCP server --- ha-mcp/Chart.yaml | 9 ++++++ ha-mcp/templates/deployment.yaml | 51 ++++++++++++++++++++++++++++++++ ha-mcp/templates/ingress.yaml | 27 +++++++++++++++++ ha-mcp/templates/service.yaml | 16 ++++++++++ ha-mcp/values.yaml | 35 ++++++++++++++++++++++ 5 files changed, 138 insertions(+) create mode 100644 ha-mcp/Chart.yaml create mode 100644 ha-mcp/templates/deployment.yaml create mode 100644 ha-mcp/templates/ingress.yaml create mode 100644 ha-mcp/templates/service.yaml create mode 100644 ha-mcp/values.yaml diff --git a/ha-mcp/Chart.yaml b/ha-mcp/Chart.yaml new file mode 100644 index 0000000..2a8d844 --- /dev/null +++ b/ha-mcp/Chart.yaml @@ -0,0 +1,9 @@ +apiVersion: v2 +name: ha-mcp +description: Home Assistant MCP server Helm chart +type: application +version: 0.1.0 +appVersion: "7.1.0" +annotations: + version-source: github-release:homeassistant-ai/ha-mcp + version-pattern: "s|^v||" diff --git a/ha-mcp/templates/deployment.yaml b/ha-mcp/templates/deployment.yaml new file mode 100644 index 0000000..07072ca --- /dev/null +++ b/ha-mcp/templates/deployment.yaml @@ -0,0 +1,51 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }} + labels: + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} + app.kubernetes.io/component: mcp + app.kubernetes.io/part-of: home-automation + annotations: + version-source: {{ index .Chart.Annotations "version-source" }} + version-pattern: {{ index .Chart.Annotations "version-pattern" | quote }} +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }} + spec: + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- with .Values.command }} + command: + {{- toYaml . | nindent 12 }} + {{- end }} + ports: + - containerPort: {{ .Values.port }} + name: http + protocol: TCP + env: + {{- range $key, $value := .Values.env }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + {{- range .Values.secretEnvKeys }} + - name: {{ .envName }} + valueFrom: + secretKeyRef: + name: {{ $.Values.existingSecret }} + key: {{ .secretKey }} + {{- end }} + resources: + {{- toYaml .Values.resources | nindent 12 }} diff --git a/ha-mcp/templates/ingress.yaml b/ha-mcp/templates/ingress.yaml new file mode 100644 index 0000000..6a80701 --- /dev/null +++ b/ha-mcp/templates/ingress.yaml @@ -0,0 +1,27 @@ +{{- range $name, $config := .Values.ingresses }} +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ $.Release.Name }}-{{ $name }} + {{- with $config.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + rules: + - host: {{ $config.host }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ $.Release.Name }} + port: + number: {{ $.Values.port }} + {{- with $config.tls }} + tls: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/ha-mcp/templates/service.yaml b/ha-mcp/templates/service.yaml new file mode 100644 index 0000000..cff6060 --- /dev/null +++ b/ha-mcp/templates/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }} + labels: + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} +spec: + type: ClusterIP + selector: + app: {{ .Release.Name }} + ports: + - name: http + port: {{ .Values.port }} + targetPort: http + protocol: TCP diff --git a/ha-mcp/values.yaml b/ha-mcp/values.yaml new file mode 100644 index 0000000..9fe532e --- /dev/null +++ b/ha-mcp/values.yaml @@ -0,0 +1,35 @@ +image: + repository: ghcr.io/homeassistant-ai/ha-mcp + pullPolicy: IfNotPresent + +command: ["ha-mcp-web"] + +port: 8086 + +existingSecret: "" +secretEnvKeys: [] + # - envName: HOMEASSISTANT_URL + # secretKey: HOMEASSISTANT_URL + # - envName: HOMEASSISTANT_TOKEN + # secretKey: HOMEASSISTANT_TOKEN + +env: {} + +resources: + requests: + cpu: "50m" + memory: "128Mi" + limits: + cpu: "500m" + memory: "512Mi" + +ingresses: {} + # https: + # host: ha.mcp.example.com + # annotations: {} + # tls: + # - hosts: + # - ha.mcp.example.com + # lan: + # host: ha.mcp.lan + # annotations: {}