From ee5a31021c1c5244fd97c49d1c8b65bb063a3b3a Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Thu, 6 Mar 2025 21:01:28 +0100 Subject: [PATCH] Update Dev documentation --- docs/DevelopmentSetup.md | 54 ++++++++++++++++++++++++++++++++-- test/test-outside-cluster.yaml | 4 +-- yaml/minio-dev-deployment.yml | 4 +-- 3 files changed, 56 insertions(+), 6 deletions(-) diff --git a/docs/DevelopmentSetup.md b/docs/DevelopmentSetup.md index f67595d..e2f3019 100644 --- a/docs/DevelopmentSetup.md +++ b/docs/DevelopmentSetup.md @@ -1,6 +1,10 @@ # Setup for development This guide will present you how to prepare your computer to update features of MinioK8SBucket + +## Install Rust +As this project has been written using Rust, you will need to install it prior working on MinioK8SBucket. Please follow the official instructions: https://www.rust-lang.org/tools/install + ## Install Minikube First, you need to install Minikube on your computer to have a K8S environment. In order to do this, please follow the official instructions: https://minikube.sigs.k8s.io/docs/start @@ -32,10 +36,15 @@ Clone this repository using: https://gitea.communiquons.org/pierre/MinioK8sBuckets ``` -!!! warning "Gitea account request" +!!! note "Gitea account request" If you want to get a Gitea account to make pull request on this repository, you will need to contact me at: `pierre.git@communiquons.org` ## Deploy Minio +First, enable Minikube tunnel: +```bash +minikube tunnel --bind-address '127.0.0.1' +``` + You will then need to deploy Minio in Minikube. Apply the Minio deployment located at the in MinioK8SBucket repository: ```bash @@ -46,4 +55,45 @@ Check for launching of pod: ```bash minikube kubectl -- get pods -w -``` \ No newline at end of file +``` + +Check for the availability of the service: + +```bash +minikube kubectl -- get services +``` + +You should get a result similar to this one: + +``` +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +kubernetes ClusterIP 10.96.0.1 443/TCP 31m +minio LoadBalancer 10.103.82.87 127.0.0.1 9000:30656/TCP,9090:31369/TCP 6m40s +``` + +You should be able to access minio at the following address: http://127.0.0.1:9090 + +Minio API should be available at: http://127.0.0.1:9000/ + +## Deploy CRD +You will need then to deploy the Custom Resource Definitions of MinioK8S bucket using the following command: + +```bash +minikube kubectl -- apply -f yaml/crd.yaml +``` + +## Run operator +You can then run the project using the following command: + +```bash +cargo fmt && cargo clippy && RUST_LOG=debug cargo run -- +``` + +## Create a first bucket +You should be able to create a first bucket using the following command: + +```bash +minikube kubectl -- apply -f test/test-outside-cluster.yaml +``` + +Have fun working for MinioK8SBucket! \ No newline at end of file diff --git a/test/test-outside-cluster.yaml b/test/test-outside-cluster.yaml index 5f9e072..40e8e59 100644 --- a/test/test-outside-cluster.yaml +++ b/test/test-outside-cluster.yaml @@ -12,7 +12,7 @@ kind: MinioInstance metadata: name: my-minio-instance spec: - endpoint: http://localhost:9000/ + endpoint: http://localhost:9000 credentials: minio-root --- apiVersion: "communiquons.org/v1" @@ -22,4 +22,4 @@ metadata: spec: instance: my-minio-instance name: first-bucket - secret: first-bucket-secret \ No newline at end of file + secret: first-bucket-secret diff --git a/yaml/minio-dev-deployment.yml b/yaml/minio-dev-deployment.yml index 02790f4..fa76e45 100644 --- a/yaml/minio-dev-deployment.yml +++ b/yaml/minio-dev-deployment.yml @@ -26,7 +26,7 @@ spec: - containerPort: 9000 protocol: TCP name: api - - containerPort: 9001 + - containerPort: 9090 protocol: TCP name: console args: @@ -84,6 +84,6 @@ spec: port: 9000 targetPort: api - name: console - port: 9001 + port: 9090 targetPort: console externalTrafficPolicy: Local