From 8d8942d3608e7ad54b82ff0bb318ba9d8db41c9c Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Thu, 6 Mar 2025 20:41:22 +0100 Subject: [PATCH] Start to write dev guide --- docs/DevelopmentSetup.md | 49 +++++++++++++++++++ yaml/minio-dev-deployment.yml | 89 +++++++++++++++++++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 docs/DevelopmentSetup.md create mode 100644 yaml/minio-dev-deployment.yml diff --git a/docs/DevelopmentSetup.md b/docs/DevelopmentSetup.md new file mode 100644 index 0000000..f67595d --- /dev/null +++ b/docs/DevelopmentSetup.md @@ -0,0 +1,49 @@ +# Setup for development +This guide will present you how to prepare your computer to update features of MinioK8SBucket + +## 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 + + +## Start Minikube +You will then need to start Minikube using the following command: + +```bash +minikube start +``` + +You can then make sure that Minikube is working properly: + +``` +minikube kubectl get nodes +``` + +You should get a response similar to this one: + +``` +NAME STATUS ROLES AGE VERSION +minikube Ready control-plane 2m16s v1.32.0 +``` + +## Clone repository +Clone this repository using: + +```bash +https://gitea.communiquons.org/pierre/MinioK8sBuckets +``` + +!!! warning "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 +You will then need to deploy Minio in Minikube. Apply the Minio deployment located at the in MinioK8SBucket repository: + +```bash +minikube kubectl -- apply -f yaml/minio-dev-deployment.yml +``` + +Check for launching of pod: + +```bash +minikube kubectl -- get pods -w +``` \ No newline at end of file diff --git a/yaml/minio-dev-deployment.yml b/yaml/minio-dev-deployment.yml new file mode 100644 index 0000000..02790f4 --- /dev/null +++ b/yaml/minio-dev-deployment.yml @@ -0,0 +1,89 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: minio + labels: + app: minio +spec: + replicas: 1 + selector: + matchLabels: + app: minio + template: + metadata: + labels: + app: minio + spec: + volumes: + - name: data + persistentVolumeClaim: + claimName: minio + containers: + - name: minio + image: minio/minio + imagePullPolicy: Always + ports: + - containerPort: 9000 + protocol: TCP + name: api + - containerPort: 9001 + protocol: TCP + name: console + args: + - server + - /data + - --console-address + - ":9090" + env: + - name: MINIO_ROOT_USER + value: minioadmin + - name: MINIO_ROOT_PASSWORD + value: minioadmin + volumeMounts: + - mountPath: "/data" + name: data + +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: minio +spec: + storageClassName: manual + accessModes: + - ReadWriteOnce + capacity: + storage: 5Gi + hostPath: + path: /data/minio/ +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: minio +spec: + storageClassName: manual + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 3Gi +--- +apiVersion: v1 +kind: Service +metadata: + name: minio + labels: + app: minio +spec: + type: LoadBalancer + selector: + app: minio + ports: + - name: api + port: 9000 + targetPort: api + - name: console + port: 9001 + targetPort: console + externalTrafficPolicy: Local