From 16d9b8d33e140f0c252d15e80e3bdbbf53b68537 Mon Sep 17 00:00:00 2001 From: sHa Date: Sun, 19 Apr 2026 20:34:02 +0300 Subject: [PATCH] feat: Add MikroTik MCP Helm chart with deployment, service, ingress, and values configuration --- mikrotik-mcp/Chart.yaml | 9 ++++ mikrotik-mcp/templates/deployment.yaml | 74 ++++++++++++++++++++++++++ mikrotik-mcp/templates/ingress.yaml | 27 ++++++++++ mikrotik-mcp/templates/service.yaml | 16 ++++++ mikrotik-mcp/values.yaml | 46 ++++++++++++++++ 5 files changed, 172 insertions(+) create mode 100644 mikrotik-mcp/Chart.yaml create mode 100644 mikrotik-mcp/templates/deployment.yaml create mode 100644 mikrotik-mcp/templates/ingress.yaml create mode 100644 mikrotik-mcp/templates/service.yaml create mode 100644 mikrotik-mcp/values.yaml diff --git a/mikrotik-mcp/Chart.yaml b/mikrotik-mcp/Chart.yaml new file mode 100644 index 0000000..41929b8 --- /dev/null +++ b/mikrotik-mcp/Chart.yaml @@ -0,0 +1,9 @@ +apiVersion: v2 +name: mikrotik-mcp +description: MikroTik MCP server Helm chart +type: application +version: 0.1.0 +appVersion: "0.5.0.0" +annotations: + version-source: github-release:jeff-nasseri/mikrotik-mcp + version-pattern: "s|^v||" diff --git a/mikrotik-mcp/templates/deployment.yaml b/mikrotik-mcp/templates/deployment.yaml new file mode 100644 index 0000000..92dacdc --- /dev/null +++ b/mikrotik-mcp/templates/deployment.yaml @@ -0,0 +1,74 @@ +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: network-tools + 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: + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + command: + - sh + - -c + - | + pip install --quiet --no-cache-dir "mcp-server-mikrotik=={{ .Chart.AppVersion }}" + exec mcp-server-mikrotik + 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 }} + livenessProbe: + httpGet: + path: /health + port: http + initialDelaySeconds: 60 + periodSeconds: 15 + failureThreshold: 3 + readinessProbe: + httpGet: + path: /health + port: http + initialDelaySeconds: 30 + periodSeconds: 10 + resources: + {{- toYaml .Values.resources | nindent 12 }} diff --git a/mikrotik-mcp/templates/ingress.yaml b/mikrotik-mcp/templates/ingress.yaml new file mode 100644 index 0000000..6a80701 --- /dev/null +++ b/mikrotik-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/mikrotik-mcp/templates/service.yaml b/mikrotik-mcp/templates/service.yaml new file mode 100644 index 0000000..cff6060 --- /dev/null +++ b/mikrotik-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/mikrotik-mcp/values.yaml b/mikrotik-mcp/values.yaml new file mode 100644 index 0000000..21af051 --- /dev/null +++ b/mikrotik-mcp/values.yaml @@ -0,0 +1,46 @@ +image: + # Uses python:3.11-alpine as base; mcp-server-mikrotik is installed + # from PyPI at container startup using the version from Chart.appVersion. + repository: python + tag: "3.11-alpine" + pullPolicy: IfNotPresent + +port: 8000 + +existingSecret: "" +secretEnvKeys: [] + # - envName: MIKROTIK_HOST + # secretKey: MIKROTIK_HOST + # - envName: MIKROTIK_USERNAME + # secretKey: MIKROTIK_USERNAME + # - envName: MIKROTIK_PASSWORD + # secretKey: MIKROTIK_PASSWORD + +# Additional environment variables (non-secret) +env: + MIKROTIK_MCP__TRANSPORT: "sse" + MIKROTIK_MCP__HOST: "0.0.0.0" + MIKROTIK_MCP__PORT: "8000" + +resources: + requests: + cpu: "50m" + memory: "128Mi" + limits: + cpu: "500m" + memory: "512Mi" + +nodeSelector: {} + +tolerations: [] + +ingresses: {} + # https: + # host: hw5.mcp.example.com + # annotations: {} + # tls: + # - hosts: + # - hw5.mcp.example.com + # lan: + # host: hw5.mcp.hc.lan + # annotations: {}