Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
AnchorArray committed Jun 18, 2024
1 parent 909bad4 commit eb523f3
Show file tree
Hide file tree
Showing 18 changed files with 215 additions and 805 deletions.
52 changes: 24 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,71 +10,67 @@
> command, followed by specifying the chart's `.tgz` file, to access and utilize
> our Helm charts.
### Example Using the [LangKit Helm Chart](./charts/langkit/)
### Example Using the [Guardrails Helm Chart](./charts/guardrails/)

#### Quick Start

```shell
# Downloads a .tgz file to the working directory or --destination path
chart_version=""

# The following command will download a guardrails-${chart_version}.tgz file to
# the working directory or --destination path
helm pull \
oci://ghcr.io/whylabs/langkit \
--version "0.10.0"
oci://ghcr.io/whylabs/guardrails \
--version "${chart_version}"

# Requires the helm-diff plugin to be installed:
# helm plugin install https://github.com/databus23/helm-diff
helm diff upgrade \
--allow-unreleased \
--namespace langkit \
`# Specify the .tgz file as the chart` \
langkit langkit-0.10.0.tgz
--namespace guardrails \
guardrails "guardrails-${chart_version}.tgz"

helm upgrade --install \
--create-namespace \
--namespace langkit \
langkit langkit-0.10.0.tgz
--namespace guardrails \
guardrails "guardrails-${chart_version}.tgz"
```

#### Extended Example
```shell
# Configure local variables for clarity and simplicity
helm_repo="ghcr.io/whylabs"
chart_name="langkit"
chart_version="0.10.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}"
chart_name="guardrails"
chart_version="1.0.0"
chart_file="${chart_name}-${chart_version}.tgz"
namespace="default"

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

# Performs a diff between current and proposed state
# --allow-unreleased flag will perform a diff even if there is no current state,
# i.e. a fresh installation will display all net new resource creation in the
# diff. --set namespace.create=false must be set if target namespace already
# exists; omit this line or set it to "true" if the target namespace should be
# created. Requires the helm-diff plugin to be installed:
# Perform a diff between current and proposed state
# Requires the helm-diff plugin to be installed:
# `helm plugin install https://github.com/databus23/helm-diff`
helm diff upgrade \
--allow-unreleased \
--namespace "${namespace}" \
"${release}" "${chart}"
"${chart_name}" "${chart_file}"

# helm upgrade --install supports installation and upgrades.
# helm upgrade --install supports initial installation and upgrades.
# In the `helm upgrade --install <release-name> <chart>` command, the chart may
# be a chart reference('example/postgres'), a path to a chart directory, a fully
# qualified URL, or a packaged chart (.tgz), which is what this example uses.
helm upgrade --install \
--create-namespace \
--namespace "${namespace}" \
"${release}" "${chart}"
"${chart_name}" "${chart_file}"

# Uninstall
helm uninstall \
--namespace "${namespace}" \
"${release}"
"${chart_name}"
```

## Development
Expand Down
66 changes: 57 additions & 9 deletions charts/guardrails/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,78 @@

A Helm chart for WhyLabs Guardrails

## Installing the Chart
## Prerequisites

### API Key

Create a [WhyLabs API Key](https://docs.whylabs.ai/docs/whylabs-api/#creating-an-api-token)
that will be used when creating the required Kubernetes secrets to authenticate
with the WhyLabs API.

### Secrets

Use the following `kubectl` commands to create the required Kubernetes
`Secrets`. These secrets must exist prior to installing the Helm chart.

```shell
# Downloads a .tgz file to the working directory or --destination path
# API that was created above
whylabs_api_key=""
# Arbitrary value that will be required to make requests to the containers
container_password=""
# Change this to the desired namespace
target_namespace="default"

kubectl create secret generic whylabs-<helm-release-name>-api-key \
--namespace "${target_namespace}" \
--from-literal=WHYLABS_API_KEY="${whylabs_api_key}"

kubectl create secret generic whylabs-<helm-release-name>-api-secret \
--namespace "${target_namespace}" \
--from-literal=CONTAINER_PASSWORD="${container_password}"

kubectl create secret docker-registry whylabs-<helm-release-name>-registry-credentials \
--namespace "${target_namespace}" \
--docker-server="registry.gitlab.com" \
--docker-username="<whylabs-provided-username>" \
--docker-password="<whylabs-provided-token>" \
--docker-email="<whylabs-provided-email>"
```

## Installation & Upgrades

### How to Use WhyLabs Helm Repository

> :warning: WhyLab's Helm charts are hosted on GitHub Container Registry (GHCR),
> an OCI-compliant storage solution. GHCR aligns with industry standards for
> container artifact storage and has a slightly different API to be aware of.
> Use the `helm pull` command to download the a `.tgz` archive of the chart.
> Reference the `.tgz` archive as the chart identifier when installing.
```shell
# Specify the namespace to install the chart into
target_namespace=""

# The following command will download a guardrails-${chart_version}.tgz file to
# the working directory or --destination path
helm pull \
oci://ghcr.io/whylabs/guardrails \
--version 0.2.0

# Requires the helm-diff plugin to be installed:
# helm plugin install https://github.com/databus23/helm-diff
helm diff upgrade \
--allow-unreleased \
--namespace <target-namespace> \
`# Specify the .tgz file as the chart` \
guardrails
guardrails-0.2.0.tgz
--namespace "${target_namespace}" \
guardrails guardrails-0.2.0.tgz
```

After you've installed the repo you can install the chart.

```shell
helm upgrade --install \
--create-namespace \
--namespace <target-namespace> \
guardrails
guardrails-0.2.0.tgz
--namespace "${target_namespace}" \
guardrails guardrails-0.2.0.tgz
```

## Horizontal Pod Autoscaling (HPA)
Expand Down
66 changes: 57 additions & 9 deletions charts/guardrails/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,78 @@

{{ template "chart.sourcesSection" . }}

## Installing the Chart
## Prerequisites

### API Key

Create a [WhyLabs API Key](https://docs.whylabs.ai/docs/whylabs-api/#creating-an-api-token)
that will be used when creating the required Kubernetes secrets to authenticate
with the WhyLabs API.

### Secrets

Use the following `kubectl` commands to create the required Kubernetes
`Secrets`. These secrets must exist prior to installing the Helm chart.

```shell
# Downloads a .tgz file to the working directory or --destination path
# API that was created above
whylabs_api_key=""
# Arbitrary value that will be required to make requests to the containers
container_password=""
# Change this to the desired namespace
target_namespace="default"

kubectl create secret generic whylabs-<helm-release-name>-api-key \
--namespace "${target_namespace}" \
--from-literal=WHYLABS_API_KEY="${whylabs_api_key}"

kubectl create secret generic whylabs-<helm-release-name>-api-secret \
--namespace "${target_namespace}" \
--from-literal=CONTAINER_PASSWORD="${container_password}"

kubectl create secret docker-registry whylabs-<helm-release-name>-registry-credentials \
--namespace "${target_namespace}" \
--docker-server="registry.gitlab.com" \
--docker-username="<whylabs-provided-username>" \
--docker-password="<whylabs-provided-token>" \
--docker-email="<whylabs-provided-email>"
```

## Installation & Upgrades

### How to Use WhyLabs Helm Repository

> :warning: WhyLab's Helm charts are hosted on GitHub Container Registry (GHCR),
> an OCI-compliant storage solution. GHCR aligns with industry standards for
> container artifact storage and has a slightly different API to be aware of.
> Use the `helm pull` command to download the a `.tgz` archive of the chart.
> Reference the `.tgz` archive as the chart identifier when installing.

```shell
# Specify the namespace to install the chart into
target_namespace=""

# The following command will download a guardrails-${chart_version}.tgz file to
# the working directory or --destination path
helm pull \
oci://ghcr.io/whylabs/{{ template "chart.name" . }} \
--version {{ template "chart.version" . }}

# Requires the helm-diff plugin to be installed:
# helm plugin install https://github.com/databus23/helm-diff
helm diff upgrade \
--allow-unreleased \
--namespace <target-namespace> \
`# Specify the .tgz file as the chart` \
{{ template "chart.name" . }}
{{ template "chart.name" . }}-{{ template "chart.version" . }}.tgz
--namespace "${target_namespace}" \
{{ template "chart.name" . }} {{ template "chart.name" . }}-{{ template "chart.version" . }}.tgz
```

After you've installed the repo you can install the chart.

```shell
helm upgrade --install \
--create-namespace \
--namespace <target-namespace> \
{{ template "chart.name" . }}
{{ template "chart.name" . }}-{{ template "chart.version" . }}.tgz
--namespace "${target_namespace}" \
{{ template "chart.name" . }} {{ template "chart.name" . }}-{{ template "chart.version" . }}.tgz
```

## Horizontal Pod Autoscaling (HPA)
Expand Down
23 changes: 0 additions & 23 deletions charts/scaffold/.helmignore

This file was deleted.

19 changes: 0 additions & 19 deletions charts/scaffold/CHANGELOG.md

This file was deleted.

6 changes: 0 additions & 6 deletions charts/scaffold/Chart.yaml

This file was deleted.

Loading

0 comments on commit eb523f3

Please sign in to comment.