Skip to content

feat(helm): add initial helm chart #7430

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

Merged
merged 25 commits into from
May 29, 2025
Merged
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
23 changes: 23 additions & 0 deletions helm/.helmignore
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/
24 changes: 24 additions & 0 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: phoenix
description: A Helm chart for Arize Phoenix

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "8.31.0"
11 changes: 11 additions & 0 deletions helm/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Thank you for installing {{ .Chart.Name }}.

Your release is named {{ .Release.Name }}.

To learn more about the release, try:

$ helm status {{ .Release.Name }}
$ helm get all {{ .Release.Name }}

- Phoenix docs: https://docs.arize.com/phoenix
- Phoenix configuration: https://docs.arize.com/phoenix/self-hosting/configuration
67 changes: 67 additions & 0 deletions helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{{/*
Truncate at 63 chars, kuberneteres DNS name limitation.
*/}}
{{- define "phoenix.name" -}}
{{- default "phoenix" .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}


{{- define "phoenix.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default "phoenix" .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 }}


{{- define "phoenix.postgres" -}}
{{- printf "%s-postgres" (include "phoenix.fullname" .) -}}
{{- end -}}
{{- define "phoenix.postgres-pvc" -}}
{{- printf "%s-pvc" (include "phoenix.postgres" .) -}}
{{- end -}}
{{- define "phoenix.service" -}}
{{- printf "%s-svc" (include "phoenix.fullname" .) -}}
{{- end -}}
{{- define "phoenix.ingress" -}}
{{- printf "%s-ingress" (include "phoenix.fullname" .) -}}
{{- end -}}


{{- define "phoenix.tlsCoreSecretForIngress" -}}
{{- if eq .Values.ingress.tls.certSource "none" -}}
{{- printf "" -}}
{{- else if eq .Values.ingress.tls.certSource "secret" -}}
{{- .Values.ingress.tls.secret.secretName -}}
{{- else -}}
{{- include "phoenix.ingress" . -}}
{{- end -}}
{{- end -}}




{{- define "phoenix.appPortName" -}}
{{- printf "%s-app" (include "phoenix.fullname" .) -}}
{{- end -}}
{{- define "phoenix.appPort" -}}
{{- .Values.server.port | default 6006 }}
{{- end -}}
{{- define "phoenix.metricsPortName" -}}
{{- printf "%s-metrics" (include "phoenix.fullname" .) -}}
{{- end -}}
{{- define "phoenix.metricsPort" -}}
{{- printf "9090" -}}
{{- end -}}
{{- define "phoenix.grpcPortName" -}}
{{- printf "%s-grpc" (include "phoenix.fullname" .) -}}
{{- end -}}
{{- define "phoenix.grpcPort" -}}
{{- .Values.server.grpcPort | default 4317 }}
{{- end -}}
39 changes: 39 additions & 0 deletions helm/templates/database/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "phoenix.postgres" . }}
namespace: {{ .Release.Namespace | quote }}
annotations:
"helm.sh/hook": pre-install,pre-upgrade
"helm.sh/hook-weight": "1"
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: {{ .Values.postgres.image }}
ports:
- containerPort: {{ .Values.database.postgres.port }}
env:
- name: POSTGRES_DB
value: "{{ .Values.database.postgres.db }}"
- name: POSTGRES_USER
value: "{{ .Values.database.postgres.user }}"
- name: POSTGRES_PASSWORD
value: "{{ .Values.database.postgres.password }}"
resources: {{ toYaml .Values.postgres.resources | nindent 10 }}
volumeMounts:
- name: postgres-data
mountPath: /var/lib/postgresql/data
subPath: postgres
volumes:
- name: postgres-data
persistentVolumeClaim:
claimName: {{ template "phoenix.postgres-pvc" . }}
16 changes: 16 additions & 0 deletions helm/templates/database/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if .Values.postgres.persistence.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ template "phoenix.postgres-pvc" . }}
namespace: {{ .Release.Namespace | quote }}
annotations:
"helm.sh/resource-policy": keep
spec:
accessModes:
- ReadWriteOnce
storageClassName: {{ .Values.postgres.persistence.storageClass }}
resources:
requests:
storage: {{ .Values.postgres.persistence.size }}
{{- end }}
14 changes: 14 additions & 0 deletions helm/templates/database/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: postgres-{{ template "phoenix.service" . }}
namespace: {{ .Release.Namespace | quote }}
labels:
app: postgres
spec:
type: NodePort
ports:
- name: postgres
port: 5432
selector:
app: postgres
42 changes: 42 additions & 0 deletions helm/templates/phoenix/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-configmap
namespace: {{ .Release.Namespace | quote }}
labels:
app: {{ .Release.Name }}
data:
# Server configuration
PHOENIX_HOST: {{ .Values.server.host | quote }}
PHOENIX_PORT: {{ .Values.server.port | quote }}
PHOENIX_GRPC_PORT: {{ .Values.server.grpcPort | quote }}
PHOENIX_HOST_ROOT_PATH: {{ .Values.server.hostRootPath | quote }}
PHOENIX_WORKING_DIR: {{ .Values.server.workingDir | quote }}
PHOENIX_ROOT_URL: {{ .Values.server.rootUrl | quote }}
PHOENIX_ENABLE_PROMETHEUS: {{ .Values.server.enablePrometheus | quote }}

# Database configuration
PHOENIX_SQL_DATABASE_URL: {{ .Values.database.url | quote }}
PHOENIX_POSTGRES_HOST: {{ .Values.database.postgres.host | quote }}
PHOENIX_POSTGRES_PORT: {{ .Values.database.postgres.port | quote }}
PHOENIX_POSTGRES_USER: {{ .Values.database.postgres.user | quote }}
PHOENIX_POSTGRES_DB: {{ .Values.database.postgres.db | quote }}
PHOENIX_SQL_DATABASE_SCHEMA: {{ .Values.database.postgres.schema | quote }}
PHOENIX_DATABASE_ALLOCATED_STORAGE_CAPACITY_GIBIBYTES: {{ .Values.database.allocatedStorageGiB | quote }}

# SMTP configuration
PHOENIX_SMTP_HOSTNAME: {{ .Values.smtp.hostname | quote }}
PHOENIX_SMTP_PORT: {{ .Values.smtp.port | quote }}
PHOENIX_SMTP_USERNAME: {{ .Values.smtp.username | quote }}
PHOENIX_SMTP_MAIL_FROM: {{ .Values.smtp.mailFrom | quote }}
PHOENIX_SMTP_VALIDATE_CERTS: {{ .Values.smtp.validateCerts | quote }}

# Logging
PHOENIX_LOGGING_MODE: {{ .Values.logging.mode | quote }}
PHOENIX_LOGGING_LEVEL: {{ .Values.logging.level | quote }}
PHOENIX_DB_LOGGING_LEVEL: {{ .Values.logging.dbLevel | quote }}
PHOENIX_LOG_MIGRATIONS: {{ .Values.logging.logMigrations | quote }}

# Instrumentation
PHOENIX_SERVER_INSTRUMENTATION_OTLP_TRACE_COLLECTOR_HTTP_ENDPOINT: {{ .Values.instrumentation.otlpTraceCollectorHttpEndpoint | quote }}
PHOENIX_SERVER_INSTRUMENTATION_OTLP_TRACE_COLLECTOR_GRPC_ENDPOINT: {{ .Values.instrumentation.otlpTraceCollectorGrpcEndpoint | quote }}
41 changes: 41 additions & 0 deletions helm/templates/phoenix/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace | quote }}
labels:
app: {{ .Release.Name }}
annotations:
"helm.sh/hook": pre-install,pre-upgrade
"helm.sh/hook-weight": "2"
spec:
replicas: {{ .Values.replicaCount | default 1 }}
selector:
matchLabels:
app: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ .Release.Name }}
spec:
containers:
- name: phoenix
image: {{ .Values.image.repository | default "arizephoenix/phoenix" }}:{{ .Values.image.tag | default "latest" }}
imagePullPolicy: {{ .Values.image.pullPolicy | default "IfNotPresent" }}
ports:
- containerPort: {{ .Values.server.port | default 6006 }}
- containerPort: 9090
- containerPort: {{ .Values.server.grpcPort | default 4317 }}
envFrom:
- configMapRef:
name: {{ .Release.Name }}-configmap
{{- if .Values.auth.secret }}
env:
{{- range $authSecrets := .Values.auth.secret }}
- name: {{ $authSecrets.key }}
valueFrom:
secretKeyRef:
name: {{ $.Values.auth.name }}
key: {{ $authSecrets.key }}
{{- end }}
{{- end }}
40 changes: 40 additions & 0 deletions helm/templates/phoenix/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: "{{ template "phoenix.ingress" . }}"
namespace: {{ .Release.Namespace | quote }}
{{- if .Values.ingress.labels }}
labels:
{{ toYaml .Values.ingress.labels | indent 4 }}
{{- end }}
{{- if .Values.ingress.annotations}}
annotations:
{{ toYaml .Values.ingress.annotations | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.className }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- if .Values.ingress.tls.enabled }}
tls:
- secretName: {{ template "phoenix.tlsCoreSecretForIngress" . }}
{{- if .Values.ingress.host }}
hosts:
- {{ .Values.ingress.host }}
{{- end }}
{{- end }}
rules:
- http:
paths:
- path: {{ .Values.ingress.api_path }}
pathType: {{ .Values.ingress.path_type }}
backend:
service:
name: {{ template "phoenix.service" . }}
port:
number: {{ template "phoenix.appPort" . }}
{{- if .Values.ingress.host }}
host: {{ .Values.ingress.host }}
{{- end }}
{{- end }}
12 changes: 12 additions & 0 deletions helm/templates/phoenix/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.auth.name }}
namespace: {{ .Release.Namespace | quote }}
type: Opaque
data:
{{- if .Values.auth.secret }}
{{- range $authSecrets := .Values.auth.secret }}
{{ $authSecrets.key }}: {{ $authSecrets.value | default (randAlphaNum 32) | b64enc }}
{{- end }}
{{- end }}
24 changes: 24 additions & 0 deletions helm/templates/phoenix/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "phoenix.service" . }}
namespace: {{ .Release.Namespace | quote }}
{{- if .Values.server.annotations}}
annotations:
{{ toYaml .Values.server.annotations | indent 4 }}
{{- end }}
{{- if .Values.server.labels }}
labels:
{{ toYaml .Values.server.labels | indent 4 }}
{{- end }}
spec:
type: NodePort
ports:
- name: {{ template "phoenix.grpcPortName" . }}
port: {{ template "phoenix.grpcPort" . }}
- name: {{ template "phoenix.appPortName" . }}
port: {{ template "phoenix.appPort" . }}
- name: {{ template "phoenix.metricsPortName" . }}
port: {{ template "phoenix.metricsPort" . }}
selector:
app: {{ .Release.Name }}
Loading