Skip to content

Commit 863e785

Browse files
authored
Merge pull request #915 from mengqiy/addmissingnote
📖 add a note for bootstrapping webhooks for pods
2 parents 62a68bd + b56318b commit 863e785

File tree

3 files changed

+56
-2
lines changed

3 files changed

+56
-2
lines changed

docs/book/install-and-build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ chmod +x /tmp/mdbook
4444
echo "grabbing the latest released controller-gen"
4545
# TODO(directxman12): remove the @v0.2.0-beta.4 once get v0.2.0 released,
4646
# so that we actually get the latest version
47-
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.2.0-beta.4
47+
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.2.0-beta.5
4848

4949
# make sure we add the go bin directory to our path
5050
gobin=$(go env GOBIN)

docs/book/src/cronjob-tutorial/running-webhook.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,19 @@ kubectl create -f config/samples/batch_v1_cronjob.yaml
5757
You can also try to create an invalid CronJob (e.g. use an ill-formatted
5858
schedule field). You should see a creation failure with a validation error.
5959

60-
**Note**: If you are
60+
<aside class="note warning">
6161

62+
<h1>The Bootstrapping Problem</h1>
63+
64+
If you are deploying a webhook for pods in the same cluster, be
65+
careful about the bootstrapping problem, since the creation request of the
66+
webhook pod would be sent to the webhook pod itself, which hasn't come up yet.
67+
68+
To make it work, you can either use [namespaceSelector] if your kubernetes
69+
version is 1.9+ or use [objectSelector] if your kubernetes version is 1.15+ to
70+
skip itself.
71+
72+
</aside>
73+
74+
[namespaceSelector]: https://github.com/kubernetes/api/blob/kubernetes-1.14.5/admissionregistration/v1beta1/types.go#L189-L233
75+
[objectSelector]: https://github.com/kubernetes/api/blob/kubernetes-1.15.2/admissionregistration/v1beta1/types.go#L262-L274

docs/book/theme/css/general.css

+40
Original file line numberDiff line numberDiff line change
@@ -397,3 +397,43 @@ main > details.collapse-code > summary::after {
397397
fill: black;
398398
stroke: none;
399399
}
400+
401+
/* notes */
402+
aside.note {
403+
border: 1px solid var(--searchbar-border-color);
404+
border-radius: 3px;
405+
}
406+
407+
aside.note > * {
408+
margin-left: 1em;
409+
margin-right: 1em;
410+
}
411+
412+
/* note title */
413+
aside.note > h1 {
414+
border-bottom: 1px solid var(--searchbar-border-color);
415+
margin: 0;
416+
padding: 0.5em 1em;
417+
font-size: 100%;
418+
font-weight: normal;
419+
}
420+
421+
/* warning notes */
422+
aside.note.warning > h1 {
423+
background: var(--warning-note-background-color, #fcf8f2);
424+
}
425+
aside.note.warning > h1::before {
426+
/* TODO(directxman12): fill in these colors in theme.
427+
* If you're good with colors, feel free to play around with this
428+
* in dark mode. */
429+
content: "!";
430+
color: var(--warning-note-color, #f0ad4e);
431+
margin-right: 1em;
432+
font-size: 100%;
433+
vertical-align: middle;
434+
font-weight: bold;
435+
padding-left: 0.6em;
436+
padding-right: 0.6em;
437+
border-radius: 50%;
438+
border: 2px solid var(--warning-note-color, #f0ad4e);
439+
}

0 commit comments

Comments
 (0)