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

Allow for one to install jobset in a different namespace #719

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

kannon92
Copy link
Contributor

@kannon92 kannon92 commented Dec 2, 2024

What type of PR is this?

/kind bug

What this PR does / why we need it:

Allow for one to change the namespace of jobset.

Which issue(s) this PR fixes:

Fixes #713

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Allow for jobset to be installed in a different namespace from jobset-system

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 2, 2024
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Dec 2, 2024
Copy link

netlify bot commented Dec 2, 2024

Deploy Preview for kubernetes-sigs-jobset canceled.

Name Link
🔨 Latest commit 74e8cd0
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-jobset/deploys/674dfa343a151a0008cb97ac

Copy link
Contributor

@andreyvelich andreyvelich left a comment

Choose a reason for hiding this comment

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

return cert.AddRotator(mgr, &cert.CertRotator{
SecretKey: types.NamespacedName{
Namespace: secretNamespace,
Name: secretName,
Namespace: *cfg.Namespace,
Copy link
Contributor

Choose a reason for hiding this comment

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

@tenzen-y @kannon92 I am wondering is there any specific reason that we want to configure namespace in the Config rather than taking it from the Pod's /var/run/secrets/kubernetes.io/serviceaccount/namespace ?

Our internal cert manager should always create certificates for the service in the same namespace where manager is deployed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are technically doing that.

https://github.com/kubernetes-sigs/jobset/blob/main/api/config/v1alpha1/defaults.go#L58

This is setting the namespace based on the serviceAccount. And then we use that value for certRotation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, but why do we allow users to change the namespace in the Config ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah I see. yea that does seem to be concerning. The most likely reason for this is that was what we did in Kueue. The component config work was mostly a copy of Kueue and it looks like Kueue has the same config for namespace. By default, it will pick namespace based on serviceAccount.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, Kueue has similar config. I think, we should remove it, if user should not set other namespace there.
For instance, in Katib we don't allow to set that value for CertGenerator config: https://github.com/kubeflow/katib/blob/master/pkg/apis/config/v1beta1/types.go#L86-L98.
Thoughts @tenzen-y @ahg-g @danielvegamyhre ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IMO this is not really related to this issue/PR.

We have a real problem where folks can't run jobset if it is installed outside of jobset-system. I'm happy to discuss this but I think it belongs as a separate issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, sure! I am happy to discuss it as a followup.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Opened #720

@andreyvelich
Copy link
Contributor

/lgtm

@k8s-ci-robot
Copy link
Contributor

@andreyvelich: changing LGTM is restricted to collaborators

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@ahg-g
Copy link
Contributor

ahg-g commented Dec 3, 2024

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahg-g, kannon92

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 3, 2024
@ahg-g
Copy link
Contributor

ahg-g commented Dec 3, 2024

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 3, 2024
@k8s-ci-robot k8s-ci-robot merged commit 4756877 into kubernetes-sigs:main Dec 3, 2024
13 checks passed
@kannon92
Copy link
Contributor Author

/cherry-pick release-0.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Internal cert manager relies on jobset-system namespace
4 participants