Skip to content

Commit

Permalink
Merge pull request #7 from Project-HAMi/modifydocs
Browse files Browse the repository at this point in the history
update docs
  • Loading branch information
archlitchi authored Oct 29, 2024
2 parents 1517712 + 1e8936f commit f7a7837
Showing 1 changed file with 22 additions and 98 deletions.
120 changes: 22 additions & 98 deletions docs/installation/helm/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,144 +2,68 @@

This topic includes instructions for installing and running HAMi-WebUI on Kubernetes using Helm Charts.

The WebUI can only be accessed by your localhost, so you need to connect your localhost to the cluster by configuring `~/.kube/config`

[Helm](https://helm.sh/) is an open-source command line tool used for managing Kubernetes applications. It is a graduate project in the [CNCF Landscape](https://www.cncf.io/projects/helm/).

The HAMi-WebUI open-source community offers Helm Charts for running it on Kubernetes. Please be aware that the code is provided without any warranties. If you encounter any problems, you can report them to the [Official GitHub repository](https://github.com/hami-webui/helm-charts/).

## Before you begin

To install HAMi-WebUI using Helm, ensure you have completed the following:
## Prequisities

- Install a Kubernetes server on your machine. For information about installing Kubernetes, refer to [Install Kubernetes](https://kubernetes.io/docs/setup/).
To install HAMi-WebUI using Helm, ensure you meet these requirements:

- Install the latest stable version of Helm. For information on installing Helm, refer to [Install Helm](https://helm.sh/docs/intro/install/).
1. Kubectl on your localhost

- Install HAMi on your Kubernetes cluster. For information about installing HAMi, refer to [Install HAMi](https://github.com/Project-HAMi/HAMi?tab=readme-ov-file#quick-start).

## Install HAMi-WebUI using Helm
2. [HAMi](https://github.com/Project-HAMi/HAMi?tab=readme-ov-file#quick-start) >= 2.4.0

When you install HAMi-WebUI using Helm, you complete the following tasks:
3. Prometheus > 2.8.0

1. Set up the HAMi-WebUI Helm repository, which provides a space in which you will install HAMi-WebUI.
4. Helm > 3.0

2. Deploy HAMi-WebUI using Helm, which installs HAMi-WebUI into a namespace.

3. Access HAMi-WebUI by navigating to the provided URL.
## Install HAMi-WebUI using Helm

### Set up the HAMi-WebUI Helm repository
### Deploy the HAMi-WebUI Helm charts

To set up the HAMi-WebUI Helm repository so that you download the correct HAMi-WebUI Helm charts on your machine, complete the following steps:

1. To add the HAMi-WebUI repository, use the following command syntax:

`helm repo add <DESIRED-NAME> <HELM-REPO-URL>`

The following example adds the `hami-webui` Helm repository.

```bash
helm repo add hami-webui https://project-hami.github.io/HAMi-WebUI
```

2. Run the following command to verify the repository was added:

```bash
helm repo list | grep hami-webui
```

After you add the repository, you should see an output similar to the following:
2. Deploy HAMi-WebUI using following command:

```bash
hami-webui https://project-hami.github.io/HAMi-WebUI
helm install my-hami-webui hami-webui/hami-webui --set externalPrometheus.enabled=true --set externalPrometheus.address="http://prometheus-kube-prometheus-prometheus.monitoring.svc.cluster.local:9090" -n kube-system
```

3. Run the following command to update the repository to download the latest HAMi-WebUI Helm charts:
> _**Important**_: You need to replace the value of 'externalPrometheus.address' to your prometheus address inside cluster
```bash
helm repo update
```

### Deploy the HAMi-WebUI Helm charts

After you have set up the HAMi-WebUI Helm repository, you can start to deploy it on your Kubernetes cluster.

When you deploy HAMi-WebUI Helm charts, use a separate namespace instead of relying on the default namespace. The default namespace might already have other applications running, which can lead to conflicts and other potential issues.

When you create a new namespace in Kubernetes, you can better organize, allocate, and manage cluster resources. For more information, refer to [Namespaces](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/).
You can set other fields in [values.yaml](https://github.com/Project-HAMi/HAMi-WebUI/blob/main/charts/hami-webui/values.yaml) during installation according to configuration [document](https://github.com/Project-HAMi/HAMi-WebUI/blob/main/charts/hami-webui/README.md#values)

1. To create a namespace, run the following command:
3. Run the following command to verify the installation:

```bash
kubectl create namespace hami
kubectl get pods -n kube-system | grep webui
```

You will see an output similar to this, which means that the namespace has been successfully created:

```bash
namespace/hami created
```

2. Search for the official `hami-webui/hami-webui` repository using the command:

`helm search repo <repo-name/package-name>`

For example, the following command provides a list of the HAMi-WebUI Helm Charts from which you will install the latest version of the HAMi-WebUI chart.
You should get the expected both 'hami-webui' and 'hami-webui-dcgm-exporter' in running state if installation is successful.

```bash
helm search repo hami-webui/hami-webui
```

3. Before deploying, ensure that you configure the `values.yaml` file to match your cluster’s requirements. For detailed instructions, refer to the [Configuration Guide for HAMi-WebUI Helm Chart](../../../charts/hami-webui/README.md#configuration-guide-for-hamiwebui-helm-chart)
> _**Important**_: You must adjust the values.yaml before proceeding with the deployment.
Download the `values.yaml` file from the Helm Charts repository:

https://github.com/Project-HAMi/HAMi-WebUI/blob/main/charts/hami-webui/values.yaml

4. Once you've adjusted the `values.yaml`, run the following command to deploy the HAMi-WebUI Helm Chart inside your namespace:

```bash
helm install my-hami-webui hami-webui/hami-webui --namespace hami -f values.yaml
```

Where:

- `helm install`: Installs the chart by deploying it on the Kubernetes cluster
- `my-hami-webui`: The logical chart name that you provided
- `hami-charts/hami-webui`: The repository and package name to install
- `--namespace`: The Kubernetes namespace (i.e. `hami`) where you want to deploy the chart

5. To verify the deployment status, run the following command and verify that `deployed` appears in the **STATUS** column:

```bash
helm list -n hami
```

You should see an output similar to the following:

```bash
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
my-hami-webui hami 1 2024-09-11 14:19:09.003195 +0800 CST deployed hami-webui-1.1.0 1.1.0
```

6. To check the overall status of all the objects in the namespace, run the following command:

```bash
kubectl get all -n hami
```
### Access HAMi-WebUI

If you encounter errors or warnings in the **STATUS** column, check the logs and refer to the Troubleshooting section of this documentation.
1. Configure ~/.kube/config in your localhost to be able to connect your cluster.

### Access HAMi-WebUI

1. Run the following command to do a port-forwarding of the HAMi-WebUI service on port `3000`.
2. Run the following command to do a port-forwarding of the HAMi-WebUI service on port `3000` in your localhost.

```bash
kubectl port-forward service/my-hami-webui 3000:3000 --namespace=hami
kubectl port-forward service/my-hami-webui 3000:3000 --namespace=kube-system
```

For more information about port-forwarding, refer to [Use Port Forwarding to Access Applications in a Cluster](https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/).

2. Navigate to `localhost:3000` in your browser.
3. Navigate to `localhost:3000` in your browser.

The HAMi-WebUI resources-overview page appears.

Expand Down

0 comments on commit f7a7837

Please sign in to comment.