Skip to content

Commit

Permalink
Style warning note in book
Browse files Browse the repository at this point in the history
This adds some style to the warning note in the book.  It looks similar
to the v1 book style, but with a more semantic structure.
  • Loading branch information
DirectXMan12 committed Aug 6, 2019
1 parent 8b95d51 commit b56318b
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/book/src/cronjob-tutorial/running-webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,18 @@ kubectl create -f config/samples/batch_v1_cronjob.yaml
You can also try to create an invalid CronJob (e.g. use an ill-formatted
schedule field). You should see a creation failure with a validation error.

<aside>
Note: If you are deploying a webhook for pods in the same cluster, be
<aside class="note warning">

<h1>The Bootstrapping Problem</h1>

If you are deploying a webhook for pods in the same cluster, be
careful about the bootstrapping problem, since the creation request of the
webhook pod would be sent to the webhook pod itself, which hasn't come up yet.

To make it work, you can either use [namespaceSelector] if your kubernetes
version is 1.9+ or use [objectSelector] if your kubernetes version is 1.15+ to
skip itself.

</aside>

[namespaceSelector]: https://github.com/kubernetes/api/blob/kubernetes-1.14.5/admissionregistration/v1beta1/types.go#L189-L233
Expand Down
40 changes: 40 additions & 0 deletions docs/book/theme/css/general.css
Original file line number Diff line number Diff line change
Expand Up @@ -397,3 +397,43 @@ main > details.collapse-code > summary::after {
fill: black;
stroke: none;
}

/* notes */
aside.note {
border: 1px solid var(--searchbar-border-color);
border-radius: 3px;
}

aside.note > * {
margin-left: 1em;
margin-right: 1em;
}

/* note title */
aside.note > h1 {
border-bottom: 1px solid var(--searchbar-border-color);
margin: 0;
padding: 0.5em 1em;
font-size: 100%;
font-weight: normal;
}

/* warning notes */
aside.note.warning > h1 {
background: var(--warning-note-background-color, #fcf8f2);
}
aside.note.warning > h1::before {
/* TODO(directxman12): fill in these colors in theme.
* If you're good with colors, feel free to play around with this
* in dark mode. */
content: "!";
color: var(--warning-note-color, #f0ad4e);
margin-right: 1em;
font-size: 100%;
vertical-align: middle;
font-weight: bold;
padding-left: 0.6em;
padding-right: 0.6em;
border-radius: 50%;
border: 2px solid var(--warning-note-color, #f0ad4e);
}

0 comments on commit b56318b

Please sign in to comment.