You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Despite using `kubectl create -f` to create this resource, and defining it similar to
259
-
other resource types in Kubernetes, TokenReview is a special type and the kube-apiserver
260
-
does not actually persist the TokenReview object into etcd.
261
-
Hence `kubectl get tokenreview` is not a valid command.
262
-
-->
263
-
尽管你使用了 `kubectl create -f` 来创建此资源,并与 Kubernetes
264
-
中的其他资源类型类似的方式定义它,但 TokenReview 是一种特殊类别,
265
-
kube-apiserver 实际上并不将 TokenReview 对象持久保存到 etcd 中。
266
-
因此 `kubectl get tokenreview` 不是一个有效的命令。
267
-
{{< /note >}}
227
+
```shell
228
+
# 使用 '-o yaml' 检视命令输出
229
+
kubectl create -o yaml -f tokenreview.yaml
230
+
```
231
+
232
+
你应该看到如下所示的输出:
233
+
234
+
```yaml
235
+
apiVersion: authentication.k8s.io/v1
236
+
kind: TokenReview
237
+
metadata:
238
+
creationTimestamp: null
239
+
spec:
240
+
token: <token>
241
+
status:
242
+
audiences:
243
+
- https://kubernetes.default.svc.cluster.local
244
+
authenticated: true
245
+
user:
246
+
extra:
247
+
authentication.kubernetes.io/credential-id:
248
+
- JTI=7ee52be0-9045-4653-aa5e-0da57b8dccdc
249
+
authentication.kubernetes.io/node-name:
250
+
- kind-control-plane
251
+
authentication.kubernetes.io/node-uid:
252
+
- 497e9d9a-47aa-4930-b0f6-9f2fb574c8c6
253
+
authentication.kubernetes.io/pod-name:
254
+
- test-pod
255
+
authentication.kubernetes.io/pod-uid:
256
+
- e87dbbd6-3d7e-45db-aafb-72b24627dff5
257
+
groups:
258
+
- system:serviceaccounts
259
+
- system:serviceaccounts:default
260
+
- system:authenticated
261
+
uid: f8b4161b-2e2b-11e9-86b7-2afc33b31a7e
262
+
username: system:serviceaccount:default:my-sa
263
+
```
264
+
265
+
{{< note >}}
266
+
<!--
267
+
Despite using `kubectl create -f` to create this resource, and defining it similar to
268
+
other resource types in Kubernetes, TokenReview is a special type and the kube-apiserver
269
+
does not actually persist the TokenReview object into etcd.
270
+
Hence `kubectl get tokenreview` is not a valid command.
271
+
-->
272
+
尽管你使用了 `kubectl create -f` 来创建此资源,并与 Kubernetes
273
+
中的其他资源类型类似的方式定义它,但 TokenReview 是一种特殊类别,
274
+
kube-apiserver 实际上并不将 TokenReview 对象持久保存到 etcd 中。
275
+
因此 `kubectl get tokenreview` 不是一个有效的命令。
276
+
{{< /note >}}
268
277
269
278
<!--
270
279
#### Schema for service account private claims
@@ -495,9 +504,11 @@ API [直接获得](#bound-service-account-token-volume) API 凭据,
495
504
当挂载的 Pod 被删除时这些令牌将自动失效。
496
505
497
506
<!--
498
-
You can still [manually create](/docs/tasks/configure-pod-container/configure-service-account/#manually-create-an-api-token-for-a-serviceaccount) a Secret to hold a service account token; for example, if you need a token that never expires.
507
+
You can still [manually create](/docs/tasks/configure-pod-container/configure-service-account/#manually-create-an-api-token-for-a-serviceaccount)
508
+
a Secret to hold a service account token; for example, if you need a token that never expires.
499
509
500
-
Once you manually create a Secret and link it to a ServiceAccount, the Kubernetes control plane automatically populates the token into that Secret.
510
+
Once you manually create a Secret and link it to a ServiceAccount,
511
+
the Kubernetes control plane automatically populates the token into that Secret.
An alternate setup to setting `--service-account-private-key-file` and `--service-account-key-file` flags is
671
-
to configure an external JWT signer for [external ServiceAccount token signing and key management](#external-serviceaccount-token-signing-and-key-management).
682
+
to configure an external JWT signer for [external ServiceAccount token signing and key management](#external-serviceaccount-token-signing-and-key-management).
672
683
Note that these setups are mutually exclusive and cannot be configured together.
The kube-apiserver can be configured to use external signer for token signing and token verifying key management.
1062
-
This feature enables kubernetes distributions to integrate with key management solutions of their choice (eg: HSMs, cloud KMSes) for service account credential signing and verification.
1063
-
To configure kube-apiserver to use external-jwt-signer set the `--service-account-signing-endpoint` flag to the location of a Unix domain socket (UDS) on a filesystem, or be prefixed with an @ symbol and name a UDS in the abstract socket namespace.
1064
-
At the configured UDS, shall be an RPC server which implements [ExternalJWTSigner](https://github.com/kubernetes/kubernetes/blob/release-1.32/staging/src/k8s.io/externaljwt/apis/v1alpha1/api.proto).
1072
+
This feature enables kubernetes distributions to integrate with key management solutions of their choice
1073
+
(for example, HSMs, cloud KMSes) for service account credential signing and verification.
1074
+
To configure kube-apiserver to use external-jwt-signer set the `--service-account-signing-endpoint` flag
1075
+
to the location of a Unix domain socket (UDS) on a filesystem, or be prefixed with an @ symbol and name
1076
+
a UDS in the abstract socket namespace. At the configured UDS, shall be an RPC server which implements
Check out [KEP-740](https://github.com/kubernetes/enhancements/tree/master/keps/sig-auth/740-service-account-external-signing) for more details on ExternalJWTSigner.
1089
+
Check out [KEP-740](https://github.com/kubernetes/enhancements/tree/master/keps/sig-auth/740-service-account-external-signing)
The kube-apiserver flags `--service-account-key-file` and `--service-account-signing-key-file` will continue to be used for reading from files unless `--service-account-signing-endpoint` is set; they are mutually exclusive ways of supporting JWT signing and authentication.
1097
+
The kube-apiserver flags `--service-account-key-file` and `--service-account-signing-key-file` will continue
1098
+
to be used for reading from files unless `--service-account-signing-endpoint` is set; they are mutually
1099
+
exclusive ways of supporting JWT signing and authentication.
0 commit comments