Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 33 additions & 3 deletions .github/workflows/helm-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ jobs:
CHANGED_CHARTS+=("openlit")
fi

# Check if openlit-operator chart changed
if echo "$CHANGED_FILES" | grep -E "^charts/openlit-operator/" > /dev/null; then
CHANGED_CHARTS+=("openlit-operator")
# Check if openlit-controller chart changed
if echo "$CHANGED_FILES" | grep -E "^charts/openlit-controller/" > /dev/null; then
CHANGED_CHARTS+=("openlit-controller")
fi

# Create matrix
Expand Down Expand Up @@ -153,7 +153,14 @@ jobs:
- name: Install Helm Chart
run: helm install ${{ matrix.chart }}-test ./charts/${{ matrix.chart }} --namespace ${{ matrix.chart }}-test --create-namespace

- name: Verify resources created
run: |
NAMESPACE=${{ matrix.chart }}-test
echo "=== Installed resources in namespace $NAMESPACE ==="
kubectl get all -n $NAMESPACE

- name: Wait for Pods to be ready
if: matrix.chart != 'openlit-controller'
run: sleep 60

- name: Check Pod status
Expand All @@ -174,6 +181,7 @@ jobs:
done

- name: Check if pods are running
if: matrix.chart != 'openlit-controller'
run: |
NAMESPACE=${{ matrix.chart }}-test
echo "Checking pod status in namespace: $NAMESPACE"
Expand All @@ -193,3 +201,25 @@ jobs:
else
echo "✅ All pods are in Running/Succeeded state in namespace $NAMESPACE"
fi

- name: Verify controller resources (controller chart only)
if: matrix.chart == 'openlit-controller'
run: |
NAMESPACE=${{ matrix.chart }}-test
echo "=== Verifying controller DaemonSet ==="
kubectl get daemonset -n $NAMESPACE
DS_COUNT=$(kubectl get daemonset -n $NAMESPACE -o jsonpath='{.items}' | jq length)
if [ "$DS_COUNT" -eq 0 ]; then
echo "❌ No DaemonSet found"
exit 1
fi
echo "✅ DaemonSet created"

echo "=== Verifying RBAC resources ==="
kubectl get serviceaccount -n $NAMESPACE
kubectl get clusterrole | grep openlit-controller || true
kubectl get clusterrolebinding | grep openlit-controller || true

echo "=== Verifying ConfigMap ==="
kubectl get configmap -n $NAMESPACE | grep openlit-controller
echo "✅ All controller resources verified"
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: v2
name: openlit-operator
description: OpenLIT Kubernetes Operator for Zero-Code AI/ML Application Instrumentation
name: openlit-controller
description: OpenLIT Controller - Zero-code LLM and Agent observability using eBPF
type: application
version: 0.2.2
appVersion: 0.0.2
version: 0.1.0
appVersion: "latest"
home: https://openlit.io
sources:
- https://github.com/openlit/openlit
Expand All @@ -15,9 +15,10 @@ keywords:
- observability
- opentelemetry
- ai
- ml
- llm
- ebpf
- instrumentation
- monitoring
- tracing
- controller
icon: https://avatars.githubusercontent.com/u/149867240?s=200&v=4

14 changes: 14 additions & 0 deletions charts/openlit-controller/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
OpenLIT Controller has been deployed as a DaemonSet.

It will automatically discover services making LLM API calls on every node.

Dashboard URL: {{ include "openlit-controller.openlitUrl" . }}
OTLP Endpoint: {{ include "openlit-controller.otlpEndpoint" . }}

Next steps:
1. Open the OpenLIT dashboard
2. Navigate to Instrumentation Hub
3. Your services will appear automatically
4. Click "Enable" to start collecting LLM traces and metrics

For more information, visit: https://docs.openlit.io/latest/controller/overview
98 changes: 98 additions & 0 deletions charts/openlit-controller/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "openlit-controller.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
*/}}
{{- define "openlit-controller.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 "openlit-controller.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "openlit-controller.labels" -}}
helm.sh/chart: {{ include "openlit-controller.chart" . }}
{{ include "openlit-controller.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: openlit
{{- if .Values.additionalLabels }}
{{ toYaml .Values.additionalLabels }}
{{- end }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "openlit-controller.selectorLabels" -}}
app.kubernetes.io/name: {{ include "openlit-controller.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
ServiceAccount name
*/}}
{{- define "openlit-controller.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "openlit-controller.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Resolve the OpenLIT dashboard URL.
When config.openlitUrl is set, use it directly.
Otherwise, derive from the parent chart's release name (subchart mode).
*/}}
{{- define "openlit-controller.openlitUrl" -}}
{{- if .Values.config.openlitUrl }}
{{- .Values.config.openlitUrl }}
{{- else }}
{{- printf "http://%s-openlit:%s" .Release.Name "3000" }}
{{- end }}
{{- end }}

{{/*
Resolve the OTLP endpoint.
When config.otlpEndpoint is set, use it directly.
Otherwise, derive from the parent chart's release name (subchart mode).
*/}}
{{- define "openlit-controller.otlpEndpoint" -}}
{{- if .Values.config.otlpEndpoint }}
{{- .Values.config.otlpEndpoint }}
{{- else }}
{{- printf "http://%s-openlit:%s" .Release.Name "4318" }}
{{- end }}
{{- end }}

{{/*
Image reference
*/}}
{{- define "openlit-controller.image" -}}
{{- $tag := default .Chart.AppVersion .Values.image.tag }}
{{- printf "%s:%s" .Values.image.repository $tag }}
{{- end }}
15 changes: 15 additions & 0 deletions charts/openlit-controller/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "openlit-controller.fullname" . }}
labels:
{{- include "openlit-controller.labels" . | nindent 4 }}
rules:
- apiGroups: [""]
resources: ["pods", "nodes", "namespaces", "services", "replicationcontrollers"]
verbs: ["get", "list", "watch"]
- apiGroups: ["apps"]
resources: ["deployments", "replicasets", "statefulsets", "daemonsets"]
verbs: ["get", "list", "watch", "patch"]
{{- end }}
16 changes: 16 additions & 0 deletions charts/openlit-controller/templates/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "openlit-controller.fullname" . }}
labels:
{{- include "openlit-controller.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "openlit-controller.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ include "openlit-controller.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
15 changes: 15 additions & 0 deletions charts/openlit-controller/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "openlit-controller.fullname" . }}-config
namespace: {{ .Release.Namespace }}
labels:
{{- include "openlit-controller.labels" . | nindent 4 }}
data:
config.yaml: |
openlit_url: {{ include "openlit-controller.openlitUrl" . | quote }}
otlp_endpoint: {{ include "openlit-controller.otlpEndpoint" . | quote }}
obi_binary_path: "/usr/local/bin/obi"
poll_interval: {{ .Values.config.pollInterval | quote }}
environment: {{ .Values.config.environment | quote }}
cluster_id: {{ .Values.config.clusterId | quote }}
93 changes: 93 additions & 0 deletions charts/openlit-controller/templates/daemonset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{ include "openlit-controller.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "openlit-controller.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "openlit-controller.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "openlit-controller.selectorLabels" . | nindent 8 }}
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "openlit-controller.serviceAccountName" . }}
hostPID: true
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: controller
image: {{ include "openlit-controller.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args: ["--config", "/etc/openlit-controller/config.yaml"]
env:
- name: OPENLIT_PROC_ROOT
value: "/host/proc"
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- if .Values.config.apiKey }}
- name: OPENLIT_API_KEY
value: {{ .Values.config.apiKey | quote }}
{{- end }}
securityContext:
privileged: true
volumeMounts:
- name: proc
mountPath: /host/proc
readOnly: true
- name: sys-kernel-debug
mountPath: /sys/kernel/debug
readOnly: true
- name: bpf
mountPath: /sys/fs/bpf
- name: config
mountPath: /etc/openlit-controller
readOnly: true
{{- with .Values.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
volumes:
- name: proc
hostPath:
path: /proc
- name: sys-kernel-debug
hostPath:
path: /sys/kernel/debug
- name: bpf
hostPath:
path: /sys/fs/bpf
- name: config
configMap:
name: {{ include "openlit-controller.fullname" . }}-config
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
13 changes: 13 additions & 0 deletions charts/openlit-controller/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{- if .Values.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "openlit-controller.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "openlit-controller.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
Loading
Loading