Skip to content

Commit

Permalink
Updates to LangKit Helm Chart
Browse files Browse the repository at this point in the history
  • Loading branch information
AnchorArray committed Jan 19, 2024
1 parent bcc1edd commit e406b6d
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 31 deletions.
43 changes: 41 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,41 @@
# charts
Helm charts for WhyLabs
# Helm Charts for WhyLabs

## How to use WhyLabs Helm repository

```shell
helm_repo="ghcr.io/whylabs"
chart_name="langkit"
chart_version="0.1.0"
chart="${chart_name}-${chart_version}.tgz"

# Release and namespace values mirror other variables for simplicity.
# Set these to as desired
release="${chart_name}"
namespace="${release}"


# Downloads <chart_name>-<chart_version>.tgz to your current directory
helm pull \
"oci://${helm_repo}/${chart_name}" \
--version "${chart_version}"

helm diff upgrade \
`# --allow-unreleased will show a diff for a new install` \
--allow-unreleased \
`# set namespace.create to false if the target namespace already exists` \
--set namespace.create=false \
--namespace "${namespace}" \
"${release}" .

# Specify the .tgz file as the na
helm upgrade --install \
`# set namespace.create to false if the target namespace already exists` \
--set namespace.create=false \
--namespace "${namespace}" \
"${release}" .

# Uninstall
helm uninstall \
--namespace "${namespace}" \
"${release}"
```
6 changes: 3 additions & 3 deletions charts/langkit/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: langkit
description: A Helm chart for Kubernetes
description: A Helm chart for LangKit container deployment
type: application
version: 0.1.0
appVersion: "1.16.0"
version: 0.2.0
appVersion: "0.0.28"
10 changes: 4 additions & 6 deletions charts/langkit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ kubectl create secret generic langkit-api-secret \
### Template
```shell
# This will use the "langkit" namespace
helm template \
--namespace langkit \
langkit .
helm template --namespace langkit langkit .
```

### Diff
Expand All @@ -35,10 +33,10 @@ helm template \
helm diff \
`# do not create namespace if it already exists` \
--set namespace.create=false \
--namespace langkit \
--namespace langkit2 \
--allow-unreleased \
upgrade \
langkit .
langkit langkit-0.1.0.tgz
```

### Install/Update
Expand All @@ -48,7 +46,7 @@ helm upgrade \
--set namespace.create=false \
--namespace langkit \
--install \
langkit .
langkit langkit-0.1.0.tgz
```

### Uninstall
Expand Down
8 changes: 3 additions & 5 deletions charts/langkit/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ spec:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
- containerPort: {{ .Values.image.containerPort }}
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }}
readinessProbe:
Expand All @@ -47,9 +45,9 @@ spec:
{{- toYaml .Values.resources | nindent 12 }}
envFrom:
- secretRef:
name: {{ .Values.secrets.whylabsApiKey }}
name: {{ .Values.secrets.whylabsApiKey.name }}
- secretRef:
name: {{ .Values.secrets.langkitApiSecret }}
name: {{ .Values.secrets.langkitApiSecret.name }}
{{- with .Values.volumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
Expand Down
7 changes: 3 additions & 4 deletions charts/langkit/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ metadata:
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
- protocol: TCP
port: {{ .Values.service.port }}
targetPort: {{ .Values.image.containerPort }}
selector:
{{- include "langkit.selectorLabels" . | nindent 4 }}
27 changes: 16 additions & 11 deletions charts/langkit/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ image:
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: py-llm-latest
containerPort: 8000

imagePullSecrets: []
nameOverride: ""
Expand Down Expand Up @@ -43,15 +44,17 @@ secrets:
# kubectl create secret generic langkit-api-secret \
# --namespace=langkit \
# --from-literal=WHYLABS_API_KEY=<whylabs-api-key>
whylabsApiKey: whylabs-api-key
whylabsApiKey:
name: whylabs-api-key
# kubectl create secret generic langkit-api-secret \
# --namespace=langkit \
# --from-literal=LANGKIT_API_KEY=<langkit-api-key>
langkitApiSecret: langkit-api-secret
langkitApiSecret:
name: langkit-api-secret

service:
type: ClusterIP
port: 8000
port: 80

resources:
requests:
Expand All @@ -61,14 +64,16 @@ resources:
cpu: "8"
memory: 16Gi

# livenessProbe:
# httpGet:
# path: /health
# port: http
# readinessProbe:
# httpGet:
# path: /health
# port: http
livenessProbe:
tcpSocket:
port: 8000
initialDelaySeconds: 15
periodSeconds: 10
readinessProbe:
tcpSocket:
port: 8000
initialDelaySeconds: 15
periodSeconds: 10

nodeSelector: {}

Expand Down

0 comments on commit e406b6d

Please sign in to comment.