Skip to content

Commit 089a67a

Browse files
authored
Merge pull request #43708 from yyyhhhh/my_demo_branch1
[zh]Sync service-accounts-admin.md,ingress-minikube.md,configure-service-account.md,pull-image-private-registry.md
2 parents f259bae + 54a7694 commit 089a67a

File tree

4 files changed

+40
-33
lines changed

4 files changed

+40
-33
lines changed

content/zh-cn/docs/reference/access-authn-authz/service-accounts-admin.md

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -568,33 +568,6 @@ Then, delete the Secret you now know the name of:
568568
kubectl -n examplens delete secret/example-automated-thing-token-zyxwv
569569
```
570570

571-
<!--
572-
The control plane spots that the ServiceAccount is missing its Secret,
573-
and creates a replacement:
574-
-->
575-
控制平面发现 ServiceAccount 缺少其 Secret,并创建一个替代项:
576-
577-
```shell
578-
kubectl -n examplens get serviceaccount/example-automated-thing -o yaml
579-
```
580-
581-
```yaml
582-
apiVersion: v1
583-
kind: ServiceAccount
584-
metadata:
585-
annotations:
586-
kubectl.kubernetes.io/last-applied-configuration: |
587-
{"apiVersion":"v1","kind":"ServiceAccount","metadata":{"annotations":{},"name":"example-automated-thing","namespace":"examplens"}}
588-
creationTimestamp: "2019-07-21T07:07:07Z"
589-
name: example-automated-thing
590-
namespace: examplens
591-
resourceVersion: "1026"
592-
selfLink: /api/v1/namespaces/examplens/serviceaccounts/example-automated-thing
593-
uid: f23fd170-66f2-4697-b049-e1e266b7f835
594-
secrets:
595-
- name: example-automated-thing-token-4rdrh
596-
```
597-
598571
<!--
599572
## Clean up
600573

content/zh-cn/docs/tasks/access-application-cluster/ingress-minikube.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ If you haven't already set up a cluster locally, run `minikube start` to create
174174
http://172.17.0.15:31637
175175
```
176176

177+
```shell
178+
curl http://172.17.0.15:31637
179+
```
180+
177181
<!--
178182
The output is similar to:
179183
-->

content/zh-cn/docs/tasks/configure-pod-container/configure-service-account.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,24 @@ control plane automatically cleans up the long-lived token from that Secret.
420420
当你删除一个与某 Secret 相关联的 ServiceAccount 时,Kubernetes 的控制面会自动清理该
421421
Secret 中长期有效的令牌。
422422
423+
{{< note >}}
424+
<!--
425+
If you view the ServiceAccount using:
426+
427+
` kubectl get serviceaccount build-robot -o yaml`
428+
429+
You can't see the `build-robot-secret` Secret in the ServiceAccount API objects
430+
[`.secrets`](/docs/reference/kubernetes-api/authentication-resources/service-account-v1/) field
431+
because that field is only populated with auto-generated Secrets.
432+
-->
433+
如果你使用以下命令查看 ServiceAccount:
434+
435+
` kubectl get serviceaccount build-robot -o yaml`
436+
437+
在 ServiceAccount API 对象中看不到 `build-robot-secret` Secret,
438+
[`.secrets`](/zh-cn/docs/reference/kubernetes-api/authentication-resources/service-account-v1/) 字段,
439+
因为该字段只会填充自动生成的 Secret。
440+
{{< /note >}}
423441
<!--
424442
## Add ImagePullSecrets to a service account
425443

content/zh-cn/docs/tasks/configure-pod-container/pull-image-private-registry.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ docker login
6666
When prompted, enter your Docker ID, and then the credential you want to use (access token,
6767
or the password for your Docker ID).
6868
69-
The login process creates or updates a `config.json` file that holds an authorization token. Review [how Kubernetes interprets this file](/docs/concepts/containers/images#config-json).
69+
The login process creates or updates a `config.json` file that holds an authorization token.
70+
Review [how Kubernetes interprets this file](/docs/concepts/containers/images#config-json).
7071
7172
View the `config.json` file:
7273
-->
@@ -99,7 +100,9 @@ The output contains a section similar to this:
99100
{{< note >}}
100101
<!--
101102
If you use a Docker credentials store, you won't see that `auth` entry but a `credsStore` entry with the name of the store as value.
102-
In that case, you can create a secret directly. See [Create a Secret by providing credentials on the command line](#create-a-secret-by-providing-credentials-on-the-command-line).
103+
In that case, you can create a secret directly.
104+
See [Create a Secret by providing credentials on the command line](#create-a-secret-by-providing-credentials-on-the-command-line).
105+
103106
-->
104107
如果使用 Docker 凭据仓库,则不会看到 `auth` 条目,看到的将是以仓库名称作为值的 `credsStore` 条目。
105108
在这种情况下,你可以直接创建一个 Secret。
@@ -353,9 +356,20 @@ kubectl get pod private-reg
353356

354357
{{< note >}}
355358
<!--
356-
In case the Pod fails to start with the status `ImagePullBackOff`, view the Pod events:
359+
To use image pull secrets for a Pod (or a Deployment, or other object that
360+
has a pod template that you are using), you need to make sure that the appropriate
361+
Secret does exist in the right namespace. The namespace to use is the same
362+
namespace where you defined the Pod.
357363
-->
358-
如果 Pod 以状态 `ImagePullBackOff` 启动失败,查看 Pod 事件:
364+
要为 Pod(或 Deployment,或其他有 Pod 模板的对象)使用镜像拉取 Secret,
365+
你需要确保合适的 Secret 确实存在于正确的名字空间中。
366+
要使用的是你定义 Pod 时所用的名字空间。
367+
{{< /note >}}
368+
369+
<!--
370+
Also, in case the Pod fails to start with the status `ImagePullBackOff`, view the Pod events:
371+
-->
372+
此外,如果 Pod 启动失败,状态为 `ImagePullBackOff`,查看 Pod 事件:
359373

360374
```shell
361375
kubectl describe pod private-reg
@@ -383,8 +397,6 @@ Events:
383397
... FailedToRetrieveImagePullSecret ... Unable to retrieve some image pull secrets (<regcred>); attempting to pull the image may not succeed.
384398
```
385399

386-
{{< /note >}}
387-
388400
## {{% heading "whatsnext" %}}
389401

390402
<!--

0 commit comments

Comments
 (0)