Skip to content

Commit 03b0d7f

Browse files
Merge branch 'kubernetes:main' into patch-1
2 parents 7134d1a + 3a3ada0 commit 03b0d7f

File tree

55 files changed

+1258
-640
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1258
-640
lines changed

content/en/blog/_posts/2021-12-07-kubernetes-release-1.23.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Kubernetes releases now generate provenance attestation files describing the sta
3232

3333
### HorizontalPodAutoscaler v2 graduates to GA
3434

35-
The HorizontalPodAutscaler `autoscaling/v2` stable API moved to GA in 1.23. The HorizontalPodAutoscaler `autoscaling/v2beta2` API has been deprecated.
35+
The HorizontalPodAutoscaler `autoscaling/v2` stable API moved to GA in 1.23. The HorizontalPodAutoscaler `autoscaling/v2beta2` API has been deprecated.
3636

3737
### Generic Ephemeral Volume feature graduates to GA
3838

content/en/docs/concepts/cluster-administration/system-logs.md

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ weight: 80
1111

1212
System component logs record events happening in cluster, which can be very useful for debugging.
1313
You can configure log verbosity to see more or less detail.
14-
Logs can be as coarse-grained as showing errors within a component, or as fine-grained as showing step-by-step traces of events (like HTTP access logs, pod state changes, controller actions, or scheduler decisions).
14+
Logs can be as coarse-grained as showing errors within a component, or as fine-grained as showing
15+
step-by-step traces of events (like HTTP access logs, pod state changes, controller actions, or
16+
scheduler decisions).
1517

1618
<!-- body -->
1719

@@ -22,9 +24,9 @@ generates log messages for the Kubernetes system components.
2224

2325
For more information about klog configuration, see the [Command line tool reference](/docs/reference/command-line-tools-reference/).
2426

25-
Kubernetes is in the process of simplifying logging in its components. The
26-
following klog command line flags [are
27-
deprecated](https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
27+
Kubernetes is in the process of simplifying logging in its components.
28+
The following klog command line flags
29+
[are deprecated](https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
2830
starting with Kubernetes 1.23 and will be removed in a future release:
2931

3032
- `--add-dir-header`
@@ -39,13 +41,12 @@ starting with Kubernetes 1.23 and will be removed in a future release:
3941
- `--skip-log-headers`
4042
- `--stderrthreshold`
4143

42-
Output will always be written to stderr, regardless of the output
43-
format. Output redirection is expected to be handled by the component which
44-
invokes a Kubernetes component. This can be a POSIX shell or a tool like
45-
systemd.
44+
Output will always be written to stderr, regardless of the output format. Output redirection is
45+
expected to be handled by the component which invokes a Kubernetes component. This can be a POSIX
46+
shell or a tool like systemd.
4647

47-
In some cases, for example a distroless container or a Windows system service,
48-
those options are not available. Then the
48+
In some cases, for example a distroless container or a Windows system service, those options are
49+
not available. Then the
4950
[`kube-log-runner`](https://github.com/kubernetes/kubernetes/blob/d2a8a81639fcff8d1221b900f66d28361a170654/staging/src/k8s.io/component-base/logs/kube-log-runner/README.md)
5051
binary can be used as wrapper around a Kubernetes component to redirect
5152
output. A prebuilt binary is included in several Kubernetes base images under
@@ -64,33 +65,36 @@ This table shows how `kube-log-runner` invocations correspond to shell redirecti
6465
### Klog output
6566

6667
An example of the traditional klog native format:
68+
6769
```
6870
I1025 00:15:15.525108 1 httplog.go:79] GET /api/v1/namespaces/kube-system/pods/metrics-server-v0.3.1-57c75779f-9p8wg: (1.512ms) 200 [pod_nanny/v0.0.0 (linux/amd64) kubernetes/$Format 10.56.1.19:51756]
6971
```
7072

7173
The message string may contain line breaks:
74+
7275
```
7376
I1025 00:15:15.525108 1 example.go:79] This is a message
7477
which has a line break.
7578
```
7679

77-
7880
### Structured Logging
7981

8082
{{< feature-state for_k8s_version="v1.23" state="beta" >}}
8183

8284
{{< warning >}}
83-
Migration to structured log messages is an ongoing process. Not all log messages are structured in this version. When parsing log files, you must also handle unstructured log messages.
85+
Migration to structured log messages is an ongoing process. Not all log messages are structured in
86+
this version. When parsing log files, you must also handle unstructured log messages.
8487

8588
Log formatting and value serialization are subject to change.
8689
{{< /warning>}}
8790

88-
Structured logging introduces a uniform structure in log messages allowing for programmatic extraction of information. You can store and process structured logs with less effort and cost.
89-
The code which generates a log message determines whether it uses the traditional unstructured klog output
90-
or structured logging.
91+
Structured logging introduces a uniform structure in log messages allowing for programmatic
92+
extraction of information. You can store and process structured logs with less effort and cost.
93+
The code which generates a log message determines whether it uses the traditional unstructured
94+
klog output or structured logging.
9195

92-
The default formatting of structured log messages is as text, with a format that
93-
is backward compatible with traditional klog:
96+
The default formatting of structured log messages is as text, with a format that is backward
97+
compatible with traditional klog:
9498

9599
```ini
96100
<klog header> "<message>" <key1>="<value1>" <key2>="<value2>" ...
@@ -105,6 +109,7 @@ I1025 00:15:15.525108 1 controller_utils.go:116] "Pod status updated" pod=
105109
Strings are quoted. Other values are formatted with
106110
[`%+v`](https://pkg.go.dev/fmt#hdr-Printing), which may cause log messages to
107111
continue on the next line [depending on the data](https://github.com/kubernetes/kubernetes/issues/106428).
112+
108113
```
109114
I1025 00:15:15.525108 1 example.go:116] "Example" data="This is text with a line break\nand \"quotation marks\"." someInt=1 someFloat=0.1 someStruct={StringField: First line,
110115
second line.}
@@ -164,15 +169,18 @@ I0404 18:03:31.171962 452150 logger.go:95] "another runtime" duration="1m0s"
164169
{{< feature-state for_k8s_version="v1.19" state="alpha" >}}
165170

166171
{{<warning >}}
167-
JSON output does not support many standard klog flags. For list of unsupported klog flags, see the [Command line tool reference](/docs/reference/command-line-tools-reference/).
172+
JSON output does not support many standard klog flags. For list of unsupported klog flags, see the
173+
[Command line tool reference](/docs/reference/command-line-tools-reference/).
168174

169-
Not all logs are guaranteed to be written in JSON format (for example, during process start). If you intend to parse logs, make sure you can handle log lines that are not JSON as well.
175+
Not all logs are guaranteed to be written in JSON format (for example, during process start).
176+
If you intend to parse logs, make sure you can handle log lines that are not JSON as well.
170177

171178
Field names and JSON serialization are subject to change.
172179
{{< /warning >}}
173180

174181
The `--logging-format=json` flag changes the format of logs from klog native format to JSON format.
175182
Example of JSON log format (pretty printed):
183+
176184
```json
177185
{
178186
"ts": 1580306777.04728,
@@ -187,22 +195,24 @@ Example of JSON log format (pretty printed):
187195
```
188196

189197
Keys with special meaning:
198+
190199
* `ts` - timestamp as Unix time (required, float)
191200
* `v` - verbosity (only for info and not for error messages, int)
192201
* `err` - error string (optional, string)
193202
* `msg` - message (required, string)
194203

195-
196204
List of components currently supporting JSON format:
205+
197206
* {{< glossary_tooltip term_id="kube-controller-manager" text="kube-controller-manager" >}}
198207
* {{< glossary_tooltip term_id="kube-apiserver" text="kube-apiserver" >}}
199208
* {{< glossary_tooltip term_id="kube-scheduler" text="kube-scheduler" >}}
200209
* {{< glossary_tooltip term_id="kubelet" text="kubelet" >}}
201210

202211
### Log verbosity level
203212

204-
The `-v` flag controls log verbosity. Increasing the value increases the number of logged events. Decreasing the value decreases the number of logged events.
205-
Increasing verbosity settings logs increasingly less severe events. A verbosity setting of 0 logs only critical events.
213+
The `-v` flag controls log verbosity. Increasing the value increases the number of logged events.
214+
Decreasing the value decreases the number of logged events. Increasing verbosity settings logs
215+
increasingly less severe events. A verbosity setting of 0 logs only critical events.
206216

207217
### Log location
208218

@@ -228,3 +238,4 @@ The `logrotate` tool rotates logs daily, or once the log size is greater than 10
228238
* Read about [Contextual Logging](https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/3077-contextual-logging)
229239
* Read about [deprecation of klog flags](https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
230240
* Read about the [Conventions for logging severity](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md)
241+

0 commit comments

Comments
 (0)