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 with Tenant in different namespace not working #2290

Closed
chrmang opened this issue Aug 26, 2024 · 7 comments · Fixed by #2291
Closed

MinIOJob with Tenant in different namespace not working #2290

chrmang opened this issue Aug 26, 2024 · 7 comments · Fixed by #2291
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.

The configuration:

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 MinIOJob is running

Current Behavior

MinIOJob ressource got status.message: no policybinding found

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.2
  • 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
@minio minio deleted a comment Aug 26, 2024
@minio minio deleted a comment Aug 26, 2024
@ramondeklein
Copy link
Contributor

Be careful. It looks like a bot reply wants you to execute a shell script.

I have reported the replies to Github, removed the comments and redacted the quotes. Unfortunately, we can't do much about this bots...

@jiuker

This comment was marked as off-topic.

@jiuker

This comment was marked as off-topic.

@jiuker
Copy link
Contributor

jiuker commented Aug 26, 2024

Looks like you met a bug. MinioJob should have the namespace as tenant.

@jiuker
Copy link
Contributor

jiuker commented Aug 26, 2024

Will sent a pr to fix that

@jiuker jiuker self-assigned this Aug 26, 2024
@jiuker jiuker added bug Something isn't working and removed triage labels Aug 26, 2024
@chrmang
Copy link
Author

chrmang commented Aug 26, 2024

Will sent a pr to fix that

Thank you for your fast response and the fix.

@jiuker
Copy link
Contributor

jiuker commented Aug 26, 2024

Will sent a pr to fix that

Thank you for your fast response and the fix.

Now, you can set them with the same namespace. @chrmang

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.

3 participants