https://github.com/minio/m3 custom nginx tooling
1.6K
MinIO Kubernetes Cloud
A binary release can be downloaded via
curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
go get github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go get github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
go get github.com/golang/protobuf/protoc-gen-go
go get sigs.k8s.io/[email protected]
m3cluster) using kindProvision the local kubernetes cluster for test/development
inside /k8s run:
cd k8s/; ./create-kind.sh
kubectl proxy
Log in to the dashboard at http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/#!/login
To get the access token
kubectl get secret $(kubectl get serviceaccount dashboard -o jsonpath="{.secrets[0].name}") -o jsonpath="{.data.token}" | base64 --decode
m3(The following instructions assume that you are in the top-level directory of this repository)
m3 locallymake m3
m3 local docker image and push it to your local kubernetesmake k8sdev TAG=minio/m3:dev
./k8s/deployments/m3-deployment.yaml.example into ./k8s/deployments/m3-deployment.yaml./k8s/deployments/m3-deployment.yamlReplace all the <TOKENS> with their corresponding values, for example <DEV_EMAIL> with your personal email.
A valid smtp account is needed, if you don't have one we recommend you create a gmail account and enable Less Secure Apps access
kubectl apply -f k8s/deployments/m3-deployment.yaml
Install and deploy to k8s your preferred frontend and backend portal
Frontend service name must be called portal and run in port 80
Start m3 development environment
./m3 dev
./m3 set-password <YOUR_TOKEN>
./m3 login
Mkube supports the use of custom CA for the kms if need it.
Load the custom ca certificate using a configmap
kubectl create configmap kms-ca-cert --from-file=customCA.crt
Then set the configmap name and certificate file name on m3-deployment.yaml by uncommenting the following env variables
KMS_CA_CERT_CONFIG_MAP: "kms-ca-cert"
KMS_CA_CERT_FILE_NAME: "customCA.crt"
Apply changes for mkube running kubectl apply -f k8s/deployment/m3-deployment.yaml
./m3 cluster sc add --name my-dc-rack-1
./m3 cluster nodes add --name node-1 --k8s_label m3cluster-worker --volumes /mnt/disk{1...4}
For development add 3 additional nodes
./m3 cluster nodes add --name node-2 --k8s_label m3cluster-worker2 --volumes /mnt/disk{1...4}
./m3 cluster nodes add --name node-3 --k8s_label m3cluster-worker3 --volumes /mnt/disk{1...4}
./m3 cluster nodes add --name node-4 --k8s_label m3cluster-worker4 --volumes /mnt/disk{1...4}
./m3 cluster nodes assign --storage_cluster my-dc-rack-1 --node node-1
For development assign the remaining 3 nodes
./m3 cluster nodes assign --storage_cluster my-dc-rack-1 --node node-2
./m3 cluster nodes assign --storage_cluster my-dc-rack-1 --node node-3
./m3 cluster nodes assign --storage_cluster my-dc-rack-1 --node node-4
./m3 cluster sc sg add --storage_cluster my-dc-rack-1 --name group-1
./m3 tenant add company-name --admin_name="John Doe" --admin_email="[email protected]"
If the company name is not url-friendly a short name will be generated, but it can also be specified as shown below.
./m3 tenant add "Commpany® Inc." --short_name company-inc --admin_name="John Doe" --admin_email="[email protected]"
./m3 admin add "Admin Name" [email protected]
./m3 tenant bucket add tenant-short-name bucket-name
or
./m3 tenant bucket add --tenant_name tenant-short-name --bucket_name bucket-name
./m3 tenant user add --tenant company-inc --name somename --email [email protected] --password user1234
or
./m3 tenant user add somename company-inc [email protected] user1234
./m3 tenant service-account add tenant-short-name service-account-name
or
./m3 tenant service-account add --tenant_name tenant-short-name --name service-account-name --description "optional"
To grant write permission to bucketA and bucketB
./m3 tenant permission add acme SAMPLE allow write "bucketA,bucketB"
The nginx router should be exposed on your local on port 9000 after doing ./m3 dev
Modify your /etc/hosts and add the following record
127.0.0.1 s3.localhost
Then in your browser go to: http://company-short-name.s3.localhost:9000/, you can add more tenants and access them via a subdomain in localhost for now.
cd portal-ui
make k8sdev
cd ..
kubectl apply -f k8s/deployments/m3-portal-frontend-deployment.yaml
nginx-resolver service that should be able to route to Minio tenantskubectl port-forward svc/nginx-resolver 9000:80
portal-proxy service that should be able to route to the Portal UI.kubectl port-forward svc/portal-proxy 9080:80
Content type
Image
Digest
Size
56 MB
Last updated
over 6 years ago
docker pull minio/m3-nginx:edge