-
Couldn't load subscription status.
- Fork 835
KEP-2170: Add manifests for Kubeflow Training V2 #2289
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
Merged
google-oss-prow
merged 5 commits into
kubeflow:master
from
andreyvelich:issue-2208-v2-manifests
Oct 21, 2024
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
647abba
KEP-2170: Add manifests for Kubeflow Training V2
andreyvelich 6a58c51
Fix invalid name for webhook config in cert
andreyvelich 4bab32a
Fix integration tests
andreyvelich cc72871
Move kubebuilder markers to runtime framework
andreyvelich 1e24175
Use Kubernetes recommended labels
andreyvelich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,6 +44,10 @@ import ( | |
| webhookv2 "github.com/kubeflow/training-operator/pkg/webhook.v2" | ||
| ) | ||
|
|
||
| const ( | ||
| webhookConfigurationName = "validator.training-operator-v2.kubeflow.org" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| ) | ||
|
|
||
| var ( | ||
| scheme = apiruntime.NewScheme() | ||
| setupLog = ctrl.Log.WithName("setup") | ||
|
|
@@ -124,8 +128,9 @@ func main() { | |
|
|
||
| certsReady := make(chan struct{}) | ||
| if err = cert.ManageCerts(mgr, cert.Config{ | ||
| WebhookSecretName: webhookSecretName, | ||
| WebhookServiceName: webhookServiceName, | ||
| WebhookSecretName: webhookSecretName, | ||
| WebhookServiceName: webhookServiceName, | ||
| WebhookConfigurationName: webhookConfigurationName, | ||
| }, certsReady); err != nil { | ||
| setupLog.Error(err, "unable to set up cert rotation") | ||
| os.Exit(1) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| apiVersion: kustomize.config.k8s.io/v1beta1 | ||
| kind: Kustomization | ||
| # We can't set namespace in the overlays since we use remote JobSet manifests in the resources. | ||
| namespace: kubeflow-system | ||
| resources: | ||
| - ./crds | ||
| - ./rbac | ||
| - ./webhook | ||
| - ./manager |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| resources: | ||
| - manager.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| --- | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: training-operator-v2 | ||
| labels: | ||
| app.kubernetes.io/name: training | ||
| app.kubernetes.io/component: manager | ||
| app.kubernetes.io/part-of: kubeflow | ||
| spec: | ||
| selector: | ||
| matchLabels: | ||
| app.kubernetes.io/name: training | ||
| app.kubernetes.io/component: manager | ||
| app.kubernetes.io/part-of: kubeflow | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app.kubernetes.io/name: training | ||
| app.kubernetes.io/component: manager | ||
| app.kubernetes.io/part-of: kubeflow | ||
| spec: | ||
| containers: | ||
| - name: manager | ||
| image: kubeflow/training-operator-v2 | ||
| env: | ||
| - name: MY_POD_NAMESPACE | ||
| valueFrom: | ||
| fieldRef: | ||
| fieldPath: metadata.namespace | ||
| volumeMounts: | ||
| - mountPath: /tmp/k8s-webhook-server/serving-certs | ||
| name: cert | ||
| readOnly: true | ||
| livenessProbe: | ||
| httpGet: | ||
| path: /healthz | ||
| port: 8081 | ||
| initialDelaySeconds: 15 | ||
| periodSeconds: 20 | ||
| timeoutSeconds: 3 | ||
| readinessProbe: | ||
| httpGet: | ||
| path: /readyz | ||
| port: 8081 | ||
| initialDelaySeconds: 10 | ||
| periodSeconds: 15 | ||
| timeoutSeconds: 3 | ||
| serviceAccountName: training-operator-v2 | ||
| volumes: | ||
| - name: cert | ||
| secret: | ||
| defaultMode: 420 | ||
| secretName: training-operator-v2-webhook-cert | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: training-operator-v2 | ||
| spec: | ||
| ports: | ||
| - name: monitoring-port | ||
| port: 8080 | ||
| targetPort: 8080 | ||
| - name: webhook-server | ||
| port: 443 | ||
| protocol: TCP | ||
| targetPort: 9443 | ||
| selector: | ||
| app.kubernetes.io/component: manager |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| resources: | ||
| - role.yaml | ||
| - role_binding.yaml | ||
| - service_account.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| name: training-operator-v2 | ||
| rules: | ||
| - apiGroups: | ||
| - "" | ||
| resources: | ||
| - secrets | ||
| verbs: | ||
| - get | ||
| - list | ||
| - update | ||
| - watch | ||
| - apiGroups: | ||
| - admissionregistration.k8s.io | ||
| resources: | ||
| - validatingwebhookconfigurations | ||
| verbs: | ||
| - get | ||
| - list | ||
| - update | ||
| - watch | ||
| - apiGroups: | ||
| - jobset.x-k8s.io | ||
| resources: | ||
| - jobsets | ||
| verbs: | ||
| - create | ||
| - get | ||
| - list | ||
| - watch | ||
| - apiGroups: | ||
| - kubeflow.org | ||
| resources: | ||
| - clustertrainingruntimes | ||
| verbs: | ||
| - get | ||
| - list | ||
| - watch | ||
| - apiGroups: | ||
| - kubeflow.org | ||
| resources: | ||
| - trainingruntimes | ||
| verbs: | ||
| - get | ||
| - list | ||
| - watch | ||
| - apiGroups: | ||
| - kubeflow.org | ||
| resources: | ||
| - trainjobs | ||
| verbs: | ||
| - create | ||
| - delete | ||
| - get | ||
| - list | ||
| - patch | ||
| - update | ||
| - watch | ||
| - apiGroups: | ||
| - kubeflow.org | ||
| resources: | ||
| - trainjobs/status | ||
| verbs: | ||
| - get | ||
| - patch | ||
| - update | ||
| - apiGroups: | ||
| - scheduling.x-k8s.io | ||
| resources: | ||
| - podgroups | ||
| verbs: | ||
| - create | ||
| - get | ||
| - list | ||
| - watch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRoleBinding | ||
| metadata: | ||
| name: training-operator-v2 | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: ClusterRole | ||
| name: training-operator-v2 | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: training-operator-v2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| apiVersion: v1 | ||
| kind: ServiceAccount | ||
| metadata: | ||
| name: training-operator-v2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,12 @@ | ||
| apiVersion: kustomize.config.k8s.io/v1beta1 | ||
| kind: Kustomization | ||
| resources: | ||
| - manifests.yaml | ||
| patches: | ||
| - path: patch.yaml | ||
| target: | ||
| group: admissionregistration.k8s.io | ||
| version: v1 | ||
| kind: ValidatingWebhookConfiguration | ||
| configurations: | ||
| - kustomizeconfig.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # the following config is for teaching kustomize where to look at when substituting vars. | ||
| # It requires kustomize v2.1.0 or newer to work properly. | ||
| namespace: | ||
| - kind: ValidatingWebhookConfiguration | ||
| group: admissionregistration.k8s.io | ||
| path: webhooks/clientConfig/service/namespace | ||
| create: true | ||
|
|
||
| varReference: | ||
| - path: metadata/annotations |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| - op: replace | ||
| path: /webhooks/0/clientConfig/service/name | ||
| value: training-operator-v2 | ||
| - op: replace | ||
| path: /webhooks/1/clientConfig/service/name | ||
| value: training-operator-v2 | ||
| - op: replace | ||
| path: /webhooks/2/clientConfig/service/name | ||
| value: training-operator-v2 | ||
| - op: replace | ||
| path: /metadata/name | ||
| value: validator.training-operator-v2.kubeflow.org |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| apiVersion: kustomize.config.k8s.io/v1beta1 | ||
| kind: Kustomization | ||
| resources: | ||
| - namespace.yaml | ||
| - ../../base | ||
| # TODO (andreyvelich): JobSet should support kubeflow-system namespace. | ||
| - https://github.com/kubernetes-sigs/jobset/releases/download/v0.6.0/manifests.yaml | ||
| images: | ||
| - name: kubeflow/training-operator-v2 | ||
| newTag: latest | ||
| secretGenerator: | ||
| - name: training-operator-v2-webhook-cert | ||
| namespace: kubeflow-system | ||
| options: | ||
| disableNameSuffixHash: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| apiVersion: v1 | ||
| kind: Namespace | ||
| metadata: | ||
| name: kubeflow-system |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC, we need to refine the webhook controller-gen marker as well: https://github.com/kubeflow/training-operator/blob/6965c1a92462d46981071748936eb135a4584f3d/pkg/webhooks/pytorch/pytorchjob_webhook.go#L51
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should change it, since those parameters defines the particular webhook configuration, not the name of validation webhook configuration object. For example:
https://github.com/kubeflow/training-operator/blob/4bab32ab8898f33fbae45c694165afce69257c32/manifests/v2/base/webhook/manifests.yaml#L35
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, you're right.
This will be used in