From 06de7c53ba6c51c44ac966663c43908962187074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Tue, 1 Aug 2023 21:11:13 +0300 Subject: [PATCH] minio-clusters: Clean up ingresses --- minio-clusters/README.md | 2 +- minio-clusters/dedicated.yaml | 51 +++++++++++ minio-clusters/external.yaml | 89 +++++++++++++++++++ .../{application.yaml => shared.yaml} | 85 +----------------- 4 files changed, 145 insertions(+), 82 deletions(-) create mode 100644 minio-clusters/dedicated.yaml create mode 100644 minio-clusters/external.yaml rename minio-clusters/{application.yaml => shared.yaml} (55%) diff --git a/minio-clusters/README.md b/minio-clusters/README.md index e19e93f..973f0b2 100644 --- a/minio-clusters/README.md +++ b/minio-clusters/README.md @@ -6,5 +6,5 @@ This namespace houses Minio clusters managed by To update bump the `image` tag for the classes and issue: ``` -kubectl apply -n minio-clusters -f application.yaml +kubectl apply -n minio-clusters -f dedicated.yaml -f external.yaml -f shared.yaml ``` diff --git a/minio-clusters/dedicated.yaml b/minio-clusters/dedicated.yaml new file mode 100644 index 0000000..33b5095 --- /dev/null +++ b/minio-clusters/dedicated.yaml @@ -0,0 +1,51 @@ +--- +apiVersion: codemowers.io/v1alpha1 +kind: ClusterBucketClass +metadata: + name: dedicated +spec: + targetNamespace: minio-clusters + description: "Dedicated Minio clusters" + replicas: 4 + storageClass: minio + podSpec: + containers: + - name: minio + env: + - name: MINIO_PROMETHEUS_AUTH_TYPE + value: public + image: minio/minio:RELEASE.2023-02-17T17-52-43Z + args: + - server + - --address + - 0.0.0.0:9000 + - --console-address + - 0.0.0.0:9001 + ports: + - containerPort: 9000 + name: http + - containerPort: 9001 + name: console + readinessProbe: + httpGet: + path: /minio/health/ready + port: 9000 + initialDelaySeconds: 2 + periodSeconds: 5 + resources: + requests: + cpu: 300m + memory: 1Gi + limits: + cpu: 4000m + memory: 2Gi + volumeMounts: + - name: data + mountPath: /data + nodeSelector: + dedicated: storage + tolerations: + - effect: NoSchedule + key: dedicated + operator: Equal + value: storage diff --git a/minio-clusters/external.yaml b/minio-clusters/external.yaml new file mode 100644 index 0000000..cd9a614 --- /dev/null +++ b/minio-clusters/external.yaml @@ -0,0 +1,89 @@ +--- +apiVersion: codemowers.io/v1alpha1 +kind: ClusterBucketClass +metadata: + name: external +spec: + description: "Minio instance running on the ZFS storage box" + targetNamespace: minio-clusters + targetCluster: external +--- +apiVersion: v1 +kind: Service +metadata: + name: external + namespace: minio-clusters +spec: + externalName: 172.20.9.2 + ports: + - name: http + protocol: TCP + port: 80 + targetPort: 9000 + type: ExternalName +--- +apiVersion: v1 +kind: Service +metadata: + name: external-console + namespace: minio-clusters +spec: + externalName: 172.20.9.2 + ports: + - name: http + protocol: TCP + port: 80 + targetPort: 9001 + type: ExternalName +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: external + namespace: minio-clusters + annotations: + kubernetes.io/ingress.class: traefik + traefik.ingress.kubernetes.io/router.entrypoints: websecure + traefik.ingress.kubernetes.io/router.tls: "true" + external-dns.alpha.kubernetes.io/target: traefik.k-space.ee +spec: + rules: + - host: minio-cluster-external.k-space.ee + http: + paths: + - pathType: Prefix + path: "/" + backend: + service: + name: external + port: + name: http + tls: + - hosts: + - "*.k-space.ee" +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: external-console + namespace: minio-clusters + annotations: + kubernetes.io/ingress.class: traefik + traefik.ingress.kubernetes.io/router.entrypoints: websecure + traefik.ingress.kubernetes.io/router.tls: "true" + external-dns.alpha.kubernetes.io/target: traefik.k-space.ee +spec: + rules: + - host: minio-cluster-external-console.k-space.ee + http: + paths: + - pathType: Prefix + path: "/" + backend: + service: + name: external-console + port: + name: http + tls: + - hosts: + - "*.k-space.ee" diff --git a/minio-clusters/application.yaml b/minio-clusters/shared.yaml similarity index 55% rename from minio-clusters/application.yaml rename to minio-clusters/shared.yaml index 753ec5b..16b6a1b 100644 --- a/minio-clusters/application.yaml +++ b/minio-clusters/shared.yaml @@ -1,15 +1,6 @@ --- apiVersion: codemowers.io/v1alpha1 kind: ClusterBucketClass -metadata: - name: external -spec: - description: "Minio instance running on the ZFS storage box" - targetNamespace: minio-clusters - targetCluster: external ---- -apiVersion: codemowers.io/v1alpha1 -kind: ClusterBucketClass metadata: name: shared spec: @@ -60,61 +51,10 @@ spec: operator: Equal value: storage --- -apiVersion: codemowers.io/v1alpha1 -kind: ClusterBucketClass -metadata: - name: dedicated -spec: - targetNamespace: minio-clusters - description: "Dedicated Minio clusters" - replicas: 4 - storageClass: minio - podSpec: - containers: - - name: minio - env: - - name: MINIO_PROMETHEUS_AUTH_TYPE - value: public - image: minio/minio:RELEASE.2023-02-17T17-52-43Z - args: - - server - - --address - - 0.0.0.0:9000 - - --console-address - - 0.0.0.0:9001 - ports: - - containerPort: 9000 - name: http - - containerPort: 9001 - name: console - readinessProbe: - httpGet: - path: /minio/health/ready - port: 9000 - initialDelaySeconds: 2 - periodSeconds: 5 - resources: - requests: - cpu: 300m - memory: 1Gi - limits: - cpu: 4000m - memory: 2Gi - volumeMounts: - - name: data - mountPath: /data - nodeSelector: - dedicated: storage - tolerations: - - effect: NoSchedule - key: dedicated - operator: Equal - value: storage ---- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: minio-cluster-shared + name: shared namespace: minio-clusters annotations: kubernetes.io/ingress.class: traefik @@ -130,40 +70,23 @@ spec: path: "/" backend: service: - name: minio-cluster-shared + name: shared port: name: http tls: - hosts: - "*.k-space.ee" --- -apiVersion: v1 -kind: Service -metadata: - name: minio-cluster-shared-console - namespace: minio-clusters -spec: - ports: - - name: http - protocol: TCP - port: 80 - targetPort: 9001 - selector: - app.kubernetes.io/instance: shared - app.kubernetes.io/name: minio - clusterIP: None ---- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: minio-cluster-shared-console + name: shared-console namespace: minio-clusters annotations: kubernetes.io/ingress.class: traefik traefik.ingress.kubernetes.io/router.entrypoints: websecure traefik.ingress.kubernetes.io/router.tls: "true" external-dns.alpha.kubernetes.io/target: traefik.k-space.ee - traefik.ingress.kubernetes.io/router.middlewares: traefik-sso@kubernetescrd spec: rules: - host: minio-cluster-shared-console.k-space.ee @@ -173,7 +96,7 @@ spec: path: "/" backend: service: - name: minio-cluster-shared-console + name: shared-console port: name: http tls: