Skip to content

Commit 8cfd3d6

Browse files
committed
Merge pull request kubernetes#11551 from a-robinson/docs
Improve syntax highlighting for design and devel docs
2 parents 247e252 + 4182c3b commit 8cfd3d6

18 files changed

+116
-125
lines changed

docs/design/admission_control_limit_range.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ The server is updated to be aware of **LimitRange** objects.
128128

129129
The constraints are only enforced if the kube-apiserver is started as follows:
130130

131-
```
131+
```console
132132
$ kube-apiserver -admission_control=LimitRanger
133133
```
134134

@@ -140,7 +140,7 @@ kubectl is modified to support the **LimitRange** resource.
140140

141141
For example,
142142

143-
```shell
143+
```console
144144
$ kubectl namespace myspace
145145
$ kubectl create -f docs/user-guide/limitrange/limits.yaml
146146
$ kubectl get limits

docs/design/admission_control_resource_quota.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ The server is updated to be aware of **ResourceQuota** objects.
140140

141141
The quota is only enforced if the kube-apiserver is started as follows:
142142

143-
```
143+
```console
144144
$ kube-apiserver -admission_control=ResourceQuota
145145
```
146146

@@ -167,7 +167,7 @@ kubectl is modified to support the **ResourceQuota** resource.
167167

168168
For example,
169169

170-
```
170+
```console
171171
$ kubectl namespace myspace
172172
$ kubectl create -f docs/user-guide/resourcequota/quota.yaml
173173
$ kubectl get quota

docs/design/clustering/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This directory contains diagrams for the clustering design doc.
3434

3535
This depends on the `seqdiag` [utility](http://blockdiag.com/en/seqdiag/index.html). Assuming you have a non-borked python install, this should be installable with
3636

37-
```bash
37+
```sh
3838
pip install seqdiag
3939
```
4040

@@ -44,7 +44,7 @@ Just call `make` to regenerate the diagrams.
4444

4545
If you are on a Mac or your pip install is messed up, you can easily build with docker.
4646

47-
```
47+
```sh
4848
make docker
4949
```
5050

docs/design/event_compression.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Each binary that generates events:
9090

9191
Sample kubectl output
9292

93-
```
93+
```console
9494
FIRSTSEEN LASTSEEN COUNT NAME KIND SUBOBJECT REASON SOURCE MESSAGE
9595
Thu, 12 Feb 2015 01:13:02 +0000 Thu, 12 Feb 2015 01:13:02 +0000 1 kubernetes-minion-4.c.saad-dev-vms.internal Minion starting {kubelet kubernetes-minion-4.c.saad-dev-vms.internal} Starting kubelet.
9696
Thu, 12 Feb 2015 01:13:09 +0000 Thu, 12 Feb 2015 01:13:09 +0000 1 kubernetes-minion-1.c.saad-dev-vms.internal Minion starting {kubelet kubernetes-minion-1.c.saad-dev-vms.internal} Starting kubelet.

docs/design/namespaces.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ The Namespace provides a unique scope for:
7474

7575
A *Namespace* defines a logically named group for multiple *Kind*s of resources.
7676

77-
```
77+
```go
7878
type Namespace struct {
7979
TypeMeta `json:",inline"`
8080
ObjectMeta `json:"metadata,omitempty"`
@@ -125,7 +125,7 @@ See [Admission control: Resource Quota](admission_control_resource_quota.md)
125125

126126
Upon creation of a *Namespace*, the creator may provide a list of *Finalizer* objects.
127127

128-
```
128+
```go
129129
type FinalizerName string
130130

131131
// These are internal finalizers to Kubernetes, must be qualified name unless defined here
@@ -154,7 +154,7 @@ set by default.
154154

155155
A *Namespace* may exist in the following phases.
156156

157-
```
157+
```go
158158
type NamespacePhase string
159159
const(
160160
NamespaceActive NamespacePhase = "Active"
@@ -262,7 +262,7 @@ to take part in Namespace termination.
262262

263263
OpenShift creates a Namespace in Kubernetes
264264

265-
```
265+
```json
266266
{
267267
"apiVersion":"v1",
268268
"kind": "Namespace",
@@ -287,7 +287,7 @@ own storage associated with the "development" namespace unknown to Kubernetes.
287287

288288
User deletes the Namespace in Kubernetes, and Namespace now has following state:
289289

290-
```
290+
```json
291291
{
292292
"apiVersion":"v1",
293293
"kind": "Namespace",
@@ -312,7 +312,7 @@ and begins to terminate all of the content in the namespace that it knows about.
312312
success, it executes a *finalize* action that modifies the *Namespace* by
313313
removing *kubernetes* from the list of finalizers:
314314

315-
```
315+
```json
316316
{
317317
"apiVersion":"v1",
318318
"kind": "Namespace",
@@ -340,7 +340,7 @@ from the list of finalizers.
340340

341341
This results in the following state:
342342

343-
```
343+
```json
344344
{
345345
"apiVersion":"v1",
346346
"kind": "Namespace",

docs/design/networking.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ differentiate it from `docker0`) is set up outside of Docker proper.
131131

132132
Example of GCE's advanced routing rules:
133133

134-
```
134+
```sh
135135
gcloud compute routes add "${MINION_NAMES[$i]}" \
136136
--project "${PROJECT}" \
137137
--destination-range "${MINION_IP_RANGES[$i]}" \

docs/design/persistent-storage.md

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Events that communicate the state of a mounted volume are left to the volume plu
127127

128128
An administrator provisions storage by posting PVs to the API. Various way to automate this task can be scripted. Dynamic provisioning is a future feature that can maintain levels of PVs.
129129

130-
```
130+
```yaml
131131
POST:
132132

133133
kind: PersistentVolume
@@ -140,15 +140,13 @@ spec:
140140
persistentDisk:
141141
pdName: "abc123"
142142
fsType: "ext4"
143+
```
143144
144-
--------------------------------------------------
145-
146-
kubectl get pv
145+
```console
146+
$ kubectl get pv
147147

148148
NAME LABELS CAPACITY ACCESSMODES STATUS CLAIM REASON
149149
pv0001 map[] 10737418240 RWO Pending
150-
151-
152150
```
153151

154152
#### Users request storage
@@ -157,9 +155,9 @@ A user requests storage by posting a PVC to the API. Their request contains the
157155

158156
The user must be within a namespace to create PVCs.
159157

160-
```
161-
158+
```yaml
162159
POST:
160+
163161
kind: PersistentVolumeClaim
164162
apiVersion: v1
165163
metadata:
@@ -170,25 +168,22 @@ spec:
170168
resources:
171169
requests:
172170
storage: 3
171+
```
173172
174-
--------------------------------------------------
175-
176-
kubectl get pvc
177-
173+
```console
174+
$ kubectl get pvc
178175

179176
NAME LABELS STATUS VOLUME
180177
myclaim-1 map[] pending
181-
182178
```
183179

184180

185181
#### Matching and binding
186182

187183
The ```PersistentVolumeClaimBinder``` attempts to find an available volume that most closely matches the user's request. If one exists, they are bound by putting a reference on the PV to the PVC. Requests can go unfulfilled if a suitable match is not found.
188184

189-
```
190-
191-
kubectl get pv
185+
```console
186+
$ kubectl get pv
192187

193188
NAME LABELS CAPACITY ACCESSMODES STATUS CLAIM REASON
194189
pv0001 map[] 10737418240 RWO Bound myclaim-1 / f4b3d283-c0ef-11e4-8be4-80e6500a981e
@@ -198,8 +193,6 @@ kubectl get pvc
198193

199194
NAME LABELS STATUS VOLUME
200195
myclaim-1 map[] Bound b16e91d6-c0ef-11e4-8be4-80e6500a981e
201-
202-
203196
```
204197

205198
#### Claim usage
@@ -208,7 +201,7 @@ The claim holder can use their claim as a volume. The ```PersistentVolumeClaimV
208201

209202
The claim holder owns the claim and its data for as long as the claim exists. The pod using the claim can be deleted, but the claim remains in the user's namespace. It can be used again and again by many pods.
210203

211-
```
204+
```yaml
212205
POST:
213206

214207
kind: Pod
@@ -229,17 +222,14 @@ spec:
229222
accessMode: ReadWriteOnce
230223
claimRef:
231224
name: myclaim-1
232-
233225
```
234226
235227
#### Releasing a claim and Recycling a volume
236228
237229
When a claim holder is finished with their data, they can delete their claim.
238230
239-
```
240-
241-
kubectl delete pvc myclaim-1
242-
231+
```console
232+
$ kubectl delete pvc myclaim-1
243233
```
244234

245235
The ```PersistentVolumeClaimBinder``` will reconcile this by removing the claim reference from the PV and change the PVs status to 'Released'.

docs/design/resources.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Both users and a number of system components, such as schedulers, (horizontal) a
8989

9090
Resource requirements for a container or pod should have the following form:
9191

92-
```
92+
```yaml
9393
resourceRequirementSpec: [
9494
request: [ cpu: 2.5, memory: "40Mi" ],
9595
limit: [ cpu: 4.0, memory: "99Mi" ],
@@ -103,7 +103,7 @@ Where:
103103

104104
Total capacity for a node should have a similar structure:
105105

106-
```
106+
```yaml
107107
resourceCapacitySpec: [
108108
total: [ cpu: 12, memory: "128Gi" ]
109109
]
@@ -159,15 +159,16 @@ rather than decimal ones: "64MiB" rather than "64MB".
159159

160160
A resource type may have an associated read-only ResourceType structure, that contains metadata about the type. For example:
161161

162-
```
162+
```yaml
163163
resourceTypes: [
164164
"kubernetes.io/memory": [
165165
isCompressible: false, ...
166166
]
167167
"kubernetes.io/cpu": [
168-
isCompressible: true, internalScaleExponent: 3, ...
168+
isCompressible: true,
169+
internalScaleExponent: 3, ...
169170
]
170-
"kubernetes.io/disk-space": [ ... }
171+
"kubernetes.io/disk-space": [ ... ]
171172
]
172173
```
173174

@@ -195,7 +196,7 @@ Because resource usage and related metrics change continuously, need to be track
195196

196197
Singleton values for observed and predicted future usage will rapidly prove inadequate, so we will support the following structure for extended usage information:
197198

198-
```
199+
```yaml
199200
resourceStatus: [
200201
usage: [ cpu: <CPU-info>, memory: <memory-info> ],
201202
maxusage: [ cpu: <CPU-info>, memory: <memory-info> ],
@@ -205,7 +206,7 @@ resourceStatus: [
205206

206207
where a `<CPU-info>` or `<memory-info>` structure looks like this:
207208

208-
```
209+
```yaml
209210
{
210211
mean: <value> # arithmetic mean
211212
max: <value> # minimum value
@@ -218,7 +219,7 @@ where a `<CPU-info>` or `<memory-info>` structure looks like this:
218219
"99.9": <99.9th-percentile-value>,
219220
...
220221
]
221-
}
222+
}
222223
```
223224

224225
All parts of this structure are optional, although we strongly encourage including quantities for 50, 90, 95, 99, 99.5, and 99.9 percentiles. _[In practice, it will be important to include additional info such as the length of the time window over which the averages are calculated, the confidence level, and information-quality metrics such as the number of dropped or discarded data points.]_

docs/design/simple-rolling-update.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ To facilitate recovery in the case of a crash of the updating process itself, we
6262

6363
Recovery is achieved by issuing the same command again:
6464

65-
```
65+
```sh
6666
kubectl rolling-update foo [foo-v2] --image=myimage:v2
6767
```
6868

docs/devel/api-conventions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ The status object is encoded as JSON and provided as the body of the response.
525525

526526
**Example:**
527527

528-
```
528+
```console
529529
$ curl -v -k -H "Authorization: Bearer WhCDvq4VPpYhrcfmF6ei7V9qlbqTubUc" https://10.240.122.184:443/api/v1/namespaces/default/pods/grafana
530530
531531
> GET /api/v1/namespaces/default/pods/grafana HTTP/1.1

docs/devel/api_changes.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ Once all the necessary manually written conversions are added, you need to
284284
regenerate auto-generated ones. To regenerate them:
285285
- run
286286

287-
```
288-
$ hack/update-generated-conversions.sh
287+
```sh
288+
hack/update-generated-conversions.sh
289289
```
290290

291291
If running the above script is impossible due to compile errors, the easiest
@@ -359,8 +359,8 @@ an example to illustrate your change.
359359

360360
Make sure you update the swagger API spec by running:
361361

362-
```shell
363-
$ hack/update-swagger-spec.sh
362+
```sh
363+
hack/update-swagger-spec.sh
364364
```
365365

366366
The API spec changes should be in a commit separate from your other changes.

docs/devel/cherry-picks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Kubernetes projects.
4040

4141
Any contributor can propose a cherry pick of any pull request, like so:
4242

43-
```
43+
```sh
4444
hack/cherry_pick_pull.sh upstream/release-3.14 98765
4545
```
4646

0 commit comments

Comments
 (0)