-
Notifications
You must be signed in to change notification settings - Fork 26
feat: add Helm chart scaffolding and core templates #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
1b45fe1
4537835
be86fbf
df78c28
181dd55
e42b3c8
ed53269
ad06312
a7ee27e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Patterns to ignore when building packages. | ||
| # This supports shell glob matching, relative path matching, and | ||
| # negation (prefixed with !). Only one pattern per line. | ||
| .DS_Store | ||
| # Common VCS dirs | ||
| .git/ | ||
| .gitignore | ||
| .bzr/ | ||
| .bzrignore | ||
| .hg/ | ||
| .hgignore | ||
| .svn/ | ||
| # Common backup files | ||
| *.swp | ||
| *.bak | ||
| *.tmp | ||
| *.orig | ||
| *~ | ||
| # Various IDEs | ||
| .project | ||
| .idea/ | ||
| *.tmproj | ||
| .vscode/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| apiVersion: v2 | ||
| name: mcp-lifecycle-operator-crds | ||
| description: CRDs for the mcp-lifecycle-operator Helm chart | ||
| type: application | ||
| version: 0.1.0 | ||
| appVersion: "v0.1.0" | ||
| kubeVersion: ">= 1.28.0" | ||
| home: https://github.com/kubernetes-sigs/mcp-lifecycle-operator | ||
| sources: | ||
| - https://github.com/kubernetes-sigs/mcp-lifecycle-operator | ||
| keywords: | ||
| - kubernetes | ||
| - operator | ||
| - mcp | ||
| - model-context-protocol | ||
| - crds | ||
| maintainers: | ||
| - name: mcp-lifecycle-operator maintainers | ||
| url: https://github.com/kubernetes-sigs/mcp-lifecycle-operator |
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What would happen if we put the CRD under I understand that keeping it upper level would mean no automatic CRD upgrades with If we put it under templates, we would have automatic CRD upgrade but introduce this deletion risk. I don't have that much Helm experience TBH.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc @ibm-adarsh @Cali0707 @matzew @koksay (Helm expert)?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Helm does not automatically update CRDs during a If you expect frequent CRD updates, I suggest moving them to a separate chart. Otherwise, for a couple of updates a year, you can include in the upgrade doc that users update them manually.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO we should move the CRDs to a separate chart then. Thoughts @aliok ?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're gonna have frequent updates, as the project is new. So, let's do a separate chart for that.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done in f13ce27 — moved the CRD to a separate The CRD is now a regular template in the new chart, so Tested on a kind cluster:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file seems to be out of sync with the CRD in config/crd/bases/mcp.x-k8s.io_mcpservers.yaml.
Can we make sure those are updated as part of
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I want to tackle that sync with #134
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FWIW: in #207 we added a Makefile target which checks if the generated files & manifests are up-to-date. This also runs then in a workflow. |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| # This chart has no configurable values. | ||
| # It installs the CRDs required by mcp-lifecycle-operator. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Patterns to ignore when building packages. | ||
| # This supports shell glob matching, relative path matching, and | ||
| # negation (prefixed with !). Only one pattern per line. | ||
| .DS_Store | ||
| # Common VCS dirs | ||
| .git/ | ||
| .gitignore | ||
| .bzr/ | ||
| .bzrignore | ||
| .hg/ | ||
| .hgignore | ||
| .svn/ | ||
| # Common backup files | ||
| *.swp | ||
| *.bak | ||
| *.tmp | ||
| *.orig | ||
| *~ | ||
| # Various IDEs | ||
| .project | ||
| .idea/ | ||
| *.tmproj | ||
| .vscode/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| apiVersion: v2 | ||
| name: mcp-lifecycle-operator | ||
| description: A Kubernetes operator that provides a declarative API to deploy, manage, and safely roll out MCP Servers | ||
| type: application | ||
| version: 0.1.0 | ||
| appVersion: "v0.1.0" | ||
| kubeVersion: ">= 1.28.0" | ||
| home: https://github.com/kubernetes-sigs/mcp-lifecycle-operator | ||
| sources: | ||
| - https://github.com/kubernetes-sigs/mcp-lifecycle-operator | ||
| keywords: | ||
| - kubernetes | ||
| - operator | ||
| - mcp | ||
| - model-context-protocol | ||
| maintainers: | ||
| - name: mcp-lifecycle-operator maintainers | ||
| url: https://github.com/kubernetes-sigs/mcp-lifecycle-operator |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| {{ .Chart.Name }} {{ .Chart.AppVersion }} has been deployed successfully! | ||
|
|
||
| NOTE: This chart requires the mcp-lifecycle-operator-crds chart to be installed first. | ||
| If you haven't already, install it with: | ||
|
|
||
| helm install mcp-lifecycle-operator-crds dist/chart-crds/ | ||
|
|
||
| 1. Verify the operator is running: | ||
|
|
||
| kubectl get deployment -n {{ .Release.Namespace }} {{ include "mcp-lifecycle-operator.fullname" . }}-controller-manager | ||
|
|
||
| 2. Create an MCPServer resource: | ||
|
|
||
| kubectl apply -f - <<EOF | ||
| apiVersion: mcp.x-k8s.io/v1alpha1 | ||
| kind: MCPServer | ||
| metadata: | ||
| name: test-server | ||
| spec: | ||
| source: | ||
| type: ContainerImage | ||
| containerImage: | ||
| ref: quay.io/containers/kubernetes_mcp_server:latest | ||
| config: | ||
| port: 8080 | ||
| EOF | ||
|
|
||
| 3. Check the MCPServer status: | ||
|
|
||
| kubectl get mcpservers | ||
|
|
||
| For more information, visit: {{ .Chart.Home }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| {{/* | ||
| Expand the name of the chart. | ||
| */}} | ||
| {{- define "mcp-lifecycle-operator.name" -}} | ||
| {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Create a default fully qualified app name. | ||
| */}} | ||
| {{- define "mcp-lifecycle-operator.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 "mcp-lifecycle-operator.chart" -}} | ||
| {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Common labels | ||
| */}} | ||
| {{- define "mcp-lifecycle-operator.labels" -}} | ||
| helm.sh/chart: {{ include "mcp-lifecycle-operator.chart" . }} | ||
| {{ include "mcp-lifecycle-operator.selectorLabels" . }} | ||
| {{- if .Chart.AppVersion }} | ||
| app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
| {{- end }} | ||
| app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Selector labels | ||
| */}} | ||
| {{- define "mcp-lifecycle-operator.selectorLabels" -}} | ||
| app.kubernetes.io/name: {{ include "mcp-lifecycle-operator.name" . }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| control-plane: controller-manager | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Create the name of the service account to use. | ||
| */}} | ||
| {{- define "mcp-lifecycle-operator.serviceAccountName" -}} | ||
| {{- if .Values.serviceAccount.create }} | ||
| {{- default (printf "%s-controller-manager" (include "mcp-lifecycle-operator.fullname" .)) .Values.serviceAccount.name }} | ||
| {{- else }} | ||
| {{- default "default" .Values.serviceAccount.name }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Controller manager image | ||
| */}} | ||
| {{- define "mcp-lifecycle-operator.image" -}} | ||
| {{- if contains "@" .Values.image.repository }} | ||
| {{- .Values.image.repository }} | ||
| {{- else }} | ||
| {{- printf "%s:%s" .Values.image.repository (.Values.image.tag | default .Chart.AppVersion) }} | ||
|
aliok marked this conversation as resolved.
|
||
| {{- end }} | ||
| {{- end }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: {{ include "mcp-lifecycle-operator.fullname" . }}-controller-manager | ||
| namespace: {{ .Release.Namespace }} | ||
| labels: | ||
| {{- include "mcp-lifecycle-operator.labels" . | nindent 4 }} | ||
| spec: | ||
| replicas: {{ .Values.replicas }} | ||
| selector: | ||
| matchLabels: | ||
| {{- include "mcp-lifecycle-operator.selectorLabels" . | nindent 6 }} | ||
| template: | ||
| metadata: | ||
| annotations: | ||
| kubectl.kubernetes.io/default-container: manager | ||
| {{- with .Values.podAnnotations }} | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| labels: | ||
| {{- include "mcp-lifecycle-operator.selectorLabels" . | nindent 8 }} | ||
| {{- with .Values.podLabels }} | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| spec: | ||
| {{- with .Values.imagePullSecrets }} | ||
| imagePullSecrets: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| containers: | ||
| - name: manager | ||
| image: {{ include "mcp-lifecycle-operator.image" . }} | ||
| imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
| command: | ||
| - /manager | ||
| args: | ||
| {{- if .Values.leaderElection.enabled }} | ||
| - --leader-elect | ||
| {{- end }} | ||
| - --health-probe-bind-address={{ .Values.healthProbe.bindAddress }} | ||
| - --metrics-bind-address={{ .Values.metrics.bindAddress }} | ||
| ports: | ||
| - name: metrics | ||
| containerPort: {{ .Values.metrics.service.port }} | ||
| protocol: TCP | ||
| - name: health | ||
| containerPort: {{ .Values.healthProbe.port }} | ||
| protocol: TCP | ||
| livenessProbe: | ||
| httpGet: | ||
| path: /healthz | ||
| port: {{ .Values.healthProbe.port }} | ||
| initialDelaySeconds: 15 | ||
| periodSeconds: 20 | ||
| readinessProbe: | ||
| httpGet: | ||
| path: /readyz | ||
| port: {{ .Values.healthProbe.port }} | ||
| initialDelaySeconds: 5 | ||
| periodSeconds: 10 | ||
| resources: | ||
| {{- toYaml .Values.resources | nindent 12 }} | ||
| securityContext: | ||
| allowPrivilegeEscalation: false | ||
| readOnlyRootFilesystem: true | ||
| runAsNonRoot: true | ||
| capabilities: | ||
| drop: | ||
| - ALL | ||
| seccompProfile: | ||
| type: RuntimeDefault | ||
| serviceAccountName: {{ include "mcp-lifecycle-operator.serviceAccountName" . }} | ||
| terminationGracePeriodSeconds: 10 | ||
| {{- with .Values.nodeSelector }} | ||
| nodeSelector: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- with .Values.affinity }} | ||
| affinity: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- with .Values.tolerations }} | ||
| tolerations: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| {{- if .Values.rbac.create -}} | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: Role | ||
| metadata: | ||
| name: {{ include "mcp-lifecycle-operator.fullname" . }}-leader-election-role | ||
| namespace: {{ .Release.Namespace }} | ||
| labels: | ||
| {{- include "mcp-lifecycle-operator.labels" . | nindent 4 }} | ||
| rules: | ||
| - apiGroups: | ||
| - "" | ||
| resources: | ||
| - configmaps | ||
| verbs: | ||
| - get | ||
| - list | ||
| - watch | ||
| - create | ||
| - update | ||
| - patch | ||
| - delete | ||
| - apiGroups: | ||
| - coordination.k8s.io | ||
| resources: | ||
| - leases | ||
| verbs: | ||
| - get | ||
| - list | ||
| - watch | ||
| - create | ||
| - update | ||
| - patch | ||
| - delete | ||
| - apiGroups: | ||
| - "" | ||
| resources: | ||
| - events | ||
| verbs: | ||
| - create | ||
| - patch | ||
| {{- end }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| {{- if .Values.rbac.create -}} | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: RoleBinding | ||
| metadata: | ||
| name: {{ include "mcp-lifecycle-operator.fullname" . }}-leader-election-rolebinding | ||
| namespace: {{ .Release.Namespace }} | ||
| labels: | ||
| {{- include "mcp-lifecycle-operator.labels" . | nindent 4 }} | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: Role | ||
| name: {{ include "mcp-lifecycle-operator.fullname" . }}-leader-election-role | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: {{ include "mcp-lifecycle-operator.serviceAccountName" . }} | ||
| namespace: {{ .Release.Namespace }} | ||
| {{- end }} |
Uh oh!
There was an error while loading. Please reload this page.