-
Notifications
You must be signed in to change notification settings - Fork 59
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
JobSet usage in another operator #131
Comments
okay maybe(?) getting closer - I registered the scheme: package main
import (
"flag"
"os"
// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
// to ensure that exec-entrypoint and run can make use of them.
_ "k8s.io/client-go/plugin/pkg/client/auth"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/runtime/serializer"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client/apiutil"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
api "flux-framework/flux-operator/api/v1alpha1"
+ jobset "sigs.k8s.io/jobset/api/v1alpha1"
"flux-framework/flux-operator/controllers/core"
//+kubebuilder:scaffold:imports
)
var (
scheme = runtime.NewScheme()
setupLog = ctrl.Log.WithName("setup")
)
func init() {
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
utilruntime.Must(api.AddToScheme(scheme))
+ utilruntime.Must(jobset.AddToScheme(scheme))
//+kubebuilder:scaffold:scheme
} and now it's a permissions thing, but it seems to be seen!
Going to mess with rbac |
okay - added this to rbac: //+kubebuilder:rbac:groups=jobset.x-k8s.io,resources=jobset,verbs=get;list;watch;create;update;patch;delete;exec
//+kubebuilder:rbac:groups=jobset.x-k8s.io,resources=jobset/status,verbs=get;list;watch;create;update;patch;delete;exec but it can't find it still:
I think perhaps it doesn't know the namespace to look in? |
okay getting closer!
This is just a broker pod, so there is only one, but I'll try setting it to be in completion mode. It really just needs to be part of a network, and hopefully the two jobs in the JobSet can see one another ... will find out soon! |
okay this all seems to be working - and I'm at the point now of needing to understand how JobSet actually works (it's suspending my jobs and not running any pods, lol). Sorry for the noise! I'll likely engage with folks in another issue / slack tomorrow with my many dumb questions. |
This is great, thanks @vsoch! I will respond to your questions on the other issue. |
Hiya! I've started experimenting with using JobSet from another operator (the Flux Operator) and finished most of the implementation (REF, but when I got up to testing it (e.g., I need to still check how the new headless service that is created for me works to update the broker config) but I ran into some issues. What I'm doing is:
Creating creating the cluster:
Installing the JobSet, per the instructions here
VERSION=v0.1.3 kubectl apply --server-side -f https://github.com/kubernetes-sigs/jobset/releases/download/$VERSION/manifests.yaml
And trying to create a hello world example MiniCluster with the JobSet:
I get this error - the type is not registered:
And the issue (I think) is that the Jobset namespace isn't really part of the main cluster, or at least can't be seen by the flux-operator namespace, or something of that flavor? I'm thinking there likely needs to be a way to customize how it's installed so the kind "JobSet" is known. This might also be helpful to have in the install docs, for the cases when a developer wants to use it in their applications.
Thank you!
The text was updated successfully, but these errors were encountered: