From f997855f9709435a01d03cba03d99ea4bb078878 Mon Sep 17 00:00:00 2001 From: "Waylon S. Walker" Date: Sun, 29 Oct 2023 18:04:02 -0500 Subject: [PATCH] minio working --- minio/deployment.yaml | 107 +++++++++++++++++++++++++++++++++++++++ minio/docker-compose.yml | 16 +++--- minio/ingress.yaml | 37 ++++++++++++++ minio/justfile | 32 ++++++++++++ minio/secret.yaml | 7 +++ 5 files changed, 193 insertions(+), 6 deletions(-) create mode 100644 minio/deployment.yaml create mode 100644 minio/ingress.yaml create mode 100644 minio/justfile create mode 100644 minio/secret.yaml diff --git a/minio/deployment.yaml b/minio/deployment.yaml new file mode 100644 index 0000000..914d70e --- /dev/null +++ b/minio/deployment.yaml @@ -0,0 +1,107 @@ +apiVersion: v1 +kind: Service +metadata: + annotations: + kompose.cmd: kompose convert -o deployment.yaml -n minio --replicas 3 + kompose.version: 1.31.2 (a92241f79) + creationTimestamp: null + labels: + io.kompose.service: sandcrawler + name: sandcrawler + namespace: minio +spec: + ports: + - name: "9000" + port: 9000 + targetPort: 9000 + - name: "9001" + port: 9001 + targetPort: 9001 + selector: + io.kompose.service: sandcrawler +status: + loadBalancer: {} + +--- +apiVersion: v1 +kind: Namespace +metadata: + creationTimestamp: null + name: minio + namespace: minio +spec: {} +status: {} + +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -o deployment.yaml -n minio --replicas 3 + kompose.version: 1.31.2 (a92241f79) + creationTimestamp: null + labels: + io.kompose.service: sandcrawler + name: sandcrawler + namespace: minio +spec: + replicas: 3 + selector: + matchLabels: + io.kompose.service: sandcrawler + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -o deployment.yaml -n minio --replicas 3 + kompose.version: 1.31.2 (a92241f79) + creationTimestamp: null + labels: + io.kompose.network/minio-default: "true" + io.kompose.service: sandcrawler + spec: + containers: + - args: + - server + - --console-address + - :9001 + - /data + image: minio/minio + name: sandcrawler + ports: + - containerPort: 9000 + protocol: TCP + - containerPort: 9001 + protocol: TCP + resources: {} + volumeMounts: + - mountPath: /data + name: minio-storage + envFrom: + - secretRef: + name: minio-secret + restartPolicy: Always + volumes: + - name: minio-storage + persistentVolumeClaim: + claimName: minio-storage + +status: {} + +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: minio-storage + name: minio-storage + namespace: minio +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/minio/docker-compose.yml b/minio/docker-compose.yml index 2dfc2b2..f1facf2 100644 --- a/minio/docker-compose.yml +++ b/minio/docker-compose.yml @@ -1,17 +1,21 @@ -version: '3' +version: "3" services: sandcrawler: image: minio/minio ports: - - "9090:9000" - - "9091:9001" + - 9000 + - 9001 volumes: - - /mnt/vault/sandcrawler:/data + - minio_storage:/data environment: - MINIO_ROOT_USER: $MINIO_ROOT_USER - MINIO_ROOT_PASSWORD: $MINIO_ROOT_PASSWORD + MINIO_ROOT_USER: waylon + MINIO_ROOT_PASSWORD: password command: server --console-address ":9001" /data + # labels: + # kompose.service.expose: minio.wayl.one, minio-ui.wayl.one + # kompose.image-pull-secret: regcred + volumes: minio_storage: {} diff --git a/minio/ingress.yaml b/minio/ingress.yaml new file mode 100644 index 0000000..46e4952 --- /dev/null +++ b/minio/ingress.yaml @@ -0,0 +1,37 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + kompose.cmd: kompose convert -o deployment.yaml -n minio --replicas 3 + kompose.image-pull-secret: regcred + kompose.service.expose: minio.wayl.one, minio-ui.wayl.one + kompose.version: 1.31.2 (a92241f79) + creationTimestamp: null + labels: + io.kompose.service: sandcrawler + name: sandcrawler + namespace: minio +spec: + rules: + - host: minio.wayl.one + http: + paths: + - backend: + service: + name: sandcrawler + port: + number: 9000 + path: / + pathType: Prefix + - host: minio-ui.wayl.one + http: + paths: + - backend: + service: + name: sandcrawler + port: + number: 9001 + path: / + pathType: Prefix +status: + loadBalancer: {} diff --git a/minio/justfile b/minio/justfile new file mode 100644 index 0000000..e3086c7 --- /dev/null +++ b/minio/justfile @@ -0,0 +1,32 @@ +default: cred convert deploy viz +update: convert patch + +create-ns: + kubectl create ns minio +cred: + kubectl get secret -n default regcred --output=yaml -o yaml | sed 's/namespace: default/namespace: minio/' | kubectl apply -n minio -f - && echo deployed secret || echo secret exists +convert: + kompose convert -o deployment.yaml -n minio --replicas 3 +deploy: + kubectl apply -f deployment.yaml + kubectl apply -f ingress.yaml +delete: + kubectl delete all --all -n minio --timeout=0s +viz: + k8sviz -n minio --kubeconfig $KUBECONFIG -t png -o minio-k8s.png +restart: + kubectl rollout restart -n minio deployment/sandcrawler + +patch: + kubectl patch -f deployment.yaml +describe: + kubectl get deployment -n minio + kubectl get rs -n minio + kubectl get pod -n minio + kubectl get svc -n minio + kubectl get ing -n minio + +describe-pod: + kubectl describe pod -n minio +logs: + kubectl logs --all-containers -l io.kompose.service=minio-wayl-one -n minio -f diff --git a/minio/secret.yaml b/minio/secret.yaml new file mode 100644 index 0000000..d89595e --- /dev/null +++ b/minio/secret.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: Secret +metadata: + name: minio-secret +data: + MINIO_ROOT_USER: "d2F5bG9uCg==" + MINIO_ROOT_PASSWORD: "TnpwWTRIKllCMnVncSQK"