-
Notifications
You must be signed in to change notification settings - Fork 430
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
Conversation
and move validating webhook's Service to `ray-system` namespace instead of `system`.
388d988
to
2c1960f
Compare
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 - |
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.
no need because CRDs don't need any changes. config/crd-with-webhooks
is only needed for conversion webhooks which we don't use
//+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. | ||
} |
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.
for mutating webhook which we don't use
patches: | ||
- patch: |- | ||
- op: replace | ||
path: /webhooks/0/clientConfig/service/namespace | ||
value: ray-system | ||
target: | ||
kind: ValidatingWebhookConfiguration | ||
name: validating-webhook-configuration | ||
version: v1 |
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.
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 |
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.
this matches the namespace referenced by the ValidatingWebhookConfiguration
cc @kevin85421 |
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.
Thanks!
and move validating webhook's Service to
ray-system
namespace instead ofsystem
.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 thenkubectl apply -f
the YAML hereChecks