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

fix operator: remove unused mutating and conversion webhook configs #1705

Merged
merged 1 commit into from Dec 5, 2023

Conversation

davidxia
Copy link
Contributor

@davidxia davidxia commented Dec 2, 2023

and move validating webhook's Service to ray-system namespace instead of system.

cleanup for #1584

tested with make docker-build docker-push deploy-with-webhooks IMG=eu.gcr.io/my-project/kuberay-operator:$(git rev-parse --short=7 HEAD) and then kubectl apply -f the YAML here

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(

and move validating webhook's Service to `ray-system` namespace
instead of `system`.
Comment on lines -114 to -118
install-with-webhooks: manifests kustomize ## Install CRDs with webhooks into the K8s cluster specified in ~/.kube/config.
($(KUSTOMIZE) build --load-restrictor LoadRestrictionsNone config/crd-with-webhooks | kubectl create -f -) || ($(KUSTOMIZE) build --load-restrictor LoadRestrictionsNone config/crd-with-webhooks | kubectl replace -f -)

uninstall-with-webhooks: manifests kustomize ## Uninstall CRDs with webhooks from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build --load-restrictor LoadRestrictionsNone config/crd-with-webhooks | kubectl delete -f -
Copy link
Contributor Author

Choose a reason for hiding this comment

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

no need because CRDs don't need any changes. config/crd-with-webhooks is only needed for conversion webhooks which we don't use

Comment on lines -23 to -32
//+kubebuilder:webhook:path=/mutate-ray-io-v1-raycluster,mutating=true,failurePolicy=fail,sideEffects=None,groups=ray.io,resources=rayclusters,verbs=create;update,versions=v1,name=mraycluster.kb.io,admissionReviewVersions=v1

var _ webhook.Defaulter = &RayCluster{}

// Default implements webhook.Defaulter so a webhook will be registered for the type
func (r *RayCluster) Default() {
rayclusterlog.Info("default", "name", r.Name)

// TODO(user): fill in your defaulting logic.
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

for mutating webhook which we don't use

Comment on lines +8 to +16
patches:
- patch: |-
- op: replace
path: /webhooks/0/clientConfig/service/namespace
value: ray-system
target:
kind: ValidatingWebhookConfiguration
name: validating-webhook-configuration
version: v1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

webhook generator hardcodes the namespace of the service to system (issue). We change it to ray-system

@@ -10,7 +10,7 @@ metadata:
app.kubernetes.io/part-of: ray-operator
app.kubernetes.io/managed-by: kustomize
name: webhook-service
namespace: system
namespace: ray-system
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this matches the namespace referenced by the ValidatingWebhookConfiguration

@davidxia
Copy link
Contributor Author

davidxia commented Dec 2, 2023

cc @kevin85421

@davidxia davidxia marked this pull request as ready for review December 2, 2023 07:38
@kevin85421 kevin85421 self-requested a review December 4, 2023 18:17
@kevin85421 kevin85421 self-assigned this Dec 4, 2023
Copy link
Member

@kevin85421 kevin85421 left a comment

Choose a reason for hiding this comment

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

Thanks!

@kevin85421 kevin85421 merged commit 842dd9d into ray-project:master Dec 5, 2023
25 checks passed
@davidxia davidxia deleted the webhooks-cleanup branch December 9, 2023 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants