Skip to content
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

[POC] [DRAFT] Example of multi-model LangKit deployment with Helm #8

Draft
wants to merge 1 commit into
base: mainline
Choose a base branch
from
Draft
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
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WL_CM_{{ .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
Loading