Skip to content

Commit b83800c

Browse files
committed
Use $ and console to indicate multi-command blocks
The console code block type helps highlight the command and its corresponding output by coloring lines starting with $ in black and the rest (presumably command output) in blue. This is very helpful when a block contains a mix of commands and their output. When there is only a single command, and no output, by omitting the console block type, the command is displayed in black for consistency. This is optional formatting, but I've found that it helps the user experience when going through the docs.
1 parent 789c4b2 commit b83800c

File tree

1 file changed

+21
-71
lines changed

1 file changed

+21
-71
lines changed

Diff for: docs/walkthrough.md

+21-71
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ that chart in the chart's
2323

2424
Otherwise, to install with sensible defaults, run the following command:
2525

26-
```console
26+
```
2727
helm install charts/ups-broker --name ups-broker --namespace ups-broker
2828
```
2929

@@ -33,7 +33,7 @@ Because we haven't created any resources in the service-catalog API server yet,
3333
`kubectl get` will return an empty list of resources.
3434

3535
```console
36-
kubectl get clusterservicebrokers,clusterserviceclasses,serviceinstances,servicebindings
36+
$ kubectl get clusterservicebrokers,clusterserviceclasses,serviceinstances,servicebindings
3737
No resources found.
3838
```
3939

@@ -42,12 +42,7 @@ We'll register a broker server with the catalog by creating a new
4242
Do so with the following command:
4343

4444
```console
45-
kubectl create -f contrib/examples/walkthrough/ups-broker.yaml
46-
```
47-
48-
The output of that command should be the following:
49-
50-
```console
45+
$ kubectl create -f contrib/examples/walkthrough/ups-broker.yaml
5146
servicebroker "ups-broker" created
5247
```
5348

@@ -58,12 +53,7 @@ by querying the broker server to see what services it offers and creates a
5853
We can check the status of the broker using `kubectl get`:
5954

6055
```console
61-
kubectl get clusterservicebrokers ups-broker -o yaml
62-
```
63-
64-
We should see something like:
65-
66-
```yaml
56+
$ kubectl get clusterservicebrokers ups-broker -o yaml
6757
apiVersion: servicecatalog.k8s.io/v1beta1
6858
kind: ClusterServiceBroker
6959
metadata:
@@ -102,11 +92,6 @@ executing:
10292

10393
```console
10494
$ kubectl get clusterserviceclasses -o=custom-columns=NAME:.metadata.name,EXTERNAL\ NAME:.spec.externalName
105-
```
106-
107-
We should see something like:
108-
109-
```console
11095
NAME EXTERNAL NAME
11196
4f6e6cf6-ffdd-425f-a2c7-3c9258ad2468 user-provided-service
11297
```
@@ -120,12 +105,7 @@ The UPS broker provides a service with the external name
120105
offering:
121106

122107
```console
123-
kubectl get clusterserviceclasses 4f6e6cf6-ffdd-425f-a2c7-3c9258ad2468 -o yaml
124-
```
125-
126-
We should see something like:
127-
128-
```yaml
108+
$ kubectl get clusterserviceclasses 4f6e6cf6-ffdd-425f-a2c7-3c9258ad2468 -o yaml
129109
apiVersion: servicecatalog.k8s.io/v1beta1
130110
kind: ClusterServiceClass
131111
metadata:
@@ -151,11 +131,6 @@ resources available in the cluster by executing:
151131

152132
```console
153133
$ kubectl get clusterserviceplans -o=custom-columns=NAME:.metadata.name,EXTERNAL\ NAME:.spec.externalName
154-
```
155-
156-
We should see something like:
157-
158-
```console
159134
NAME EXTERNAL NAME
160135
86064792-7ea2-467b-af93-ac9694d96d52 default
161136
```
@@ -168,12 +143,7 @@ broker returns.
168143
You can view the details of this `ClusterServicePlan` with this command:
169144

170145
```console
171-
kubectl get clusterserviceplans 86064792-7ea2-467b-af93-ac9694d96d52 -o yaml
172-
```
173-
174-
We should see something like:
175-
176-
```yaml
146+
$ kubectl get clusterserviceplans 86064792-7ea2-467b-af93-ac9694d96d52 -o yaml
177147
apiVersion: servicecatalog.k8s.io/v1beta1
178148
kind: ClusterServicePlan
179149
metadata:
@@ -204,19 +174,14 @@ Unlike `ClusterServiceBroker` and `ClusterServiceClass` resources, `ServiceInsta
204174
resources must be namespaced, so we'll need to create a namespace to start.
205175
Do so with this command:
206176

207-
```console
177+
```
208178
kubectl create namespace test-ns
209179
```
210180

211181
Then, create the `ServiceInstance`:
212182

213183
```console
214-
kubectl create -f contrib/examples/walkthrough/ups-instance.yaml
215-
```
216-
217-
That operation should output:
218-
219-
```console
184+
$ kubectl create -f contrib/examples/walkthrough/ups-instance.yaml
220185
serviceinstance "ups-instance" created
221186
```
222187

@@ -225,12 +190,7 @@ communicate with the appropriate broker server to initiate provisioning.
225190
Check the status of that process with this command:
226191

227192
```console
228-
kubectl get serviceinstances -n test-ns ups-instance -o yaml
229-
```
230-
231-
We should see something like:
232-
233-
```yaml
193+
$ kubectl get serviceinstances -n test-ns ups-instance -o yaml
234194
apiVersion: servicecatalog.k8s.io/v1beta1
235195
kind: ServiceInstance
236196
metadata:
@@ -281,12 +241,7 @@ we'll create a `ServiceBinding` resource. Do so with the following
281241
command:
282242

283243
```console
284-
kubectl create -f contrib/examples/walkthrough/ups-binding.yaml
285-
```
286-
287-
That command should output:
288-
289-
```console
244+
$ kubectl create -f contrib/examples/walkthrough/ups-binding.yaml
290245
servicebinding "ups-binding" created
291246
```
292247

@@ -297,12 +252,7 @@ service catalog controller will insert into a Kubernetes `Secret`. We can check
297252
the status of this process like so:
298253

299254
```console
300-
kubectl get servicebindings -n test-ns ups-binding -o yaml
301-
```
302-
303-
We should see something like:
304-
305-
```yaml
255+
$ kubectl get servicebindings -n test-ns ups-binding -o yaml
306256
apiVersion: servicecatalog.k8s.io/v1beta1
307257
kind: ServiceBinding
308258
metadata:
@@ -337,7 +287,7 @@ ready to use! If we look at the `Secret`s in our `test-ns` namespace, we should
337287
see a new one:
338288

339289
```console
340-
kubectl get secrets -n test-ns
290+
$ kubectl get secrets -n test-ns
341291
NAME TYPE DATA AGE
342292
default-token-3k61z kubernetes.io/service-account-token 3 29m
343293
ups-binding Opaque 2 1m
@@ -350,14 +300,14 @@ Notice that a new `Secret` named `ups-binding` has been created.
350300
Now, let's unbind from the instance. To do this, we simply *delete* the
351301
`ServiceBinding` resource that we previously created:
352302

353-
```console
303+
```
354304
kubectl delete -n test-ns servicebindings ups-binding
355305
```
356306

357307
After the deletion is complete, we should see that the `Secret` is gone:
358308

359309
```console
360-
kubectl get secrets -n test-ns
310+
$ kubectl get secrets -n test-ns
361311
NAME TYPE DATA AGE
362312
default-token-3k61z kubernetes.io/service-account-token 3 30m
363313
```
@@ -367,7 +317,7 @@ default-token-3k61z kubernetes.io/service-account-token 3 30m
367317
Now, we can deprovision the instance. To do this, we simply *delete* the
368318
`ServiceInstance` resource that we previously created:
369319

370-
```console
320+
```
371321
kubectl delete -n test-ns serviceinstances ups-instance
372322
```
373323

@@ -377,15 +327,15 @@ Next, we should remove the `ClusterServiceBroker` resource. This tells the servi
377327
catalog to remove the broker's services from the catalog. Do so with this
378328
command:
379329

380-
```console
330+
```
381331
kubectl delete clusterservicebrokers ups-broker
382332
```
383333

384334
We should then see that all the `ClusterServiceClass` resources that came from that
385335
broker have also been deleted:
386336

387337
```console
388-
kubectl get clusterserviceclasses
338+
$ kubectl get clusterserviceclasses
389339
No resources found.
390340
```
391341

@@ -395,20 +345,20 @@ No resources found.
395345

396346
To clean up, delete the helm deployment:
397347

398-
```console
348+
```
399349
helm delete --purge ups-broker
400350
```
401351

402352
Then, delete all the namespaces we created:
403353

404-
```console
354+
```
405355
kubectl delete ns test-ns ups-broker
406356
```
407357
## Cleaning up the Service Catalog
408358

409359
Delete the helm deployment and the namespace:
410360

411-
```console
361+
```
412362
helm delete --purge catalog
413363
kubectl delete ns catalog
414364
```
@@ -420,6 +370,6 @@ kubectl delete ns catalog
420370
If you are using Google Cloud Platform, you may need to run the following
421371
commands to setup proper firewall rules to allow your traffic get in.
422372

423-
```console
373+
```
424374
gcloud compute firewall-rules create allow-service-catalog-secure --allow tcp:30443 --description "Allow incoming traffic on 30443 port."
425375
```

0 commit comments

Comments
 (0)