Skip to content

Commit 622a5ef

Browse files
authored
Merge pull request #6109 from RainbowMango/pr_explain_interpreter_webhook
Explain the interpreter webhook comunication channel
2 parents 3d25407 + 696daab commit 622a5ef

File tree

4 files changed

+40
-3
lines changed

4 files changed

+40
-3
lines changed

api/openapi-spec/swagger.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17791,7 +17791,7 @@
1779117791
],
1779217792
"properties": {
1779317793
"clientConfig": {
17794-
"description": "ClientConfig defines how to communicate with the hook.",
17794+
"description": "ClientConfig defines how to communicate with the hook. It supports two mutually exclusive configuration modes:\n\n1. URL - Directly specify the webhook URL with format `scheme://host:port/path`.\n Example: https://webhook.example.com:8443/my-interpreter\n\n2. Service - Reference a Kubernetes Service that exposes the webhook.\n When using Service reference, Karmada resolves the endpoint through following steps:\n a) First attempts to locate the Service in karmada-apiserver\n b) If found, constructs URL based on Service type:\n - ClusterIP/LoadBalancer/NodePort: Uses ClusterIP with port from Service spec\n (Note: Services with ClusterIP \"None\" are rejected), Example:\n `https://\u003ccluster ip\u003e:\u003cport\u003e`\n - ExternalName: Uses external DNS name format: `https://\u003cexternal name\u003e:\u003cport\u003e`\n c) If NOT found in karmada-apiserver, falls back to standard Kubernetes\n service DNS name format: `https://\u003cservice\u003e.\u003cnamespace\u003e.svc:\u003cport\u003e`\n\nNote: When both URL and Service are specified, the Service reference takes precedence\n and the URL configuration will be ignored.",
1779517795
"default": {},
1779617796
"$ref": "#/definitions/io.k8s.api.admissionregistration.v1.WebhookClientConfig"
1779717797
},

charts/karmada/_crds/bases/config/config.karmada.io_resourceinterpreterwebhookconfigurations.yaml

+20-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,26 @@ spec:
4848
as the resources and operations it applies to.
4949
properties:
5050
clientConfig:
51-
description: ClientConfig defines how to communicate with the hook.
51+
description: |-
52+
ClientConfig defines how to communicate with the hook.
53+
It supports two mutually exclusive configuration modes:
54+
55+
1. URL - Directly specify the webhook URL with format `scheme://host:port/path`.
56+
Example: https://webhook.example.com:8443/my-interpreter
57+
58+
2. Service - Reference a Kubernetes Service that exposes the webhook.
59+
When using Service reference, Karmada resolves the endpoint through following steps:
60+
a) First attempts to locate the Service in karmada-apiserver
61+
b) If found, constructs URL based on Service type:
62+
- ClusterIP/LoadBalancer/NodePort: Uses ClusterIP with port from Service spec
63+
(Note: Services with ClusterIP "None" are rejected), Example:
64+
`https://<cluster ip>:<port>`
65+
- ExternalName: Uses external DNS name format: `https://<external name>:<port>`
66+
c) If NOT found in karmada-apiserver, falls back to standard Kubernetes
67+
service DNS name format: `https://<service>.<namespace>.svc:<port>`
68+
69+
Note: When both URL and Service are specified, the Service reference takes precedence
70+
and the URL configuration will be ignored.
5271
properties:
5372
caBundle:
5473
description: |-

pkg/apis/config/v1alpha1/resourceinterpreterwebhook_types.go

+18
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,24 @@ type ResourceInterpreterWebhook struct {
5656
Name string `json:"name"`
5757

5858
// ClientConfig defines how to communicate with the hook.
59+
// It supports two mutually exclusive configuration modes:
60+
//
61+
// 1. URL - Directly specify the webhook URL with format `scheme://host:port/path`.
62+
// Example: https://webhook.example.com:8443/my-interpreter
63+
//
64+
// 2. Service - Reference a Kubernetes Service that exposes the webhook.
65+
// When using Service reference, Karmada resolves the endpoint through following steps:
66+
// a) First attempts to locate the Service in karmada-apiserver
67+
// b) If found, constructs URL based on Service type:
68+
// - ClusterIP/LoadBalancer/NodePort: Uses ClusterIP with port from Service spec
69+
// (Note: Services with ClusterIP "None" are rejected), Example:
70+
// `https://<cluster ip>:<port>`
71+
// - ExternalName: Uses external DNS name format: `https://<external name>:<port>`
72+
// c) If NOT found in karmada-apiserver, falls back to standard Kubernetes
73+
// service DNS name format: `https://<service>.<namespace>.svc:<port>`
74+
//
75+
// Note: When both URL and Service are specified, the Service reference takes precedence
76+
// and the URL configuration will be ignored.
5977
// +required
6078
ClientConfig admissionregistrationv1.WebhookClientConfig `json:"clientConfig"`
6179

pkg/generated/openapi/zz_generated.openapi.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)