Skip to content

Commit 197781a

Browse files
committed
TEAMENG-824: add helm charts for AI and discovery satellites
1 parent 10229fd commit 197781a

File tree

17 files changed

+518
-0
lines changed

17 files changed

+518
-0
lines changed

charts/ai-satellite/Chart.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: v2
2+
name: ai-satellite
3+
description: The Formal AI Satellite serves AI features and inference inside your environment.
4+
type: application
5+
version: 0.10.0
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "ai-satellite.name" -}}
5+
{{- printf "formal-%s" (default .Chart.Name .Values.nameOverride | trunc 57 | trimSuffix "-") }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "ai-satellite.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- printf "formal-%s" (.Values.fullnameOverride | trunc 57 | trimSuffix "-") }}
16+
{{- else }}
17+
{{- printf "formal-ai-satellite" }}
18+
{{- end }}
19+
{{- end }}
20+
21+
{{/*
22+
Create chart name and version as used by the chart label.
23+
*/}}
24+
{{- define "ai-satellite.chart" -}}
25+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
26+
{{- end }}
27+
28+
{{/*
29+
Common labels
30+
*/}}
31+
{{- define "ai-satellite.labels" -}}
32+
helm.sh/chart: {{ include "ai-satellite.chart" . }}
33+
{{ include "ai-satellite.selectorLabels" . }}
34+
{{- if .Chart.AppVersion }}
35+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
36+
{{- end }}
37+
app.kubernetes.io/managed-by: {{ .Release.Service }}
38+
{{- end }}
39+
40+
{{/*
41+
Selector labels
42+
*/}}
43+
{{- define "ai-satellite.selectorLabels" -}}
44+
app.kubernetes.io/name: {{ include "ai-satellite.name" . }}
45+
app.kubernetes.io/instance: {{ .Release.Name }}
46+
{{- end }}
47+
48+
{{/*
49+
Create the name of the service account to use
50+
*/}}
51+
{{- define "ai-satellite.serviceAccountName" -}}
52+
{{- if .Values.serviceAccount.name }}
53+
{{- .Values.serviceAccount.name }}
54+
{{- else if .Values.serviceAccount.create }}
55+
{{- include "ai-satellite.fullname" . }}
56+
{{- else }}
57+
{{- fail "Cannot determine service account name. Either set serviceAccount.create=true or provide serviceAccount.name" }}
58+
{{- end }}
59+
{{- end }}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "ai-satellite.fullname" . }}
5+
labels:
6+
{{- include "ai-satellite.labels" . | nindent 4 }}
7+
spec:
8+
replicas: {{ .Values.replicaCount }}
9+
selector:
10+
matchLabels:
11+
{{- include "ai-satellite.selectorLabels" . | nindent 6 }}
12+
template:
13+
metadata:
14+
labels:
15+
{{- include "ai-satellite.selectorLabels" . | nindent 8 }}
16+
{{- with .Values.podLabels }}
17+
{{- toYaml . | nindent 8 }}
18+
{{- end }}
19+
annotations:
20+
{{- with .Values.podAnnotations }}
21+
{{- toYaml . | nindent 8 }}
22+
{{- end }}
23+
spec:
24+
securityContext:
25+
{{- toYaml .Values.podSecurityContext | nindent 8 }}
26+
serviceAccountName: {{ include "ai-satellite.serviceAccountName" . }}
27+
containers:
28+
- name: {{ .Chart.Name }}
29+
securityContext:
30+
{{- toYaml .Values.securityContext | nindent 12 }}
31+
{{- if .Values.image.digest }}
32+
image: "{{ .Values.image.repository }}@{{ .Values.image.digest }}"
33+
{{- else }}
34+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
35+
{{- end }}
36+
imagePullPolicy: {{ .Values.image.pullPolicy }}
37+
ports:
38+
{{- range .Values.ports }}
39+
- name: {{ .name }}
40+
containerPort: {{ .port }}
41+
{{- end }}
42+
- name: health
43+
containerPort: 8080
44+
env:
45+
- name: FORMAL_CONTROL_PLANE_API_KEY
46+
valueFrom:
47+
secretKeyRef:
48+
name: {{ include "ai-satellite.fullname" . }}
49+
key: formal-api-key
50+
{{- range $key, $value := .Values.env }}
51+
- name: {{ $key }}
52+
value: {{ $value | quote }}
53+
{{- end }}
54+
resources:
55+
{{- toYaml .Values.resources | nindent 12 }}
56+
{{- with .Values.volumeMounts }}
57+
volumeMounts:
58+
{{- toYaml . | nindent 12 }}
59+
{{- end }}
60+
{{- with .Values.sidecars }}
61+
{{- toYaml . | nindent 8 }}
62+
{{- end }}
63+
{{- with .Values.volumes }}
64+
volumes:
65+
{{- toYaml . | nindent 8 }}
66+
{{- end }}
67+
{{- if .Values.pullWithCredentials }}
68+
imagePullSecrets:
69+
- name: formal-ecr-secret
70+
{{- end }}
71+
{{- with .Values.tolerations }}
72+
tolerations:
73+
{{- toYaml . | nindent 8 }}
74+
{{- end }}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{{- range .Values.extraManifests }}
2+
---
3+
{{ toYaml . }}
4+
{{- end }}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{{- if .Values.rbac.create }}
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: Role
4+
metadata:
5+
name: {{ include "ai-satellite.fullname" . }}
6+
labels:
7+
{{- include "ai-satellite.labels" . | nindent 4 }}
8+
rules:
9+
- apiGroups: [""]
10+
resources: ["pods"]
11+
verbs: ["get", "list"]
12+
---
13+
apiVersion: rbac.authorization.k8s.io/v1
14+
kind: RoleBinding
15+
metadata:
16+
name: {{ include "ai-satellite.fullname" . }}
17+
labels:
18+
{{- include "ai-satellite.labels" . | nindent 4 }}
19+
roleRef:
20+
apiGroup: rbac.authorization.k8s.io
21+
kind: Role
22+
name: {{ include "ai-satellite.fullname" . }}
23+
subjects:
24+
- kind: ServiceAccount
25+
name: {{ include "ai-satellite.serviceAccountName" . }}
26+
namespace: {{ .Release.Namespace }}
27+
{{- end }}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{{- if .Values.formalAPIKey }}
2+
apiVersion: v1
3+
kind: Secret
4+
metadata:
5+
name: {{ include "ai-satellite.fullname" . }}
6+
labels:
7+
{{- include "ai-satellite.labels" . | nindent 4 }}
8+
type: Opaque
9+
data:
10+
formal-api-key: {{ .Values.formalAPIKey | b64enc }}
11+
{{- end }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "ai-satellite.fullname" . }}
5+
labels:
6+
{{- include "ai-satellite.labels" . | nindent 4 }}
7+
spec:
8+
type: ClusterIP
9+
ports:
10+
{{- range .Values.ports }}
11+
- port: {{ .port }}
12+
targetPort: {{ .name }}
13+
protocol: TCP
14+
name: {{ .name }}
15+
{{- end }}
16+
- port: 8080
17+
targetPort: health
18+
protocol: TCP
19+
name: health
20+
selector:
21+
{{- include "ai-satellite.selectorLabels" . | nindent 4 }}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{{- if .Values.serviceAccount.create -}}
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: {{ include "ai-satellite.serviceAccountName" . }}
6+
labels:
7+
{{- include "ai-satellite.labels" . | nindent 4 }}
8+
{{- end }}

charts/ai-satellite/values.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
nameOverride: ""
2+
fullnameOverride: ""
3+
4+
# API key for the AI Satellite configured in Formal Control Plane
5+
formalAPIKey: ""
6+
7+
# Set to true if you're deploying outside AWS and use the ECR
8+
# credentials job (ecr-cred Helm chart) to fetch ECR credentials
9+
pullWithCredentials: false
10+
11+
image:
12+
repository: 654654333078.dkr.ecr.us-east-1.amazonaws.com/formalco-prod-ai-satellite
13+
pullPolicy: Always
14+
tag: "latest"
15+
16+
# gRPC listener for the AI satellite
17+
# NOTE: Port names are limited to 15 characters by Kubernetes (DNS_LABEL spec)
18+
ports:
19+
- name: grpc
20+
port: 50055
21+
22+
replicaCount: 2
23+
resources:
24+
requests:
25+
cpu: 4
26+
memory: 8Gi
27+
limits:
28+
cpu: 8
29+
memory: 16Gi
30+
# Requires a NVIDIA GPU with at least 48GB VRAM.
31+
nvidia.com/gpu: 1
32+
33+
securityContext: {}
34+
podSecurityContext: {}
35+
env: {}
36+
podAnnotations:
37+
cluster-autoscaler.kubernetes.io/safe-to-evict: "true"
38+
volumes: []
39+
volumeMounts: []
40+
tolerations: []
41+
42+
# RBAC resources give pod and lease permissions to the service account for
43+
# cluster formation (pod discovery + lease-based bootstrap coordination)
44+
rbac:
45+
create: true
46+
47+
# Set to `create` to false and provide your own service account name if you
48+
# don't want this chart to create one
49+
serviceAccount:
50+
create: true
51+
name: ""
52+
53+
# Extra manifests to deploy as an array of objects
54+
extraManifests: []
55+
# - apiVersion: v1
56+
# kind: ConfigMap
57+
# metadata:
58+
# name: example-configmap
59+
# data:
60+
# key: value
61+
62+
# Additional containers to run in the same pod as the main satellite container
63+
sidecars: []
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: v2
2+
name: data-discovery-satellite
3+
description: The Formal Data Discovery Satellite indexes the schemas of datastores within your environment.
4+
type: application
5+
version: 0.1.0

0 commit comments

Comments
 (0)