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

feat: support command for minioJob #2151

Merged
merged 3 commits into from
Jun 11, 2024

Conversation

jiuker
Copy link
Contributor

@jiuker jiuker commented Jun 7, 2024

feat: support command for minioJob
how to test:

apiVersion: v1
kind: ServiceAccount
metadata:
  name: mc-job-sa
  namespace: minio-operator
---
apiVersion: sts.min.io/v1alpha1
kind: PolicyBinding
metadata:
  name: mc-job-bingding
  namespace: minio-operator
spec:
  application:
    serviceaccount: mc-job-sa
    namespace: minio-operator
  policies:
    - consoleAdmin
---
apiVersion: job.min.io/v1alpha1
kind: MinIOJob
metadata:
  name: minio-test-job
  namespace: minio-operator
spec:
  serviceAccountName: mc-job-sa
  tenant:
    name: myminio
    namespace: minio-operator
  commands:
    - op: make-bucket
      args:
        name: memes
    - op: stat
      command:
        - "mc"
        - "stat"
        - "myminio/memes"
        - "--insecure"

support commands for minioJob
doc
@jiuker jiuker requested a review from harshavardhana June 7, 2024 06:35
cniackz
cniackz previously approved these changes Jun 7, 2024
Copy link
Contributor

@cniackz cniackz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this feature

shtripat
shtripat previously approved these changes Jun 10, 2024
Copy link
Contributor

@shtripat shtripat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Verified.
One suggestion.

pkg/utils/miniojob/types.go Outdated Show resolved Hide resolved
suggestion
@jiuker jiuker dismissed stale reviews from shtripat and cniackz via 594b3b0 June 10, 2024 14:33
@jiuker jiuker requested review from cniackz and shtripat June 10, 2024 15:06
@ramondeklein
Copy link
Contributor

ramondeklein commented Jun 10, 2024

I'm fine with the code, but isn't it a security risk to allow running commands as any service account? If you know the name of a privileged service account, then you can run any command using that account (if you're entitled to submit Minio jobs).

@pjuarezd pjuarezd merged commit da2cd6d into minio:master Jun 11, 2024
30 checks passed
@ramondeklein
Copy link
Contributor

I'm fine with the code, but isn't it a security risk to allow running commands as any service account? If you know the name of a privileged service account, then you can run any command using that account (if you're entitled to submit Minio jobs).

@dvaldivia @harshavardhana What's your opinion? You can also submit jobs that issue wget or curl commands this way. Not sure if we would want that? I know our Docker images have only a few tools installed, but running any tool under someone else's credentials feels too tricky to me...

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

Successfully merging this pull request may close these issues.

5 participants