Skip to content

Commit 38d717c

Browse files
committed
feat(chart): complete Helm chart for vllm-coldstart-operator
Templatizes ServiceAccount, cluster-wide RBAC (ClusterRole + ClusterRoleBinding), operator Deployment (GHCR image), and a toggleable example VllmService. CRD served from crds/ so Helm installs it before the example CR in the same release. RBAC scope is cluster-wide: the controller watches VllmServices in all namespaces (Api::all in src/main.rs). Rules cover vllmservices, vllmservices/status, and apps/deployments only -- the reconciler touches no services or pods. securityContext pins runAsUser/runAsGroup to 65532 (distroless nonroot UID); runAsNonRoot alone fails on the non-numeric 'nonroot' user. Validated: helm lint, helm template, helm install/upgrade on kind (v1.34.0). Example VllmService converges to phase=Ready, operator server-side-applies the child Deployment.
1 parent ced8a9f commit 38d717c

7 files changed

Lines changed: 109 additions & 0 deletions

File tree

chart/.helmignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.DS_Store
2+
.git/
3+
.gitignore
4+
*.swp
5+
*.bak
6+
*.tmp
7+
*.orig
8+
*~
9+
.vscode/
10+
.idea/

chart/templates/deployment.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "vllm-coldstart-operator.fullname" . }}
5+
namespace: {{ .Release.Namespace }}
6+
labels:
7+
{{- include "vllm-coldstart-operator.labels" . | nindent 4 }}
8+
spec:
9+
replicas: {{ .Values.replicaCount }}
10+
selector:
11+
matchLabels:
12+
{{- include "vllm-coldstart-operator.selectorLabels" . | nindent 6 }}
13+
template:
14+
metadata:
15+
labels:
16+
{{- include "vllm-coldstart-operator.selectorLabels" . | nindent 8 }}
17+
spec:
18+
serviceAccountName: {{ include "vllm-coldstart-operator.serviceAccountName" . }}
19+
securityContext:
20+
runAsNonRoot: true
21+
runAsUser: 65532
22+
runAsGroup: 65532
23+
seccompProfile:
24+
type: RuntimeDefault
25+
containers:
26+
- name: operator
27+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
28+
imagePullPolicy: {{ .Values.image.pullPolicy }}
29+
env:
30+
- name: RUST_LOG
31+
value: {{ .Values.logLevel | quote }}
32+
securityContext:
33+
allowPrivilegeEscalation: false
34+
readOnlyRootFilesystem: true
35+
capabilities:
36+
drop:
37+
- ALL
38+
resources:
39+
{{- toYaml .Values.resources | nindent 10 }}

chart/templates/rbac.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{{- if .Values.rbac.create -}}
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRole
4+
metadata:
5+
name: {{ include "vllm-coldstart-operator.fullname" . }}
6+
labels:
7+
{{- include "vllm-coldstart-operator.labels" . | nindent 4 }}
8+
rules:
9+
# Watch VllmService custom resources across all namespaces (Api::all).
10+
- apiGroups: ["inference.michelecampi.dev"]
11+
resources: ["vllmservices"]
12+
verbs: ["get", "list", "watch"]
13+
# Write lifecycle phase back on the /status subresource.
14+
- apiGroups: ["inference.michelecampi.dev"]
15+
resources: ["vllmservices/status"]
16+
verbs: ["get", "patch", "update"]
17+
# Server-side apply the owned Deployment and watch owned children (.owns).
18+
- apiGroups: ["apps"]
19+
resources: ["deployments"]
20+
verbs: ["get", "list", "watch", "create", "patch"]
21+
---
22+
apiVersion: rbac.authorization.k8s.io/v1
23+
kind: ClusterRoleBinding
24+
metadata:
25+
name: {{ include "vllm-coldstart-operator.fullname" . }}
26+
labels:
27+
{{- include "vllm-coldstart-operator.labels" . | nindent 4 }}
28+
roleRef:
29+
apiGroup: rbac.authorization.k8s.io
30+
kind: ClusterRole
31+
name: {{ include "vllm-coldstart-operator.fullname" . }}
32+
subjects:
33+
- kind: ServiceAccount
34+
name: {{ include "vllm-coldstart-operator.serviceAccountName" . }}
35+
namespace: {{ .Release.Namespace }}
36+
{{- end }}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{{- if .Values.serviceAccount.create -}}
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: {{ include "vllm-coldstart-operator.serviceAccountName" . }}
6+
namespace: {{ .Release.Namespace }}
7+
labels:
8+
{{- include "vllm-coldstart-operator.labels" . | nindent 4 }}
9+
{{- end }}

chart/templates/vllmservice.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{{- if .Values.example.enabled -}}
2+
apiVersion: inference.michelecampi.dev/v1alpha1
3+
kind: VllmService
4+
metadata:
5+
name: {{ .Values.example.name }}
6+
namespace: {{ .Release.Namespace }}
7+
labels:
8+
{{- include "vllm-coldstart-operator.labels" . | nindent 4 }}
9+
spec:
10+
{{- toYaml .Values.example.spec | nindent 2 }}
11+
{{- end }}

chart/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,7 @@ example:
5353
# image: "vllm/vllm-openai:latest"
5454
# gpu: 1
5555
# healthPath: "/health"
56+
57+
# -- Value of RUST_LOG for the operator (tracing EnvFilter). Matches the
58+
# binary's built-in default.
59+
logLevel: "info,kube=warn"

0 commit comments

Comments
 (0)