diff --git a/README.md b/README.md index 672225d..45d6fbf 100644 --- a/README.md +++ b/README.md @@ -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 -.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}" +``` \ No newline at end of file diff --git a/charts/langkit/Chart.yaml b/charts/langkit/Chart.yaml index 204f8ec..ff84785 100644 --- a/charts/langkit/Chart.yaml +++ b/charts/langkit/Chart.yaml @@ -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" diff --git a/charts/langkit/README.md b/charts/langkit/README.md index 7220c27..8181390 100644 --- a/charts/langkit/README.md +++ b/charts/langkit/README.md @@ -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 @@ -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 @@ -48,7 +46,7 @@ helm upgrade \ --set namespace.create=false \ --namespace langkit \ --install \ - langkit . + langkit langkit-0.1.0.tgz ``` ### Uninstall diff --git a/charts/langkit/templates/deployment.yaml b/charts/langkit/templates/deployment.yaml index a5c95d7..6d0ac05 100644 --- a/charts/langkit/templates/deployment.yaml +++ b/charts/langkit/templates/deployment.yaml @@ -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: @@ -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 }} diff --git a/charts/langkit/templates/service.yaml b/charts/langkit/templates/service.yaml index 5b737b9..231a2d5 100644 --- a/charts/langkit/templates/service.yaml +++ b/charts/langkit/templates/service.yaml @@ -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 }} diff --git a/charts/langkit/values.yaml b/charts/langkit/values.yaml index fe0cf3d..880e085 100644 --- a/charts/langkit/values.yaml +++ b/charts/langkit/values.yaml @@ -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: "" @@ -43,15 +44,17 @@ secrets: # kubectl create secret generic langkit-api-secret \ # --namespace=langkit \ # --from-literal=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= - langkitApiSecret: langkit-api-secret + langkitApiSecret: + name: langkit-api-secret service: type: ClusterIP - port: 8000 + port: 80 resources: requests: @@ -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: {}