Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to use MINIO_BROWSER_REDIRECT_URL for ui subpath in k8s #3250

Closed
pycgo opened this issue Feb 28, 2024 · 7 comments
Closed

how to use MINIO_BROWSER_REDIRECT_URL for ui subpath in k8s #3250

pycgo opened this issue Feb 28, 2024 · 7 comments

Comments

@pycgo
Copy link

pycgo commented Feb 28, 2024

ingress

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: haproxy
  name: minio
spec:
  rules:
  - host: oss.test.com
    http:
      paths:
      - backend:
          service:
            name: minio
            port:
              number: 9001
        path: /minio-console

k8s sts yaml for minio

apiVersion: apps/v1
kind: StatefulSet
metadata:
  labels:
    app: minio
  name: minio
spec:
  replicas: 1
  selector:
    matchLabels:
      app: minio
  serviceName: minio
  template:
    metadata:
      labels:
        app: minio
    spec:
      containers:
      - env:
        - name: BITNAMI_DEBUG
          value: "false"
        - name: MINIO_SCHEME
          value: http
        - name: MINIO_FORCE_NEW_KEYS
          value: "no"
        - name: MINIO_ROOT_USER
          value: linkflow
        - name: MINIO_ROOT_PASSWORD
          value: Sjtu403c@#%
        - name: MINIO_DEFAULT_BUCKETS
          value: oss,dolphinscheduler
        - name: MINIO_PROMETHEUS_AUTH_TYPE
          value: public
        - name: MINIO_BROWSER_REDIRECT_URL
          value: http://oss.test.com/minio-console
        - name: MINIO_CONSOLE_PORT_NUMBER
          value: "9001"
        - name: MINIO_BROWSER
          value: "on"
        - name: MINIO_DATA_DIR
          value: /data
        image: docker.io/bitnami/minio:2024.2.26-debian-12-r0
        imagePullPolicy: Always
        livenessProbe:
          failureThreshold: 5
          httpGet:
            path: /minio/health/live
            port: minio-api
            scheme: HTTP
          initialDelaySeconds: 5
          periodSeconds: 5
          successThreshold: 1
          timeoutSeconds: 5
        name: minio
        ports:
        - containerPort: 9000
          name: minio-api
          protocol: TCP
        - containerPort: 9001
          name: minio-console
          protocol: TCP
        readinessProbe:
          failureThreshold: 5
          initialDelaySeconds: 5
          periodSeconds: 5
          successThreshold: 1
          tcpSocket:
            port: minio-api
          timeoutSeconds: 1
        resources:
          limits:
            memory: 1Gi
          requests:
            memory: 1G
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /data
          name: data
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext:
        fsGroup: 1001
      serviceAccount: linkflow
      serviceAccountName: linkflow
      terminationGracePeriodSeconds: 30
  volumeClaimTemplates:
  - apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: data
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 10Gi
      storageClassName: openebs-hostpath
      volumeMode: Filesystem

why http://oss.test.com/minio-console not work? can anyone help me give some suggestion

Your Environment

  • MinIO version used (minio --version):
  • Server setup and configuration:
  • Operating System and version (uname -a):
@cesnietor
Copy link
Collaborator

@pycgo please try defining the path like /minio-console(/|$)(.*)
and your env variable with a trailing slash like http://oss.test.com/minio-console/ as mentioned in the docs.
Also found this article in case you find it useful for ingress and MinIO. https://jbn1233.medium.com/minio-ui-kubernetes-ingress-subpath-372597a7f448.

@pycgo
Copy link
Author

pycgo commented Apr 16, 2024

@pycgo please try defining the path like /minio-console(/|$)(.*) and your env variable with a trailing slash like http://oss.test.com/minio-console/ as mentioned in the docs. Also found this article in case you find it useful for ingress and MinIO. https://jbn1233.medium.com/minio-ui-kubernetes-ingress-subpath-372597a7f448.

No use, open the webpage and a minio icon will pop up, then it will be blank

@pycgo
Copy link
Author

pycgo commented Apr 16, 2024

I used the document you provided to test it, no use

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$2
    nginx.ingress.kubernetes.io/use-regex: "true"
  generation: 1
  name: minio
spec:
  ingressClassName: nginx
  rules:
  - host: oss.test.com
    http:
      paths:
      - backend:
          service:
            name: minio
            port:
              number: 9001
        path: /minio-console(/|$)(.*)
        pathType: ImplementationSpecific

@cesnietor
Copy link
Collaborator

@pycgo did you try?:

- name: MINIO_BROWSER_REDIRECT_URL
          value: http://oss.test.com/minio-console/

@pycgo
Copy link
Author

pycgo commented Apr 19, 2024

@pycgo did you try?:

- name: MINIO_BROWSER_REDIRECT_URL
          value: http://oss.test.com/minio-console/

yes,This configuration is already present in the yaml configuration of the question I raised

@pjuarezd
Copy link
Member

@pycgo you need to define MINIO_SERVER_URL as well, here we have an example using Ingress and MinIO Operator, however all you need is to set both: MINIO_BROWSER_REDIRECT_URL and MINIO_SERVER_URL.

This is the documentation about MINIO_SERVER_URL

@pjuarezd pjuarezd removed the triage label May 20, 2024
@pjuarezd
Copy link
Member

Closing this for now, let us know how it goes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants