Skip to content

Commit ccc1735

Browse files
committed
sync /reference/labels-annotations-taints/_index troubleshoot-kubect
Update troubleshoot-kubectl.md u
1 parent ad6351d commit ccc1735

File tree

2 files changed

+41
-7
lines changed

2 files changed

+41
-7
lines changed

content/zh-cn/docs/reference/labels-annotations-taints/_index.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2364,6 +2364,38 @@ without a class specified will be assigned this default class.
23642364
当单个 IngressClass 资源将此注解设置为 `"true"`时,新的未指定 Ingress 类的 Ingress
23652365
资源将被设置为此默认类。
23662366

2367+
<!--
2368+
### nginx.ingress.kubernetes.io/configuration-snippet
2369+
2370+
Type: Annotation
2371+
2372+
Example: `nginx.ingress.kubernetes.io/configuration-snippet: " more_set_headers \"Request-Id: $req_id\";\nmore_set_headers \"Example: 42\";\n"`
2373+
2374+
Used on: Ingress
2375+
2376+
You can use this annotation to set extra configuration on an Ingress that
2377+
uses the [NGINX Ingress Controller] (https://github.com/kubernetes/ingress-nginx/)
2378+
The `configuration-snippet` annotation is ignored
2379+
by default since version 1.9.0 of the ingress controller.
2380+
The NGINX ingress controller setting `allow-snippet-annotations.`
2381+
has to be explicitly enabled to
2382+
use this annotation.
2383+
Enabling the annotation can be dangerous in a multi-tenant cluster, as it can lead people with otherwise
2384+
limited permissions being able to retrieve all Secrets in the cluster.
2385+
-->
2386+
### nginx.ingress.kubernetes.io/configuration-snippet {#nginx-ingress-kubernetes-io-configuration-snippet}
2387+
2388+
类别:注解
2389+
2390+
例子:`nginx.ingress.kubernetes.io/configuration-snippet: " more_set_headers \"Request-Id: $req_id\";\nmore_set_headers \"Example: 42\";\n"`
2391+
2392+
用于:Ingress
2393+
2394+
你可以使用此注解在使用 [NGINX Ingress Controller](https://github.com/kubernetes/ingress-nginx/) 的 Ingress 上设置额外配置。
2395+
自 Ingress 控制器 1.9.0 版本以来,`configuration-snippet` 注解默认会被忽略。
2396+
要使用此注解,必须显式启用 NGINX Ingress 控制器的 `allow-snippet-annotations` 设置。
2397+
在多租户集群中启用该注解可能是危险的,因为这可能导致权限受限的用户能够获取集群中的所有 Secret。
2398+
23672399
<!--
23682400
### kubernetes.io/ingress.class (deprecated)
23692401

content/zh-cn/docs/tasks/debug/debug-cluster/troubleshoot-kubectl.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,13 @@ traffic to the API server.
193193

194194
<!--
195195
## TLS problems
196+
* Additional tools required - `base64` and `openssl` version 3.0 or above.
196197
197198
The Kubernetes API server only serves HTTPS requests by default. In that case TLS problems
198199
may occur due to various reasons, such as certificate expiry or chain of trust validity.
199200
-->
200201
## TLS 问题 {#tls-problems}
202+
* 需要额外的工具 - `base64``openssl` v3.0 或更高版本。
201203

202204
Kubernetes API 服务器默认只为 HTTPS 请求提供服务。在这种情况下,
203205
TLS 问题可能会因各种原因而出现,例如证书过期或信任链有效性。
@@ -215,7 +217,7 @@ Verify the expiry of these certificates:
215217
验证这些证书的到期时间:
216218

217219
```shell
218-
openssl x509 -noout -dates -in $(kubectl config view --minify --output 'jsonpath={.clusters[0].cluster.certificate-authority}')
220+
kubectl config view --flatten --output 'jsonpath={.clusters[0].cluster.certificate-authority-data}' | base64 -d | openssl x509 -noout -dates
219221
```
220222

221223
<!--
@@ -224,12 +226,12 @@ output:
224226
输出为:
225227

226228
```console
227-
notBefore=Sep 2 08:34:12 2023 GMT
228-
notAfter=Aug 31 08:34:12 2033 GMT
229+
notBefore=Feb 13 05:57:47 2024 GMT
230+
notAfter=Feb 10 06:02:47 2034 GMT
229231
```
230232

231233
```shell
232-
openssl x509 -noout -dates -in $(kubectl config view --minify --output 'jsonpath={.users[0].user.client-certificate}')
234+
kubectl config view --flatten --output 'jsonpath={.users[0].user.client-certificate-data}'| base64 -d | openssl x509 -noout -dates
233235
```
234236

235237
<!--
@@ -238,8 +240,8 @@ output:
238240
输出为:
239241

240242
```console
241-
notBefore=Sep 2 08:34:12 2023 GMT
242-
notAfter=Sep 2 08:34:12 2026 GMT
243+
notBefore=Feb 13 05:57:47 2024 GMT
244+
notAfter=Feb 12 06:02:50 2025 GMT
243245
```
244246

245247
<!--
@@ -264,6 +266,6 @@ kubectl config view
264266

265267
<!--
266268
If you previously used a helper tool (for example, `kubectl-oidc-login`), ensure that it is still
267-
installed and configured correctly.
269+
installed and configured correctly.
268270
-->
269271
如果你之前使用了辅助工具(例如 `kubectl-oidc-login`),确保它仍然安装和配置正确。

0 commit comments

Comments
 (0)