Skip to content

Commit 65f41ee

Browse files
authored
docs: standardise format of code blocks for consistency (#896) (#935)
Signed-off-by: jforce <[email protected]>
1 parent f80fd93 commit 65f41ee

File tree

3 files changed

+125
-108
lines changed

3 files changed

+125
-108
lines changed

docs/user_workloads/component_monitoring.md

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,36 @@ The above labels and port informations are collected by a `Service`
2121
called `kubevirt-prometheus-metrics`. Kubernetes automatically creates a
2222
corresponding `Endpoint` with an equal name:
2323

24-
$ kubectl get endpoints -n kubevirt kubevirt-prometheus-metrics -o yaml
25-
apiVersion: v1
26-
kind: Endpoints
27-
metadata:
28-
labels:
29-
kubevirt.io: ""
30-
prometheus.kubevirt.io: ""
31-
name: kubevirt-prometheus-metrics
24+
```bash
25+
kubectl get endpoints -n kubevirt kubevirt-prometheus-metrics -o yaml
26+
```
27+
28+
```yaml
29+
apiVersion: v1
30+
kind: Endpoints
31+
metadata:
32+
labels:
33+
kubevirt.io: ""
34+
prometheus.kubevirt.io: ""
35+
name: kubevirt-prometheus-metrics
36+
namespace: kubevirt
37+
subsets:
38+
- addresses:
39+
- ip: 10.244.0.5
40+
nodeName: node01
41+
targetRef:
42+
kind: Pod
43+
name: virt-handler-cjzg6
3244
namespace: kubevirt
33-
subsets:
34-
- addresses:
35-
- ip: 10.244.0.5
36-
nodeName: node01
37-
targetRef:
38-
kind: Pod
39-
name: virt-handler-cjzg6
40-
namespace: kubevirt
41-
resourceVersion: "4891"
42-
uid: c67331f9-bfcf-11e8-bc54-525500d15501
43-
- ip: 10.244.0.6
44-
[...]
45-
ports:
46-
- name: metrics
47-
port: 8443
48-
protocol: TCP
45+
resourceVersion: "4891"
46+
uid: c67331f9-bfcf-11e8-bc54-525500d15501
47+
- ip: 10.244.0.6
48+
[...]
49+
ports:
50+
- name: metrics
51+
port: 8443
52+
protocol: TCP
53+
```
4954
5055
By watching this endpoint for added and removed IPs to
5156
`subsets.addresses` and appending the `metrics` port from

docs/user_workloads/guest_agent_information.md

Lines changed: 84 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ The condition tells that the GA is connected and can be used.
1212

1313
GA condition on VirtualMachineInstance
1414

15-
status:
16-
conditions:
17-
- lastProbeTime: "2020-02-28T10:22:59Z"
18-
lastTransitionTime: null
19-
status: "True"
20-
type: AgentConnected
21-
15+
```yaml
16+
status:
17+
conditions:
18+
- lastProbeTime: "2020-02-28T10:22:59Z"
19+
lastTransitionTime: null
20+
status: "True"
21+
type: AgentConnected
22+
```
2223
2324
When the GA is connected, additional OS information is shown in the status.
2425
This information comprises:
@@ -30,24 +31,26 @@ Below is the example of the information shown in the VirtualMachineInstance stat
3031
3132
GA info with merged into status
3233
33-
status:
34-
guestOSInfo:
35-
id: fedora
36-
kernelRelease: 4.18.16-300.fc29.x86_64
37-
kernelVersion: '#1 SMP Sat Oct 20 23:24:08 UTC 2018'
38-
name: Fedora
39-
prettyName: Fedora 29 (Cloud Edition)
40-
version: "29"
41-
versionId: "29"
42-
interfaces:
43-
- infoSource: domain, guest-agent
44-
interfaceName: eth0
45-
ipAddress: 10.244.0.23/24
46-
ipAddresses:
47-
- 10.244.0.23/24
48-
- fe80::858:aff:fef4:17/64
49-
mac: 0a:58:0a:f4:00:17
50-
name: default
34+
```yaml
35+
status:
36+
guestOSInfo:
37+
id: fedora
38+
kernelRelease: 4.18.16-300.fc29.x86_64
39+
kernelVersion: '#1 SMP Sat Oct 20 23:24:08 UTC 2018'
40+
name: Fedora
41+
prettyName: Fedora 29 (Cloud Edition)
42+
version: "29"
43+
versionId: "29"
44+
interfaces:
45+
- infoSource: domain, guest-agent
46+
interfaceName: eth0
47+
ipAddress: 10.244.0.23/24
48+
ipAddresses:
49+
- 10.244.0.23/24
50+
- fe80::858:aff:fef4:17/64
51+
mac: 0a:58:0a:f4:00:17
52+
name: default
53+
```
5154
5255
When the Guest Agent is not present in the Virtual Machine, the Guest Agent information is not shown. No error is reported because the Guest Agent is an optional component.
5356
@@ -76,74 +79,77 @@ The whole GA data is returned via `guestosinfo` subresource available behind the
7679

7780
GuestOSInfo sample data:
7881

79-
{
80-
"fsInfo": {
81-
"disks": [
82-
{
83-
"diskName": "vda1",
84-
"fileSystemType": "ext4",
85-
"mountPoint": "/",
86-
"totalBytes": 0,
87-
"usedBytes": 0
88-
}
89-
]
90-
},
91-
"guestAgentVersion": "2.11.2",
92-
"hostname": "testvmi6m5krnhdlggc9mxfsrnhlxqckgv5kqrwcwpgr5mdpv76grrk",
93-
"metadata": {
94-
"creationTimestamp": null
95-
},
96-
"os": {
97-
"id": "fedora",
98-
"kernelRelease": "4.18.16-300.fc29.x86_64",
99-
"kernelVersion": "#1 SMP Sat Oct 20 23:24:08 UTC 2018",
100-
"machine": "x86_64",
101-
"name": "Fedora",
102-
"prettyName": "Fedora 29 (Cloud Edition)",
103-
"version": "29 (Cloud Edition)",
104-
"versionId": "29"
105-
},
106-
"timezone": "UTC, 0"
107-
}
82+
```json
83+
{
84+
"fsInfo": {
85+
"disks": [
86+
{
87+
"diskName": "vda1",
88+
"fileSystemType": "ext4",
89+
"mountPoint": "/",
90+
"totalBytes": 0,
91+
"usedBytes": 0
92+
}
93+
]
94+
},
95+
"guestAgentVersion": "2.11.2",
96+
"hostname": "testvmi6m5krnhdlggc9mxfsrnhlxqckgv5kqrwcwpgr5mdpv76grrk",
97+
"metadata": {
98+
"creationTimestamp": null
99+
},
100+
"os": {
101+
"id": "fedora",
102+
"kernelRelease": "4.18.16-300.fc29.x86_64",
103+
"kernelVersion": "#1 SMP Sat Oct 20 23:24:08 UTC 2018",
104+
"machine": "x86_64",
105+
"name": "Fedora",
106+
"prettyName": "Fedora 29 (Cloud Edition)",
107+
"version": "29 (Cloud Edition)",
108+
"versionId": "29"
109+
},
110+
"timezone": "UTC, 0"
111+
}
112+
```
108113

109114
Items FSInfo and UserList are capped to the max capacity of 10 items, as a precaution for VMs with thousands of users.
110115

111116
Full list of Filesystems is available through the subresource `filesystemlist` which is available as endpoint.
112117

113-
114118
/apis/subresources.kubevirt.io/v1/namespaces/{namespace}/virtualmachineinstances/{name}/filesystemlist
115119

116120
Filesystem sample data:
117121

118-
{
119-
"items": [
120-
{
121-
"diskName": "vda1",
122-
"fileSystemType": "ext4",
123-
"mountPoint": "/",
124-
"totalBytes": 3927900160,
125-
"usedBytes": 1029201920
126-
}
127-
],
128-
"metadata": {}
129-
}
122+
```json
123+
{
124+
"items": [
125+
{
126+
"diskName": "vda1",
127+
"fileSystemType": "ext4",
128+
"mountPoint": "/",
129+
"totalBytes": 3927900160,
130+
"usedBytes": 1029201920
131+
}
132+
],
133+
"metadata": {}
134+
}
135+
```
130136

131137
Full list of the Users is available through the subresource `userlist` which is available as endpoint.
132138

133139
/apis/subresources.kubevirt.io/v1/namespaces/{namespace}/virtualmachineinstances/{name}/userlist
134140

135-
136-
137141
Userlist sample data:
138142

139-
{
140-
"items": [
141-
{
142-
"loginTime": 1580467675.876078,
143-
"userName": "fedora"
144-
}
145-
],
146-
"metadata": {}
147-
}
143+
```json
144+
{
145+
"items": [
146+
{
147+
"loginTime": 1580467675.876078,
148+
"userName": "fedora"
149+
}
150+
],
151+
"metadata": {}
152+
}
153+
```
148154

149155
User LoginTime is in fractional seconds since epoch time. It is left for the consumer to convert to the desired format.

docs/user_workloads/guest_operating_system_information.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
Guest operating system identity for the VirtualMachineInstance will be
44
provided by the label `kubevirt.io/os` :
55

6-
metadata:
7-
name: myvmi
8-
labels:
9-
kubevirt.io/os: win2k12r2
6+
```yaml
7+
metadata:
8+
name: myvmi
9+
labels:
10+
kubevirt.io/os: win2k12r2
11+
```
1012
1113
The `kubevirt.io/os` label is based on the short OS identifier from
1214
[libosinfo](https://libosinfo.org/) database. The following Short IDs
@@ -105,10 +107,12 @@ spec:
105107
- name: server2012r2
106108
persistentVolumeClaim:
107109
claimName: my-windows-image
110+
```
108111

109112
Once the `VirtualMachineInstancePreset` is applied to the
110113
`VirtualMachineInstance`, the resulting resource would look like this:
111114

115+
```yaml
112116
apiVersion: kubevirt.io/v1
113117
kind: VirtualMachineInstance
114118
metadata:
@@ -193,7 +197,9 @@ spec:
193197

194198
Alternatively, users can edit an existing kubevirt CR:
195199

196-
`kubectl edit kubevirt kubevirt -n kubevirt`
200+
```bash
201+
kubectl edit kubevirt kubevirt -n kubevirt
202+
```
197203

198204
```yaml
199205
...
@@ -203,4 +209,4 @@ spec:
203209
featureGates:
204210
- "HypervStrictCheck"
205211
- "CPUManager"
206-
```
212+
```

0 commit comments

Comments
 (0)