Skip to content

Commit

Permalink
Merge pull request #26 from AnaisUrlichs/operator
Browse files Browse the repository at this point in the history
fix: enhancing operator docs
  • Loading branch information
AlexsJones committed May 10, 2023
2 parents 11fbe67 + fdae253 commit 98284f7
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 21 deletions.
5 changes: 2 additions & 3 deletions docs/getting-started/in-cluster-operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ This will install the Operator into the cluster, which will await a `K8sGPT` res
## Deploying an OpenAI secret

Whilst there are multiple backends supported ( OpenAI, Azure OpenAI and Local ), in this example we'll use OpenAI.
Whatever backend you are using, you need to make sure to have a secret that works with the backend.

This means you will need to install your token as a secret into the cluster.

For example:
For instance, this means you will need to install your OpenAI token as a secret into the cluster:

```bash
kubectl create secret generic k8sgpt-sample-secret --from-literal=openai-api-key=$OPENAI_TOKEN -n default
Expand Down
33 changes: 19 additions & 14 deletions docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,6 @@ curl -LO https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.2.1/k8sgpt_amd
apk add k8sgpt_amd64.apk
```

### Failing Installation on WSL or Linux (missing gcc)
When installing Homebrew on WSL or Linux, you may encounter the following error:

```
==> Installing k8sgpt from k8sgpt-ai/k8sgpt Error: The following formula cannot be installed from a bottle and must be
built from the source. k8sgpt Install Clang or run brew install gcc.
```

If you install gcc as suggested, the problem will persist. Therefore, you need to install the build-essential package.
```bash
sudo apt-get update
sudo apt-get install build-essential
```

## Windows

* Download the latest Windows binaries of **k8sgpt** from the [Release](https://github.com/k8sgpt-ai/k8sgpt/releases)
Expand Down Expand Up @@ -117,6 +103,20 @@ If you install gcc as suggested, the problem will persist. Therefore, you need t
sudo apt-get install build-essential
```

### Failing Installation on WSL or Linux (missing gcc)
When installing Homebrew on WSL or Linux, you may encounter the following error:

```
==> Installing k8sgpt from k8sgpt-ai/k8sgpt Error: The following formula cannot be installed from a bottle and must be
built from the source. k8sgpt Install Clang or run brew install gcc.
```

If you install gcc as suggested, the problem will persist. Therefore, you need to install the build-essential package.
```bash
sudo apt-get update
sudo apt-get install build-essential
```

## Running K8sGPT through a container

If you are running K8sGPT through a container, the CLI will not be able to open the website for the OpenAI token.
Expand All @@ -135,6 +135,11 @@ services:
- /home/$(whoami)/.k8sgpt.yaml:/home/root/.k8sgpt.yaml
```

## Installing the K8sGPT Operator Helm Chart

K8sGPT can be installed as an Operator inside the cluster.
For further information, see the [K8sGPT Operator](in-cluster-operator.md) documentation.

## Upgrading the brew installation

To upgrade the K8sGPT brew installation run the following command:
Expand Down
3 changes: 0 additions & 3 deletions docs/reference/operator/index.md

This file was deleted.

25 changes: 25 additions & 0 deletions docs/reference/operator/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# K8sGPT Operator

K8sGPT can run as a Kubernetes Operator inside the cluster.
The scan results are provided as Kubernetes YAML manifests.

This section will only detail how to configure the operator. For installatio instrusction, please see the [getting-started section.](../../getting-started/in-cluster-operator.md)

## Customising the Operator

As with other Helm Charts, the K8sGPT Operator can be customised by modifying [the `values.yaml` file.](https://github.com/k8sgpt-ai/k8sgpt/blob/main/charts/k8sgpt/values.yaml)

### In-cluster metrics

It is possible to enable metrics of the operator so that they can be scraped through Prometheus.

This is the configuration required in the `values.yaml` manifest:
```yaml
serviceMonitor:
enabled: true
```

The new `values.yaml` manifest can then be provided upon installing the Operator inside the cluster:
```bash
helm install release k8sgpt/k8sgpt-operator --values values.yaml
```
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ nav:
- Overview: reference/cli/index.md
- Integration and Filter: reference/cli/filters.md
- Operator:
- Overview: reference/operator/index.md
- Overview: reference/operator/overview.md
- Guidelines & Community:
- Guidelines: reference/guidelines/guidelines.md
- Community: reference/guidelines/community.md
Expand Down

0 comments on commit 98284f7

Please sign in to comment.