From a53b5a20e4048d713d2e2f9ae2239a97499c5c98 Mon Sep 17 00:00:00 2001 From: Domagoj Zecevic Date: Fri, 3 Sep 2021 11:43:52 +0200 Subject: [PATCH] added minio for production --- infra/minIO/console.yaml | 75 +++++++++++++++++++++++++++++++ infra/minIO/server.yaml | 95 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 170 insertions(+) create mode 100644 infra/minIO/console.yaml create mode 100644 infra/minIO/server.yaml diff --git a/infra/minIO/console.yaml b/infra/minIO/console.yaml new file mode 100644 index 0000000..4e6a43a --- /dev/null +++ b/infra/minIO/console.yaml @@ -0,0 +1,75 @@ +# Deployment description +apiVersion: apps/v1 +kind: Deployment +metadata: + name: minio-console-deployment + namespace: infra-environment + labels: + app: minio-console +spec: + strategy: + type: Recreate + replicas: 1 + selector: + matchLabels: + app: minio-console + template: + metadata: + labels: + app: minio-console + spec: + containers: + - name: console + image: minio/console:v0.8.2 + args: + - server + resources: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "256Mi" + cpu: "4" + ports: + - containerPort: 9090 + name: minio-console + protocol: TCP + env: + - name: CONSOLE_PORT + value: "9090" + - name: CONSOLE_MINIO_SERVER + value: "http://minio-api.k8s.semprod.local" +--- +# Minio console Service +apiVersion: v1 +kind: Service +metadata: + name: minio-console + namespace: infra-environment +spec: + selector: + app: minio-console + ports: + - name: minio-console + port: 9090 + targetPort: minio-console + type: NodePort +--- + +# Ingress description +apiVersion: networking.k8s.io/v1beta1 +kind: Ingress +metadata: + name: minio-console-ingress + namespace: infra-environment + annotations: + kubernetes.io/ingress.class: "traefik" +spec: + rules: + - host: minio.k8s.semprod.local + http: + paths: + - path: / + backend: + serviceName: minio-console + servicePort: 9090 \ No newline at end of file diff --git a/infra/minIO/server.yaml b/infra/minIO/server.yaml new file mode 100644 index 0000000..66058fb --- /dev/null +++ b/infra/minIO/server.yaml @@ -0,0 +1,95 @@ +# Deployment description +apiVersion: apps/v1 +kind: Deployment +metadata: + name: minio-deployment + namespace: infra-environment + labels: + app: minio +spec: + strategy: + type: Recreate + replicas: 1 + selector: + matchLabels: + app: minio + template: + metadata: + labels: + app: minio + spec: + containers: + - name: minio + image: minio/minio:RELEASE.2021-07-08T19-43-25Z.hotfix.a37033a46 + args: ['server', '/data',] + resources: + requests: + memory: "256Mi" + cpu: "100m" + limits: + memory: "512Mi" + cpu: "4" + ports: + - containerPort: 9000 + name: minio-api + protocol: TCP + volumeMounts: + - mountPath: /data + name: minio-pv + env: + - name: MINIO_BROWSER_REDIRECT_URL + value: "http://minio.k8s.semprod.local/" + volumes: + - name: minio-pv + persistentVolumeClaim: + claimName: minio-pvc +--- +# Persistent Volume Claim description +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: minio-pvc + namespace: infra-environment + labels: + app: minio +spec: + storageClassName: longhorn + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 2Gi +--- +# Minio Service +apiVersion: v1 +kind: Service +metadata: + name: minio-api + namespace: infra-environment +spec: + selector: + app: minio + ports: + - name: minio + port: 9000 + targetPort: minio-api + type: NodePort +--- + +# Ingress description +apiVersion: networking.k8s.io/v1beta1 +kind: Ingress +metadata: + name: minio-ingress + namespace: infra-environment + annotations: + kubernetes.io/ingress.class: "traefik" +spec: + rules: + - host: minio-api.k8s.semprod.local + http: + paths: + - path: / + backend: + serviceName: minio-api + servicePort: 9000 \ No newline at end of file