diff --git a/Dockerfile b/Dockerfile index 0871fed..ca815b2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -137,4 +137,4 @@ COPY --from=downloader /usr/local/bin/helm /opt/bin/helm ARG HELM_DIFF_VERSION ENV HELM_DIFF_VERSION=$HELM_DIFF_VERSION -RUN helm plugin install https://github.com/databus23/helm-diff --version ${HELM_DIFF_VERSION} +RUN helm plugin install https://github.com/databus23/helm-diff --version ${HELM_DIFF_VERSION} --verify=false diff --git a/ansible-roles/helm_charts/files/helmcharts/insideoutmcp/Chart.yaml b/ansible-roles/helm_charts/files/helmcharts/insideoutmcp/Chart.yaml new file mode 100644 index 0000000..176cfa8 --- /dev/null +++ b/ansible-roles/helm_charts/files/helmcharts/insideoutmcp/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +name: insideoutmcp +description: "InsideOut MCP Server (SSE mode)" +version: 0.1.0 +appVersion: "latest" + diff --git a/ansible-roles/helm_charts/files/helmcharts/insideoutmcp/templates/NOTES.txt b/ansible-roles/helm_charts/files/helmcharts/insideoutmcp/templates/NOTES.txt new file mode 100644 index 0000000..b31ebd1 --- /dev/null +++ b/ansible-roles/helm_charts/files/helmcharts/insideoutmcp/templates/NOTES.txt @@ -0,0 +1,20 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ $.Values.mcp.path }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "insideoutmcp.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT{{ .Values.mcp.path }} +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get svc -w {{ include "insideoutmcp.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "insideoutmcp.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }}{{ .Values.mcp.path }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "insideoutmcp.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080{{ .Values.mcp.path }} to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:8080 +{{- end }} + diff --git a/ansible-roles/helm_charts/files/helmcharts/insideoutmcp/templates/_helpers.tpl b/ansible-roles/helm_charts/files/helmcharts/insideoutmcp/templates/_helpers.tpl new file mode 100644 index 0000000..01af770 --- /dev/null +++ b/ansible-roles/helm_charts/files/helmcharts/insideoutmcp/templates/_helpers.tpl @@ -0,0 +1,50 @@ +{{/* vim: set filetype=mustache: */}} + +{{- define "insideoutmcp.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "insideoutmcp.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := include "insideoutmcp.name" . -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{- define "insideoutmcp.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "insideoutmcp.labels" -}} +app.kubernetes.io/name: {{ include "insideoutmcp.name" . }} +helm.sh/chart: {{ include "insideoutmcp.chart" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +app.kubernetes.io/component: mcp-server +{{- if .Values.global.partOf }} +app.kubernetes.io/part-of: {{ .Values.global.partOf }} +{{- end }} +{{- end -}} + +{{- define "insideoutmcp.labels.match" -}} +app.kubernetes.io/name: {{ include "insideoutmcp.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + +{{- define "insideoutmcp.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "insideoutmcp.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end -}} + diff --git a/ansible-roles/helm_charts/files/helmcharts/insideoutmcp/templates/deployment.yaml b/ansible-roles/helm_charts/files/helmcharts/insideoutmcp/templates/deployment.yaml new file mode 100644 index 0000000..23cbf0e --- /dev/null +++ b/ansible-roles/helm_charts/files/helmcharts/insideoutmcp/templates/deployment.yaml @@ -0,0 +1,59 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "insideoutmcp.fullname" . }} + labels: + {{- include "insideoutmcp.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount | default 1 }} + selector: + matchLabels: + {{- include "insideoutmcp.labels.match" . | nindent 6 }} + template: + metadata: + labels: + {{- include "insideoutmcp.labels" . | nindent 8 }} + annotations: + rollout-nonce: {{ .Values.global.forceRedeployNonce | default "" | quote }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "insideoutmcp.serviceAccountName" . }} + containers: + - name: insideoutmcp + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy | default "IfNotPresent" }} + env: + - name: MCP_TRANSPORT + value: {{ .Values.mcp.transport | quote }} + - name: MCP_ADDR + value: {{ .Values.mcp.addr | quote }} + - name: MCP_PATH + value: {{ .Values.mcp.path | quote }} + - name: INSIDEOUT_BASE_URL + value: {{ .Values.mcp.baseUrl | quote }} + {{- range $k, $v := .Values.env }} + - name: {{ $k }} + value: {{ $v | quote }} + {{- end }} + ports: + - name: http + containerPort: 8080 + protocol: TCP + readinessProbe: + httpGet: + path: /healthz + port: 8080 + initialDelaySeconds: 5 + periodSeconds: 10 + livenessProbe: + httpGet: + path: /healthz + port: 8080 + initialDelaySeconds: 15 + periodSeconds: 20 + resources: + {{- toYaml .Values.resources | nindent 12 }} + diff --git a/ansible-roles/helm_charts/files/helmcharts/insideoutmcp/templates/service.yaml b/ansible-roles/helm_charts/files/helmcharts/insideoutmcp/templates/service.yaml new file mode 100644 index 0000000..362651e --- /dev/null +++ b/ansible-roles/helm_charts/files/helmcharts/insideoutmcp/templates/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "insideoutmcp.fullname" . }} + labels: + {{- include "insideoutmcp.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "insideoutmcp.labels.match" . | nindent 4 }} + diff --git a/ansible-roles/helm_charts/files/helmcharts/insideoutmcp/templates/serviceaccount.yaml b/ansible-roles/helm_charts/files/helmcharts/insideoutmcp/templates/serviceaccount.yaml new file mode 100644 index 0000000..5ea15fe --- /dev/null +++ b/ansible-roles/helm_charts/files/helmcharts/insideoutmcp/templates/serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "insideoutmcp.serviceAccountName" . }} + labels: + {{- include "insideoutmcp.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end -}} + diff --git a/ansible-roles/helm_charts/files/helmcharts/insideoutmcp/values.yaml b/ansible-roles/helm_charts/files/helmcharts/insideoutmcp/values.yaml new file mode 100644 index 0000000..cc338fe --- /dev/null +++ b/ansible-roles/helm_charts/files/helmcharts/insideoutmcp/values.yaml @@ -0,0 +1,47 @@ +global: + partOf: app + +replicaCount: 1 + +image: + repository: luthersystems/insideout-mcp + tag: latest + pullPolicy: IfNotPresent + +mcp: + transport: "http" + addr: ":8080" + path: "/mcp" + baseUrl: "https://insideout.luthersystemsapp.com" + +# Environment variables for the insideout-mcp server +env: + MCP_VERBOSE: "true" + MCP_DEVTOOLS_ENABLED: "false" + +service: + type: ClusterIP + port: 80 + targetPort: 8080 + +resources: {} +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" +nodeSelector: {} +tolerations: [] +affinity: [] + +serviceAccount: + create: true + annotations: {} + name: "" + +ingress: + enabled: false + annotations: {} + hosts: + - host: chart-example.local + paths: [] + tls: [] +