Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc(console):add doc for enabling minio console #618

Merged
merged 1 commit into from
Apr 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ NOTES:
* [Delete Harbor cluster](./docs/LCM/cluster-deletion.md)
* [Backup data](./docs/LCM/backup-data.md)
* [Useful Makefile Targets](./docs/makefile.md)
* [Resource configurations](./docs/configurations/resource-configurations.md)
* [Operator configurations](./docs/configurations/operator-configurations.md)
* [Enable Minio console](./docs/installation/enable_minio_console.md)
* [Performance comparison between fs & MinIO](./docs/perf/simple-perf-comprasion.md)
* [Monitor logs with grafana](./docs/LCM/monitor-logs-with-grafana.md)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Resource configurations
# Operator configurations

There are some settings for you to configure your Harbor operator deployment.

## common config

Expand Down
Binary file added docs/images/console/dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/console/login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion docs/installation/by-helm-chart.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ There are several ways to get the Harbor operator helm chart:
```shell
git clone https://github.com/goharbor/harbor-operator.git && \
cd harbor-operator && \
git checkout release-v1.0.0 && \
git checkout release-1.0.0 && \
make helm-generate RELEASE_VERSION=v1.0.0

# Checkout to the specified branch or the specified tag
# To branch: git checkout <branch-name> e.g.: git checkout release-1.0.0
# To tag: git checkout tags/<tag> -b <branch-name> e.g: git checkout tags/v1.0.0 -b tag-v1.0.0

# chart is generated to `charts/harbor-operator-v1.0.0.tgz`
```

Expand Down
134 changes: 134 additions & 0 deletions docs/installation/enable_minio_console.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# Enable Minio console

[Minio console](https://github.com/minio/console) is a graphical user interface for you to manage the tenant created by the operator. By default, it is not enabled in the harbor operator [all-in-one](./kustomization-all-in-one.md) kustomization manifest. The doc shown here guides you to enable the Minio console if you have the Minio tenant management needs.

>Notes: If you install Minio operator with its own manifests, the Minio console might be enabled automatically.

## Prerequisites

1. `kubectl` with a proper version(v1.18.6+) is [installed](https://kubernetes.io/docs/tasks/tools/).
1. `kustomize` (optional)with a proper version(v3.8.7+) is [installed](https://kubectl.docs.kubernetes.io/installation/kustomize/).
1. `git` (optional) is [installed](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).

## Customize the kustomization manifest

First, clone the code from the `harbor-operator` repository.

```shell
git clone https://github.com/goharbor/harbor-operator.git

# Checkout to the specified branch or the specified tag.
# To branch: git checkout <branch-name> e.g.: git checkout release-1.0.0
# To tag: git checkout tags/<tag> -b <branch-name> e.g: git checkout tags/v1.0.0 -b tag-v1.0.0
```

Then open the [all-in-one](./kustomization-all-in-one.md) kustomization manifest and locate the `patchesStrategicMerge` section. Comment the patch `- patch/delete-minio-console.yaml`.

```yaml
# If you have to override the image path, uncomment this patch and also change the image paths in the patch/patches-images.yaml file.
# Then rebuild.
patchesStrategicMerge:
# - patch/images.yaml
# - patch/delete-minio-console.yaml
- patch/delete-duplicated-ns.yaml
- patch/pg-configmap.yaml
```

As the resource manifests are not stored in the codebase, then you need to run the following command to generate the related resource manifests before using `kustomize` to build your customized operator deployment manifest.

```shell
make manifests
```

Run `kustomize` command to generate your customized operator deployment manifest.

```shell
kustomize build manifest/cluster -o myCustom.yaml
```

## Deploy Minio console

Apply the customized deployment manifest to your Kubernetes cluster.

```shell
kubectl apply -f myCustom.yaml
```

Of course, if you're willing to, you can directly apply the deployment via kustomization manifest.

```shell
kubectl apply -k manifests/cluster

# OR
# kustomize build manifest/cluster | kubectl apply -f -
```

After a short while, the console pod will be ready then.

```shell
# Check console pod status
k8s get pods --selector=app=console -n harbor-operator-ns

## Output
# NAME READY STATUS RESTARTS AGE
# console-97c5cdc46-q6ptc 1/1 Running 0 18h
```

## Expose the Minio console service

To access the console service outside your Kubernetes cluster, you need to expose the Minio console service.

A simple way, expose it via port forward.

```shell
kubectl port-forward --address 10.10.1.10 service/console -n harbor-operator-ns 29090:9090
```

Alternatively, create an ingress.
e.g.:

```yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: minio-console
namespace: harbor-operator-ns
spec:
rules:
- host: minio-console.10.10.1.10.xip.io
http:
paths:
- backend:
service:
name: console
port:
number: 9090
path: /
pathType: Prefix
status:
loadBalancer:
ingress:
- hostname: localhost
```

## Access the Minio console

Open browser and navigate to the expose host of the Minio console service, e.g.: `https://minio-console.10.10.1.10.xip.io`. You'll see the login page.

![Minio console login](../images/console/login.png)

Get the JWT token from your service account.

```shell
kubectl -n harbor-operator-ns get secret $(kubectl -n harbor-operator-ns get serviceaccount console-sa -o jsonpath="{.secrets[0].name}") -o jsonpath="{.data.token}" | base64 --decode
```

Input the token got from the above command in the login page and you'll be navigated to the dashboard page.

All the tenants created are listed.

![Minio console dashboard](../images/console/dashboard.png)

Click any tenant to see their basic information.

>NOTES: The available functionalities of the Minio console will be different based on the license subscription plan which is irrelevant with Harbor operator.
4 changes: 3 additions & 1 deletion docs/installation/kustomization-all-in-one.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ If you want to customize the deployment manifest like editing image settings of
```shell
git clone https://github.com/goharbor/harbor-operator.git

# Checkout to the necessary branch.
# Checkout to the specified branch or the specified tag.
# To branch: git checkout <branch-name> e.g.: git checkout release-1.0.0
# To tag: git checkout tags/<tag> -b <branch-name> e.g: git checkout tags/v1.0.0 -b tag-v1.0.0
```

As the resource manifests are not stored in the codebase, then you need to run the following command to generate the related resource manifests before using `kustomize` to build your customized operator deployment manifest:
Expand Down
4 changes: 3 additions & 1 deletion docs/installation/kustomization-custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ Of course, you can clone the codebase into your computer and then customize and
```shell
git clone https://github.com/goharbor/harbor-operator.git

# Checkout to the necessary branch.
# Checkout to the specified branch or the specified tag.
# To branch: git checkout <branch-name> e.g.: git checkout release-1.0.0
# To tag: git checkout tags/<tag> -b <branch-name> e.g: git checkout tags/v1.0.0 -b tag-v1.0.0

# As the resource manifests are not stored in the codebase, then you need to run the following command to generate the related resource manifests before using `kustomize` to build your customized operator deployment manifest:
make manifests
Expand Down
4 changes: 4 additions & 0 deletions docs/makefile.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Clone the harbor operator codebase into your computer with command

```shell
git clone https://github.com/goharbor/harbor-operator.git

# Checkout to the specified branch or the specified tag.
# To branch: git checkout <branch-name> e.g.: git checkout release-1.0.0
# To tag: git checkout tags/<tag> -b <branch-name> e.g: git checkout tags/v1.0.0 -b tag-v1.0.0
```

The `Makefile` is in the root dir of the code repository.
Expand Down