Skip to content

Commit

Permalink
[POC] [DRAFT] Example of multi-model LangKit deployment with Helm
Browse files Browse the repository at this point in the history
  • Loading branch information
AnchorArray committed Feb 8, 2024
1 parent e2d0473 commit 8331946
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 1 deletion.
6 changes: 6 additions & 0 deletions charts/langkit/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning]
(https://semver.org/spec/v2.0.0.html).

## [0.7.0] - **Breaking Changes** - 2023-02-08

### Breaking

- :warning: Adding support for multiple model deployments.

## [0.6.0] - **Breaking Changes** - 2023-02-01

### Breaking
Expand Down
2 changes: 1 addition & 1 deletion charts/langkit/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: langkit
description: A Helm chart for LangKit container deployment
type: application
version: 0.6.0
version: 0.7.0
appVersion: "1.0.2.dev2"
4 changes: 4 additions & 0 deletions charts/langkit/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ spec:
{{- toYaml .Values.resources | nindent 12 }}
env:
{{- toYaml .Values.containers.env | nindent 12 }}
{{- range .Values.models }}
- name: {{ .name | upper | replace "-" "_" }}_SERVICE_URL
value: "http://{{ .name }}.{{ $.Release.Namespace }}.svc.cluster.local"
{{- end }}
envFrom:
- secretRef:
name: {{ .Values.secrets.whylabsApiKey.name }}
Expand Down
34 changes: 34 additions & 0 deletions charts/langkit/templates/models.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{{- range .Values.models }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .name }}
spec:
replicas: 2
selector:
matchLabels:
app: {{ .name }}
template:
metadata:
labels:
app: {{ .name }}
spec:
containers:
- name: {{ .name }}
image: {{ .image }}
ports:
- containerPort: 80
tolerations:
{{- toYaml .tolerations | nindent 8 }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ .name }}
spec:
type: ClusterIP
selector:
app: {{ .name }}
ports: {{ toYaml .ports | nindent 4 }}
{{- end }}
35 changes: 35 additions & 0 deletions charts/langkit/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,38 @@ volumes:
emptyDir: {}
- name: home
emptyDir: {}

models:
- name: model1
image: nginx
ports:
- protocol: TCP
port: 80
targetPort: 80
tolerations:
- effect: NoSchedule
key: kubernetes.azure.com/scalesetpriority
operator: Equal
value: spot
- name: model2
image: nginx
ports:
- protocol: TCP
port: 80
targetPort: 80
tolerations:
- effect: NoSchedule
key: kubernetes.azure.com/scalesetpriority
operator: Equal
value: spot
- name: model3
image: nginx
ports:
- protocol: TCP
port: 80
targetPort: 80
tolerations:
- effect: NoSchedule
key: kubernetes.azure.com/scalesetpriority
operator: Equal
value: spot

0 comments on commit 8331946

Please sign in to comment.