File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -230,6 +230,10 @@ type StandaloneOptions struct {
230
230
// and instrumenting the webhook with metrics.
231
231
//
232
232
// Use this to attach your webhook to an arbitrary HTTP server or mux.
233
+ //
234
+ // Note that you are responsible for terminating TLS if you use StandaloneWebhook
235
+ // in your own server/mux. In order to be accessed by a kubernetes cluster,
236
+ // all webhook servers require TLS.
233
237
func StandaloneWebhook (hook * Webhook , opts StandaloneOptions ) (http.Handler , error ) {
234
238
if opts .Scheme == nil {
235
239
opts .Scheme = scheme .Scheme
Original file line number Diff line number Diff line change @@ -83,6 +83,10 @@ func Example() {
83
83
84
84
// This example creates a webhook server that can be
85
85
// ran without a controller manager.
86
+ //
87
+ // Note that this assumes and requires a valid TLS
88
+ // cert and key at the default locations
89
+ // tls.crt and tls.key
86
90
func ExampleServer_StartStandalone () {
87
91
// Create a webhook server
88
92
hookServer := & Server {
Original file line number Diff line number Diff line change @@ -41,6 +41,12 @@ var DefaultPort = 9443
41
41
42
42
// Server is an admission webhook server that can serve traffic and
43
43
// generates related k8s resources for deploying.
44
+ //
45
+ // TLS is required for a webhook to be accessed by kubernetes, so
46
+ // you must provide a CertName and KeyName or have valid cert/key
47
+ // at the default locations (tls.crt and tls.key). If you do not
48
+ // want to configure TLS (i.e for testing purposes) run an
49
+ // admission.StandaloneWebhook in your own server.
44
50
type Server struct {
45
51
// Host is the address that the server will listen on.
46
52
// Defaults to "" - all addresses.
You can’t perform that action at this time.
0 commit comments