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

Addon Minio-operator #689

Merged
merged 23 commits into from
May 19, 2023
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
aa34a06
Added postgres-operator
MdSahil-oss Jan 31, 2023
36169a8
Merge remote-tracking branch 'upstream/master'
MdSahil-oss Jan 31, 2023
0ed9f6e
Merge remote-tracking branch 'upstream/master'
MdSahil-oss Feb 4, 2023
a9c0a66
Resolved merge conflict
MdSahil-oss Feb 10, 2023
f6abee7
Merge remote-tracking branch 'upstream/master'
MdSahil-oss Feb 22, 2023
a25efc5
Removed unwanted changes
MdSahil-oss Feb 24, 2023
3c29f74
Merge remote-tracking branch 'upstream/master'
MdSahil-oss Mar 14, 2023
a34505e
Fixed unwanted mistake
MdSahil-oss Mar 14, 2023
d14f671
Merge remote-tracking branch 'upstream/master'
MdSahil-oss Mar 21, 2023
215a575
Merge remote-tracking branch 'upstream/master'
MdSahil-oss Apr 7, 2023
59bf0b5
Merge remote-tracking branch 'upstream/master'
MdSahil-oss Apr 14, 2023
d1d936b
Merge remote-tracking branch 'upstream/master'
MdSahil-oss Apr 22, 2023
d3e52c4
Merge remote-tracking branch 'upstream/master'
MdSahil-oss Apr 25, 2023
d31939f
Merge remote-tracking branch 'upstream/master'
MdSahil-oss Apr 28, 2023
d874cb7
Added minio-operator installation support
MdSahil-oss Apr 28, 2023
c44d6db
updated installation process
MdSahil-oss Apr 29, 2023
244531e
Added definition tanant
MdSahil-oss Apr 29, 2023
20d7652
removed tenant definition
MdSahil-oss May 2, 2023
468f8ac
Added Readme
MdSahil-oss May 3, 2023
5278e4d
Updated readme
MdSahil-oss May 3, 2023
79a3139
Updated readme
MdSahil-oss May 3, 2023
6cad468
Readme Updated
MdSahil-oss May 4, 2023
d9474b6
Removed token
MdSahil-oss May 12, 2023
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
127 changes: 127 additions & 0 deletions experimental/addons/minio-operator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# minio-operator

MinIO is a Kubernetes-native high performance object store with an S3-compatible API. The MinIO Kubernetes Operator supports deploying MinIO Tenants onto private and public cloud infrastructures ("Hybrid" Cloud).

## Install

Add experimental registry
```shell
$ vela addon registry add experimental --type=helm --endpoint=https://addons.kubevela.net/experimental/
```

Enable this addon
```shell
$ vela addon enable minio-operator
```

```shell
$ vela ls -A | grep minio
default tenant-sample minio-tenant minio-tenant rendering healthy
vela-system addon-minio-operator ns-minio-operator k8s-objects running healthy
vela-system └─ minio-operator helm running healthy Fetch repository successfully, Create helm release
```

Disable this addon
```shell
$ vela addon disable minio-operator
```

## Use minio-operator

### Access the Operator Console to interact with tenant.

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

```shell
# Get JWT Token to access the console
$ kubectl get secret -n minio-operator console-sa-secret -o=jsonpath='{.data.token}' | base64 --decode
eyJhbGciOiJSUzI1NiIsImtpZCI6ImZoSFNZMFdzUEt3WWpFVFFJdEZwSHZ1ZG9qN1ZwSy1vNC1WUi04b2tpODQifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJtaW5pby1vcGVyYXRvciIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJjb25zb2xlLXNhLXNlY3JldCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJjb25zb2xlLXNhIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQudWlkIjoiYTU3YWZmNmQtZTM5Ni00MGE3LTk0NTAtOTc4OTRkNGViY2MyIiwic3ViIjoic3lzdGVtOnNlcnZpY2VhY2NvdW50Om1pbmlvLW9wZXJhdG9yOmNvbnNvbGUtc2EifQ.h3JageNqfiWBjvMZo2XuDvEIZPwZDh2FBu_R9yAiCM248Lso7h1VVorr3yICInOnk5WcpkX6vbY3iTL-VIuNan4Ehx0WDnup4ctnbOjxGin5TJdJuuQKeIVX5adwVDd7jDPD_Pn6YGVbF2kA4538vFQNjauMw3ykmusyQINcjfq1KudwZRvw4ZCLeUVX0MLIVydQDYc2u6J5pX7OwvCUvyIgd711T9T6hLSdr9Hbp9NqrrqaWizfIlhAKlbdv202QG0U3W--BCj81TrPMZdgvF6N-djavGKB0hGlxBiyUeYJ5ncpzdnFD9ncHzj5y7giKCRBp91ctE1pOWLLFcglPA

MdSahil-oss marked this conversation as resolved.
Show resolved Hide resolved
# Port forward the console
$ kubectl port-forward -n minio-operator svc/console 9090:9090
```

Access the console on port 9090.

Each MinIO tenant represents an independent MinIO Object Store within the Kubernetes cluster

### Build the Tenant Configuration

The Operator Console **Create New Tenant** walkthrough builds out
a MinIO Tenant. The following list describes the basic configuration sections.

- **Name** - Specify the *Name*, *Namespace*, and *Storage Class* for the new Tenant.

The *Storage Class* must correspond to a [Storage Class](#default-storage-class) that corresponds
to [Local Persistent Volumes](#local-persistent-volumes) that can support the MinIO Tenant.

The *Namespace* must correspond to an existing [Namespace](#minio-tenant-namespace) that does *not* contain any other
MinIO Tenant.

Enable *Advanced Mode* to access additional advanced configuration options.

- **Tenant Size** - Specify the *Number of Servers*, *Number of Drives per Server*, and *Total Size* of the Tenant.

The *Resource Allocation* section summarizes the Tenant configuration
based on the inputs above.

Additional configuration inputs may be visible if *Advanced Mode* was enabled
in the previous step.

- **Preview Configuration** - summarizes the details of the new Tenant.

After configuring the Tenant to your requirements, click **Create** to create the new tenant.

The Operator Console displays credentials for connecting to the MinIO Tenant. You *must* download and secure these
credentials at this stage. You cannot trivially retrieve these credentials later.

You can monitor Tenant creation from the Operator Console.

### Connect to the Tenant

Use the following command to list the services created by the MinIO
Operator:

```sh
$ kubectl get svc -n NAMESPACE
```

Replace `NAMESPACE` with the namespace for the MinIO Tenant. The output
resembles the following:

```sh
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S)
minio LoadBalancer 10.104.10.9 <pending> 443:31834/TCP
myminio-console LoadBalancer 10.104.216.5 <pending> 9443:31425/TCP
myminio-hl ClusterIP None <none> 9000/TCP
myminio-log-hl-svc ClusterIP None <none> 5432/TCP
myminio-log-search-api ClusterIP 10.102.151.239 <none> 8080/TCP
myminio-prometheus-hl-svc ClusterIP None <none> 9090/TCP
```

Applications *internal* to the Kubernetes cluster should use the `minio` service for performing object storage
operations on the Tenant.

Administrators of the Tenant should use the `minio-tenant-1-console` service to access the MinIO Console and manage the
Tenant, such as provisioning users, groups, and policies for the Tenant.

MinIO Tenants deploy with TLS enabled by default, where the MinIO Operator uses the
Kubernetes `certificates.k8s.io` API to generate the required x.509 certificates. Each
certificate is signed using the Kubernetes Certificate Authority (CA) configured during
cluster deployment. While Kubernetes mounts this CA on Pods in the cluster, Pods do
*not* trust that CA by default. You must copy the CA to a directory such that the
`update-ca-certificates` utility can find and add it to the system trust store to
enable validation of MinIO TLS certificates:

```sh
$ cp /var/run/secrets/kubernetes.io/serviceaccount/ca.crt /usr/local/share/ca-certificates/
update-ca-certificates
```

For applications *external* to the Kubernetes cluster, you must configure
[Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/) or a
[Load Balancer](https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer) to
expose the MinIO Tenant services. Alternatively, you can use the `kubectl port-forward` command
to temporarily forward traffic from the local host to the MinIO Tenant.

For more please visit https://min.io/docs/minio/kubernetes/upstream/operations/deploy-manage-tenants.html.
13 changes: 13 additions & 0 deletions experimental/addons/minio-operator/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: minio-operator
version: 1.0.0
description: MinIO is a High Performance Object Storage released under GNU AGPLv3 or later. It is API compatible with Amazon S3 cloud storage service. Use MinIO to build high performance infrastructure for machine learning, analytics and application data workloads.
icon: "https://min.io/resources/img/logo/MINIO_wordmark.png"
url: "https://min.io/"

tags:
- minio-operator

invisible: false

dependencies:
- name: fluxcd
11 changes: 11 additions & 0 deletions experimental/addons/minio-operator/parameter.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// parameter.cue is used to store addon parameters.
//
// You can use these parameters in template.cue or in resources/ by 'parameter.myparam'
//
// For example, you can use parameters to allow the user to customize
// container images, ports, and etc.
parameter: {
// +usage=Custom parameter description
namespace: *"minio-operator" | string
clusters?: [...string]
}
52 changes: 52 additions & 0 deletions experimental/addons/minio-operator/template.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package main

output: {
apiVersion: "core.oam.dev/v1beta1"
kind: "Application"
spec: {
components: [
{
name: "ns-minio-operator"
type: "k8s-objects"
properties: objects: [{
kind: "Namespace"
apiVersion: "v1"
metadata:
name: parameter.namespace
}]
},
{
name: "minio-operator"
type: "helm"
properties: {
repoType: "helm"
url: "https://operator.min.io/"
chart: "operator"
version: "5.0.4"
}
},
]
policies: [
{
type: "shared-resource"
name: "minio-operator-ns"
properties: rules: [{
selector: resourceTypes: ["Namespace"]
}]
},
{
type: "topology"
name: "deploy-minio-operator"
properties: {
namespace: parameter.namespace
if parameter.clusters != _|_ {
clusters: parameter.clusters
}
if parameter.clusters == _|_ {
clusterLabelSelector: {}
}
}
},
]
}
}
Loading