Skip to content

Commit

Permalink
Using kustomize rather than krew plugin for the readme (#1947)
Browse files Browse the repository at this point in the history
* Using kustomize rather than krew plugin for the readme

* Update README.md

Co-authored-by: Ravind Kumar <ravindk89@gmail.com>

---------

Co-authored-by: Ravind Kumar <ravindk89@gmail.com>
  • Loading branch information
cniackz and ravindk89 committed Feb 6, 2024
1 parent e360633 commit 99d7e4c
Show file tree
Hide file tree
Showing 2 changed files with 128 additions and 51 deletions.
91 changes: 40 additions & 51 deletions README.md
Expand Up @@ -165,47 +165,14 @@ performance:

## Procedure

### 1) Install the MinIO Operator

Run the following commands to install the MinIO Operator and Plugin using the Kubernetes ``krew`` plugin manager:

```sh
kubectl krew update
kubectl krew install minio
```

See the ``krew`` [installation documentation](https://krew.sigs.k8s.io/docs/user-guide/setup/install/) for instructions
on installing ``krew``.

Run the following command to verify installation of the plugin:

```sh
kubectl minio version
```

As an alternative to `krew`, you can download the `kubectl-minio` plugin from
the [Operator Releases Page](https://github.com/minio/operator/releases). Download the `kubectl-minio` package
appropriate for your operating system and extract the contents as `kubectl-minio`. Set the `kubectl-minio` binary to be
executable (e.g. `chmod +x`) and place it in your system `PATH`.

For example, the following code downloads the latest stable version of the MinIO Kubernetes Plugin and installs it to
the system ``$PATH``. The example assumes a Linux operating system:
### 1) Install the MinIO Operator via Kustomization
Follow the [Install `kustomize`](https://kubectl.docs.kubernetes.io/installation/kustomize/) guide for your host system before starting this procedure.

```sh
wget -qO- https://github.com/minio/operator/releases/latest/download/kubectl-minio_linux_amd64_v1.zip | sudo bsdtar -xvf- -C /usr/local/bin
sudo chmod +x /usr/local/bin/kubectl-minio
```

Run the following command to verify installation of the plugin:

```sh
kubectl minio version
```

Run the following command to initialize the Operator:

```sh
kubectl minio init
VERSION=v5.0.11
TIMEOUT=120 # By default is 27, sometimes connection is slow, allow more time to fetch it.
kustomize build "github.com/minio/operator/resources/?timeout=120&ref=${VERSION}" > operator.yaml
kubectl apply -f operator.yaml
```

Run the following command to verify the status of the Operator:
Expand All @@ -227,24 +194,46 @@ interface for creating and managing MinIO Tenants.

The `minio-operator-*` pod runs the MinIO Operator itself.

### 2) Access the Operator Console
### 2) Access the Operator Console via NodePort

Run the following command to create a local proxy to the MinIO Operator
Console:
Get the token:

```sh
kubectl minio proxy -n minio-operator
kubectl apply -f - <<EOF
apiVersion: v1
kind: Secret
metadata:
name: console-sa-secret
namespace: minio-operator
annotations:
kubernetes.io/service-account.name: console-sa
type: kubernetes.io/service-account-token
EOF
SA_TOKEN=$(kubectl -n minio-operator get secret console-sa-secret -o jsonpath="{.data.token}" | base64 --decode)
echo $SA_TOKEN
```

The output resembles the following:

```sh
kubectl minio proxy
Starting port forward of the Console UI.
Change the console service to use NodePort:

To connect open a browser and go to http://localhost:9090

Current JWT to login: TOKENSTRING
```yaml
spec:
ports:
- name: http
protocol: TCP
port: 9090
targetPort: 9090
nodePort: 30080 <--------------- Using this port in the node
- name: https
protocol: TCP
port: 9443
targetPort: 9443
nodePort: 30869
selector:
app: console
clusterIP: 10.96.69.150
clusterIPs:
- 10.96.69.150
type: NodePort <-------------------- Using NodePort
```

Open your browser to the provided address and use the JWT token to log in
Expand Down
88 changes: 88 additions & 0 deletions krew-plugin.md
@@ -0,0 +1,88 @@
### 1) Install the MinIO Operator via Krew Plugin

Run the following commands to install the MinIO Operator and Plugin using the Kubernetes ``krew`` plugin manager:

```sh
kubectl krew update
kubectl krew install minio
```

See the ``krew`` [installation documentation](https://krew.sigs.k8s.io/docs/user-guide/setup/install/) for instructions
on installing ``krew``.

Run the following command to verify installation of the plugin:

```sh
kubectl minio version
```

As an alternative to `krew`, you can download the `kubectl-minio` plugin from
the [Operator Releases Page](https://github.com/minio/operator/releases). Download the `kubectl-minio` package
appropriate for your operating system and extract the contents as `kubectl-minio`. Set the `kubectl-minio` binary to be
executable (e.g. `chmod +x`) and place it in your system `PATH`.

For example, the following code downloads the latest stable version of the MinIO Kubernetes Plugin and installs it to
the system ``$PATH``. The example assumes a Linux operating system:

```sh
wget -qO- https://github.com/minio/operator/releases/latest/download/kubectl-minio_linux_amd64_v1.zip | sudo bsdtar -xvf- -C /usr/local/bin
sudo chmod +x /usr/local/bin/kubectl-minio
```

Run the following command to verify installation of the plugin:

```sh
kubectl minio version
```

Run the following command to initialize the Operator:

```sh
kubectl minio init
```

Run the following command to verify the status of the Operator:

```sh
kubectl get pods -n minio-operator
```

The output resembles the following:

```sh
NAME READY STATUS RESTARTS AGE
console-6b6cf8946c-9cj25 1/1 Running 0 99s
minio-operator-69fd675557-lsrqg 1/1 Running 0 99s
```

The `console-*` pod runs the MinIO Operator Console, a graphical user
interface for creating and managing MinIO Tenants.

The `minio-operator-*` pod runs the MinIO Operator itself.

### 2) Access the Operator Console

Run the following command to create a local proxy to the MinIO Operator
Console:

```sh
kubectl minio proxy -n minio-operator
```

The output resembles the following:

```sh
kubectl minio proxy
Starting port forward of the Console UI.

To connect open a browser and go to http://localhost:9090

Current JWT to login: TOKENSTRING
```

Open your browser to the provided address and use the JWT token to log in
to the Operator Console.

![Operator Console](docs/images/operator-console.png)

Click **+ Create Tenant** to open the Tenant Creation workflow.

0 comments on commit 99d7e4c

Please sign in to comment.