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

MinIOJob Tenant service endpoint wrong if Tenant is in other namespace #2293

Closed
chrmang opened this issue Aug 26, 2024 · 0 comments · Fixed by #2296
Closed

MinIOJob Tenant service endpoint wrong if Tenant is in other namespace #2293

chrmang opened this issue Aug 26, 2024 · 0 comments · Fixed by #2296
Assignees
Labels
bug Something isn't working community

Comments

@chrmang
Copy link

chrmang commented Aug 26, 2024

I want to run a MinIOJob to create users and buckets in a different namespace than Tenant.
I followed documentation https://github.com/minio/operator/blob/master/docs/minio-job.md for creating resources
and https://min.io/docs/minio/kubernetes/upstream/developers/sts-for-operator.html to configure it for cross namespace.

access with mc works without any issues.

Based on the fix for #2290 I tried it again, but found an other issue.

The Jobs started from MinIOJob are trying to access the wrong endpoint:
The error message of the Pod is:
mc: <ERROR> Unable to make bucket 'myminio/dev'. Put "http://minio.dev.svc.cluster.local/dev/": dial tcp: lookup minio.dev.svc.cluster.local on 10.96.0.10:53: no such host

The Tenant is in namespace minio-tenant. The used endpoint should be minio.minio-tenant.svc.cluster.local

The configuration is the same as in #2290:

namespace minio-tenant

apiVersion: minio.min.io/v2
kind: Tenant
metadata:
  name: mytenant
  namespace: minio-tenant
spec:
  requestAutoCert: false
  env:
    - name: MINIO_DOMAIN
      value: <set according to doc>
    - name: MINIO_BROWSER_REDIRECT_URL
      value: <set according to doc>
    - name: MINIO_SERVER_URL
      value: <set according to doc>
  configuration:
    name: tenant-config
  pools:
    - name: pool-0
      servers: 1
      volumesPerServer: 1
      volumeClaimTemplate:
        metadata:
          name: data
        spec:
          accessModes:
            - ReadWriteOnce
          resources:
            requests:
              storage: 20Gi
apiVersion: sts.min.io/v1alpha1
kind: PolicyBinding
metadata:
  name: minio-job
  namespace: minio-tenant
spec:
  application:
    serviceaccount: minio-job
    namespace: dev
  policies:
    - consoleAdmin

namespace dev (using minio-tenant)

apiVersion: v1
kind: ServiceAccount
metadata:
  name: minio-job
  namespace: dev
apiVersion: job.min.io/v1alpha1
kind: MinIOJob
metadata:
  name: minio-job
  namespace: dev
spec:
  #  mcImage: quay.io/minio/mc:latest
  serviceAccountName: minio-job
  securityContext: {}
  containerSecurityContext: {}
  tenant:
    name: mytenant
    namespace: minio-tenant
  commands:
    - name: create-bucket
      op: make-bucket
      args:
        name: dev

Expected Behavior

The Job startet from MinIOJob using the service endpoint in Tenant namespace from spec.tenant.namespace

Current Behavior

The Jobs are trying to use the service endpoint in MinIOJob namespace and failing to connect.
mc: <ERROR> Unable to make bucket myminio/dev. Put "http://minio.dev.svc.cluster.local/dev/": dial tcp: lookup minio.dev.svc.cluster.local on 10.96.0.10:53: no such host

Steps to Reproduce (for bugs)

Apply provided config to 2 namespaces.

Your Environment

  • MinIO operator: kubectl apply -k https://github.com/minio/operator?ref=v6.0.3
  • Kubernetes v1.30.3
  • Operating System and version (uname -a):
    Linux storebot 6.6.0-odroid-arm64 #1 SMP PREEMPT Wed, 08 May 2024 07:36:13 +0000 aarch64 aarch64 aarch64 GNU/Linux
@jiuker jiuker self-assigned this Aug 27, 2024
@jiuker jiuker added bug Something isn't working and removed triage labels Aug 27, 2024
@minio minio deleted a comment from chrmang Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working community
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@jiuker @chrmang and others