diff --git a/content/en/blog/_posts/2021-04-06-PodSecurityPolicy-Past-Present-and-Future.md b/content/en/blog/_posts/2021-04-06-PodSecurityPolicy-Past-Present-and-Future.md index 0f75a90a28a..b1ef117bc19 100644 --- a/content/en/blog/_posts/2021-04-06-PodSecurityPolicy-Past-Present-and-Future.md +++ b/content/en/blog/_posts/2021-04-06-PodSecurityPolicy-Past-Present-and-Future.md @@ -7,71 +7,156 @@ slug: podsecuritypolicy-deprecation-past-present-and-future **Author:** Tabitha Sable (Kubernetes SIG Security) {{% pageinfo color="primary" %}} -**Update:** *With the release of Kubernetes v1.25, PodSecurityPolicy has been removed.* *You can read more information about the removal of PodSecurityPolicy in the [Kubernetes 1.25 release notes](/blog/2022/08/23/kubernetes-v1-25-release/#pod-security-changes).* +**Update:** *With the release of Kubernetes v1.25, PodSecurityPolicy has been removed.* +*You can read more information about the removal of PodSecurityPolicy in the +[Kubernetes 1.25 release notes](/blog/2022/08/23/kubernetes-v1-25-release/#pod-security-changes).* {{% /pageinfo %}} -PodSecurityPolicy (PSP) is being deprecated in Kubernetes 1.21, to be released later this week. This starts the countdown to its removal, but doesn’t change anything else. PodSecurityPolicy will continue to be fully functional for several more releases before being removed completely. In the meantime, we are developing a replacement for PSP that covers key use cases more easily and sustainably. +PodSecurityPolicy (PSP) is being deprecated in Kubernetes 1.21, to be released later this week. +This starts the countdown to its removal, but doesn’t change anything else. +PodSecurityPolicy will continue to be fully functional for several more releases before being removed completely. +In the meantime, we are developing a replacement for PSP that covers key use cases more easily and sustainably. -What are Pod Security Policies? Why did we need them? Why are they going away, and what’s next? How does this affect you? These key questions come to mind as we prepare to say goodbye to PSP, so let’s walk through them together. We’ll start with an overview of how features get removed from Kubernetes. +What are Pod Security Policies? Why did we need them? Why are they going away, and what’s next? +How does this affect you? These key questions come to mind as we prepare to say goodbye to PSP, +so let’s walk through them together. We’ll start with an overview of how features get removed from Kubernetes. ## What does deprecation mean in Kubernetes? -Whenever a Kubernetes feature is set to go away, our [deprecation policy](/docs/reference/using-api/deprecation-policy/) is our guide. First the feature is marked as deprecated, then after enough time has passed, it can finally be removed. +Whenever a Kubernetes feature is set to go away, our [deprecation policy](/docs/reference/using-api/deprecation-policy/) +is our guide. First the feature is marked as deprecated, then after enough time has passed, it can finally be removed. -Kubernetes 1.21 starts the deprecation process for PodSecurityPolicy. As with all feature deprecations, PodSecurityPolicy will continue to be fully functional for several more releases. The current plan is to remove PSP from Kubernetes in the 1.25 release. +Kubernetes 1.21 starts the deprecation process for PodSecurityPolicy. As with all feature deprecations, +PodSecurityPolicy will continue to be fully functional for several more releases. +The current plan is to remove PSP from Kubernetes in the 1.25 release. -Until then, PSP is still PSP. There will be at least a year during which the newest Kubernetes releases will still support PSP, and nearly two years until PSP will pass fully out of all supported Kubernetes versions. +Until then, PSP is still PSP. There will be at least a year during which the newest Kubernetes releases will +still support PSP, and nearly two years until PSP will pass fully out of all supported Kubernetes versions. ## What is PodSecurityPolicy? -[PodSecurityPolicy](/docs/concepts/security/pod-security-policy/) is a built-in [admission controller](/blog/2019/03/21/a-guide-to-kubernetes-admission-controllers/) that allows a cluster administrator to control security-sensitive aspects of the Pod specification. +[PodSecurityPolicy](/docs/concepts/security/pod-security-policy/) is +a built-in [admission controller](/blog/2019/03/21/a-guide-to-kubernetes-admission-controllers/) +that allows a cluster administrator to control security-sensitive aspects of the Pod specification. -First, one or more PodSecurityPolicy resources are created in a cluster to define the requirements Pods must meet. Then, RBAC rules are created to control which PodSecurityPolicy applies to a given pod. If a pod meets the requirements of its PSP, it will be admitted to the cluster as usual. In some cases, PSP can also modify Pod fields, effectively creating new defaults for those fields. If a Pod does not meet the PSP requirements, it is rejected, and cannot run. +First, one or more PodSecurityPolicy resources are created in a cluster to define the requirements Pods must meet. +Then, RBAC rules are created to control which PodSecurityPolicy applies to a given pod. +If a pod meets the requirements of its PSP, it will be admitted to the cluster as usual. +In some cases, PSP can also modify Pod fields, effectively creating new defaults for those fields. +If a Pod does not meet the PSP requirements, it is rejected, and cannot run. -One more important thing to know about PodSecurityPolicy: it’s not the same as [PodSecurityContext](/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context). +One more important thing to know about PodSecurityPolicy: it’s not the same as +[PodSecurityContext](/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context). -A part of the Pod specification, PodSecurityContext (and its per-container counterpart `SecurityContext`) is the collection of fields that specify many of the security-relevant settings for a Pod. The security context dictates to the kubelet and container runtime how the Pod should actually be run. In contrast, the PodSecurityPolicy only constrains (or defaults) the values that may be set on the security context. +A part of the Pod specification, PodSecurityContext (and its per-container counterpart `SecurityContext`) +is the collection of fields that specify many of the security-relevant settings for a Pod. +The security context dictates to the kubelet and container runtime how the Pod should actually be run. +In contrast, the PodSecurityPolicy only constrains (or defaults) the values that may be set on the security context. The deprecation of PSP does not affect PodSecurityContext in any way. ## Why did we need PodSecurityPolicy? -In Kubernetes, we define resources such as Deployments, StatefulSets, and Services that represent the building blocks of software applications. The various controllers inside a Kubernetes cluster react to these resources, creating further Kubernetes resources or configuring some software or hardware to accomplish our goals. +In Kubernetes, we define resources such as Deployments, StatefulSets, and Services that +represent the building blocks of software applications. The various controllers inside +a Kubernetes cluster react to these resources, creating further Kubernetes resources or +configuring some software or hardware to accomplish our goals. -In most Kubernetes clusters, RBAC (Role-Based Access Control) [rules](/docs/reference/access-authn-authz/rbac/#role-and-clusterrole) control access to these resources. `list`, `get`, `create`, `edit`, and `delete` are the sorts of API operations that RBAC cares about, but _RBAC does not consider what settings are being put into the resources it controls_. For example, a Pod can be almost anything from a simple webserver to a privileged command prompt offering full access to the underlying server node and all the data. It’s all the same to RBAC: a Pod is a Pod is a Pod. +In most Kubernetes clusters, +RBAC (Role-Based Access Control) [rules](/docs/reference/access-authn-authz/rbac/#role-and-clusterrole) +control access to these resources. `list`, `get`, `create`, `edit`, and `delete` are +the sorts of API operations that RBAC cares about, +but _RBAC does not consider what settings are being put into the resources it controls_. +For example, a Pod can be almost anything from a simple webserver to +a privileged command prompt offering full access to the underlying server node and all the data. +It’s all the same to RBAC: a Pod is a Pod is a Pod. -To control what sorts of settings are allowed in the resources defined in your cluster, you need Admission Control in addition to RBAC. Since Kubernetes 1.3, PodSecurityPolicy has been the built-in way to do that for security-related Pod fields. Using PodSecurityPolicy, you can prevent “create Pod” from automatically meaning “root on every cluster node,” without needing to deploy additional external admission controllers. +To control what sorts of settings are allowed in the resources defined in your cluster, +you need Admission Control in addition to RBAC. Since Kubernetes 1.3, +PodSecurityPolicy has been the built-in way to do that for security-related Pod fields. +Using PodSecurityPolicy, you can prevent “create Pod” from automatically meaning “root on every cluster node,” +without needing to deploy additional external admission controllers. ## Why is PodSecurityPolicy going away? -In the years since PodSecurityPolicy was first introduced, we have realized that PSP has some serious usability problems that can’t be addressed without making breaking changes. +In the years since PodSecurityPolicy was first introduced, we have realized that +PSP has some serious usability problems that can’t be addressed without making breaking changes. -The way PSPs are applied to Pods has proven confusing to nearly everyone that has attempted to use them. It is easy to accidentally grant broader permissions than intended, and difficult to inspect which PSP(s) apply in a given situation. The “changing Pod defaults” feature can be handy, but is only supported for certain Pod settings and it’s not obvious when they will or will not apply to your Pod. Without a “dry run” or audit mode, it’s impractical to retrofit PSP to existing clusters safely, and it’s impossible for PSP to ever be enabled by default. +The way PSPs are applied to Pods has proven confusing to nearly everyone that has attempted to use them. +It is easy to accidentally grant broader permissions than intended, +and difficult to inspect which PSP(s) apply in a given situation. The “changing Pod defaults” feature can be handy, +but is only supported for certain Pod settings and it’s not obvious when they will or will not apply to your Pod. +Without a “dry run” or audit mode, it’s impractical to retrofit PSP to existing clusters safely, +and it’s impossible for PSP to ever be enabled by default. -For more information about these and other PSP difficulties, check out SIG Auth’s KubeCon NA 2019 Maintainer Track session video: {{< youtube "SFtHRmPuhEw?start=953" youtube-quote-sm >}} +For more information about these and other PSP difficulties, check out +SIG Auth’s KubeCon NA 2019 Maintainer Track session video:{{< youtube "SFtHRmPuhEw?start=953" youtube-quote-sm >}} -Today, you’re not limited only to deploying PSP or writing your own custom admission controller. Several external admission controllers are available that incorporate lessons learned from PSP to provide a better user experience. [K-Rail](https://github.com/cruise-automation/k-rail), [Kyverno](https://github.com/kyverno/kyverno/), and [OPA/Gatekeeper](https://github.com/open-policy-agent/gatekeeper/) are all well-known, and each has its fans. +Today, you’re not limited only to deploying PSP or writing your own custom admission controller. +Several external admission controllers are available that incorporate lessons learned from PSP to +provide a better user experience. [K-Rail](https://github.com/cruise-automation/k-rail), +[Kyverno](https://github.com/kyverno/kyverno/), and +[OPA/Gatekeeper](https://github.com/open-policy-agent/gatekeeper/) are all well-known, and each has its fans. -Although there are other good options available now, we believe there is still value in having a built-in admission controller available as a choice for users. With this in mind, we turn toward building what’s next, inspired by the lessons learned from PSP. +Although there are other good options available now, we believe there is still value in +having a built-in admission controller available as a choice for users. With this in mind, +we turn toward building what’s next, inspired by the lessons learned from PSP. ## What’s next? -Kubernetes SIG Security, SIG Auth, and a diverse collection of other community members have been working together for months to ensure that what’s coming next is going to be awesome. We have developed a Kubernetes Enhancement Proposal ([KEP 2579](https://github.com/kubernetes/enhancements/issues/2579)) and a prototype for a new feature, currently being called by the temporary name "PSP Replacement Policy." We are targeting an Alpha release in Kubernetes 1.22. +Kubernetes SIG Security, SIG Auth, and a diverse collection of other community members +have been working together for months to ensure that what’s coming next is going to be awesome. +We have developed a Kubernetes Enhancement Proposal ([KEP 2579](https://github.com/kubernetes/enhancements/issues/2579)) +and a prototype for a new feature, currently being called by the temporary name "PSP Replacement Policy." +We are targeting an Alpha release in Kubernetes 1.22. -PSP Replacement Policy starts with the realization that since there is a robust ecosystem of external admission controllers already available, PSP’s replacement doesn’t need to be all things to all people. Simplicity of deployment and adoption is the key advantage a built-in admission controller has compared to an external webhook, so we have focused on how to best utilize that advantage. +PSP Replacement Policy starts with the realization that +since there is a robust ecosystem of external admission controllers already available, +PSP’s replacement doesn’t need to be all things to all people. +Simplicity of deployment and adoption is the key advantage a built-in admission controller has +compared to an external webhook, so we have focused on how to best utilize that advantage. -PSP Replacement Policy is designed to be as simple as practically possible while providing enough flexibility to really be useful in production at scale. It has soft rollout features to enable retrofitting it to existing clusters, and is configurable enough that it can eventually be active by default. It can be deactivated partially or entirely, to coexist with external admission controllers for advanced use cases. +PSP Replacement Policy is designed to be as simple as practically possible +while providing enough flexibility to really be useful in production at scale. +It has soft rollout features to enable retrofitting it to existing clusters, +and is configurable enough that it can eventually be active by default. +It can be deactivated partially or entirely, to coexist with external admission controllers for advanced use cases. ## What does this mean for you? -What this all means for you depends on your current PSP situation. If you’re already using PSP, there’s plenty of time to plan your next move. Please review the PSP Replacement Policy KEP and think about how well it will suit your use case. +What this all means for you depends on your current PSP situation. +If you’re already using PSP, there’s plenty of time to plan your next move. +Please review the PSP Replacement Policy KEP and think about how well it will suit your use case. -If you’re making extensive use of the flexibility of PSP with numerous PSPs and complex binding rules, you will likely find the simplicity of PSP Replacement Policy too limiting. Use the next year to evaluate the other admission controller choices in the ecosystem. There are resources available to ease this transition, such as the [Gatekeeper Policy Library](https://github.com/open-policy-agent/gatekeeper-library). +If you’re making extensive use of the flexibility of PSP with numerous PSPs and complex binding rules, +you will likely find the simplicity of PSP Replacement Policy too limiting. +Use the next year to evaluate the other admission controller choices in the ecosystem. +There are resources available to ease this transition, +such as the [Gatekeeper Policy Library](https://github.com/open-policy-agent/gatekeeper-library). -If your use of PSP is relatively simple, with a few policies and straightforward binding to service accounts in each namespace, you will likely find PSP Replacement Policy to be a good match for your needs. Evaluate your PSPs compared to the Kubernetes [Pod Security Standards](/docs/concepts/security/pod-security-standards/) to get a feel for where you’ll be able to use the Restricted, Baseline, and Privileged policies. Please follow along with or contribute to the KEP and subsequent development, and try out the Alpha release of PSP Replacement Policy when it becomes available. +If your use of PSP is relatively simple, with a few policies and straightforward binding to +service accounts in each namespace, you will likely find PSP Replacement Policy to be a good match for your needs. +Evaluate your PSPs compared to the Kubernetes [Pod Security Standards](/docs/concepts/security/pod-security-standards/) +to get a feel for where you’ll be able to use the Restricted, Baseline, and Privileged policies. +Please follow along with or contribute to the KEP and subsequent development, +and try out the Alpha release of PSP Replacement Policy when it becomes available. -If you’re just beginning your PSP journey, you will save time and effort by keeping it simple. You can approximate the functionality of PSP Replacement Policy today by using the Pod Security Standards’ PSPs. If you set the cluster default by binding a Baseline or Restricted policy to the `system:serviceaccounts` group, and then make a more-permissive policy available as needed in certain Namespaces [using ServiceAccount bindings](/docs/concepts/policy/pod-security-policy/#run-another-pod), you will avoid many of the PSP pitfalls and have an easy migration to PSP Replacement Policy. If your needs are much more complex than this, your effort is probably better spent adopting one of the more fully-featured external admission controllers mentioned above. +If you’re just beginning your PSP journey, you will save time and effort by keeping it simple. +You can approximate the functionality of PSP Replacement Policy today by using the Pod Security Standards’ PSPs. +If you set the cluster default by binding a Baseline or Restricted policy to the `system:serviceaccounts` group, +and then make a more-permissive policy available as needed in certain +Namespaces [using ServiceAccount bindings](/docs/concepts/policy/pod-security-policy/#run-another-pod), +you will avoid many of the PSP pitfalls and have an easy migration to PSP Replacement Policy. +If your needs are much more complex than this, your effort is probably better spent adopting +one of the more fully-featured external admission controllers mentioned above. -We’re dedicated to making Kubernetes the best container orchestration tool we can, and sometimes that means we need to remove longstanding features to make space for better things to come. When that happens, the Kubernetes deprecation policy ensures you have plenty of time to plan your next move. In the case of PodSecurityPolicy, several options are available to suit a range of needs and use cases. Start planning ahead now for PSP’s eventual removal, and please consider contributing to its replacement! Happy securing! +We’re dedicated to making Kubernetes the best container orchestration tool we can, +and sometimes that means we need to remove longstanding features to make space for better things to come. +When that happens, the Kubernetes deprecation policy ensures you have plenty of time to plan your next move. +In the case of PodSecurityPolicy, several options are available to suit a range of needs and use cases. +Start planning ahead now for PSP’s eventual removal, and please consider contributing to its replacement! Happy securing! -**Acknowledgment:** It takes a wonderful group to make wonderful software. Thanks are due to everyone who has contributed to the PSP replacement effort, especially (in alphabetical order) Tim Allclair, Ian Coldwater, and Jordan Liggitt. It’s been a joy to work with y’all on this. +**Acknowledgment:** It takes a wonderful group to make wonderful software. +Thanks are due to everyone who has contributed to the PSP replacement effort, +especially (in alphabetical order) Tim Allclair, Ian Coldwater, and Jordan Liggitt. +It’s been a joy to work with y’all on this. diff --git a/content/en/docs/concepts/cluster-administration/flow-control.md b/content/en/docs/concepts/cluster-administration/flow-control.md index 5cd5ca339e6..86d35f62e61 100644 --- a/content/en/docs/concepts/cluster-administration/flow-control.md +++ b/content/en/docs/concepts/cluster-administration/flow-control.md @@ -522,6 +522,8 @@ poorly-behaved workloads that may be harming system health. queue excess requests, or * `time-out`, indicating that the request was still in the queue when its queuing time limit expired. + * `cancelled`, indicating that the request is not purge locked + and has been ejected from the queue. * `apiserver_flowcontrol_dispatched_requests_total` is a counter vector (cumulative since server start) of requests that began diff --git a/content/en/docs/contribute/review/for-approvers.md b/content/en/docs/contribute/review/for-approvers.md index ece02403e74..dfee2838b0d 100644 --- a/content/en/docs/contribute/review/for-approvers.md +++ b/content/en/docs/contribute/review/for-approvers.md @@ -12,11 +12,12 @@ SIG Docs [Reviewers](/docs/contribute/participate/#reviewers) and [Approvers](/docs/contribute/participate/#approvers) do a few extra things when reviewing a change. -Every week a specific docs approver volunteers to triage -and review pull requests. This -person is the "PR Wrangler" for the week. See the -[PR Wrangler scheduler](https://github.com/kubernetes/website/wiki/PR-Wranglers) for more information. To become a PR Wrangler, attend the weekly SIG Docs meeting and volunteer. Even if you are not on the schedule for the current week, you can still review pull -requests (PRs) that are not already under active review. +Every week a specific docs approver volunteers to triage and review pull requests. +This person is the "PR Wrangler" for the week. See the +[PR Wrangler scheduler](https://github.com/kubernetes/website/wiki/PR-Wranglers) +for more information. To become a PR Wrangler, attend the weekly SIG Docs meeting +and volunteer. Even if you are not on the schedule for the current week, you can +still review pull requests (PRs) that are not already under active review. In addition to the rotation, a bot assigns reviewers and approvers for the PR based on the owners for the affected files. @@ -25,21 +26,26 @@ for the PR based on the owners for the affected files. ## Reviewing a PR -Kubernetes documentation follows the [Kubernetes code review process](https://github.com/kubernetes/community/blob/master/contributors/guide/owners.md#the-code-review-process). +Kubernetes documentation follows the +[Kubernetes code review process](https://github.com/kubernetes/community/blob/master/contributors/guide/owners.md#the-code-review-process). -Everything described in [Reviewing a pull request](/docs/contribute/review/reviewing-prs) applies, but Reviewers and Approvers should also do the following: +Everything described in [Reviewing a pull request](/docs/contribute/review/reviewing-prs) +applies, but Reviewers and Approvers should also do the following: -- Using the `/assign` Prow command to assign a specific reviewer to a PR as needed. This is extra important -when it comes to requesting technical review from code contributors. +- Using the `/assign` Prow command to assign a specific reviewer to a PR as needed. + This is extra important when it comes to requesting technical review from code contributors. {{< note >}} Look at the `reviewers` field in the front-matter at the top of a Markdown file to see who can provide technical review. {{< /note >}} -- Making sure the PR follows the [Content](/docs/contribute/style/content-guide/) and [Style](/docs/contribute/style/style-guide/) guides; link the author to the relevant part of the guide(s) if it doesn't. +- Making sure the PR follows the [Content](/docs/contribute/style/content-guide/) + and [Style](/docs/contribute/style/style-guide/) guides; link the author to the + relevant part of the guide(s) if it doesn't. - Using the GitHub **Request Changes** option when applicable to suggest changes to the PR author. -- Changing your review status in GitHub using the `/approve` or `/lgtm` Prow commands, if your suggestions are implemented. +- Changing your review status in GitHub using the `/approve` or `/lgtm` Prow commands, + if your suggestions are implemented. ## Commit into another person's PR @@ -72,7 +78,9 @@ true: [Prow](https://github.com/kubernetes/test-infra/blob/master/prow/README.md) is the Kubernetes-based CI/CD system that runs jobs against pull requests (PRs). Prow enables chatbot-style commands to handle GitHub actions across the Kubernetes -organization, like [adding and removing labels](#adding-and-removing-issue-labels), closing issues, and assigning an approver. Enter Prow commands as GitHub comments using the `/` format. +organization, like [adding and removing labels](#adding-and-removing-issue-labels), +closing issues, and assigning an approver. Enter Prow commands as GitHub comments +using the `/` format. The most common prow commands reviewers and approvers use are: @@ -92,9 +100,9 @@ To view the commands that you can use in a PR, see the ## Triage and categorize issues - -In general, SIG Docs follows the [Kubernetes issue triage](https://github.com/kubernetes/community/blob/master/contributors/guide/issue-triage.md) process and uses the same labels. - +In general, SIG Docs follows the +[Kubernetes issue triage](https://github.com/kubernetes/community/blob/master/contributors/guide/issue-triage.md) +process and uses the same labels. This GitHub Issue [filter](https://github.com/kubernetes/website/issues?q=is%3Aissue+is%3Aopen+-label%3Apriority%2Fbacklog+-label%3Apriority%2Fimportant-longterm+-label%3Apriority%2Fimportant-soon+-label%3Atriage%2Fneeds-information+-label%3Atriage%2Fsupport+sort%3Acreated-asc) finds issues that might need triage. @@ -102,16 +110,18 @@ finds issues that might need triage. ### Triaging an issue 1. Validate the issue - - Make sure the issue is about website documentation. Some issues can be closed quickly by - answering a question or pointing the reporter to a resource. See the - [Support requests or code bug reports](#support-requests-or-code-bug-reports) section for details. - - Assess whether the issue has merit. - - Add the `triage/needs-information` label if the issue doesn't have enough - detail to be actionable or the template is not filled out adequately. - - Close the issue if it has both the `lifecycle/stale` and `triage/needs-information` labels. + + - Make sure the issue is about website documentation. Some issues can be closed quickly by + answering a question or pointing the reporter to a resource. See the + [Support requests or code bug reports](#support-requests-or-code-bug-reports) section for details. + - Assess whether the issue has merit. + - Add the `triage/needs-information` label if the issue doesn't have enough + detail to be actionable or the template is not filled out adequately. + - Close the issue if it has both the `lifecycle/stale` and `triage/needs-information` labels. 2. Add a priority label (the - [Issue Triage Guidelines](https://github.com/kubernetes/community/blob/master/contributors/guide/issue-triage.md#define-priority) define priority labels in detail) + [Issue Triage Guidelines](https://github.com/kubernetes/community/blob/master/contributors/guide/issue-triage.md#define-priority) + define priority labels in detail) {{< table caption="Issue labels" >}} Label | Description @@ -146,7 +156,8 @@ To remove a label, leave a comment in one of the following formats: In both cases, the label must already exist. If you try to add a label that does not exist, the command is silently ignored. -For a list of all labels, see the [website repository's Labels section](https://github.com/kubernetes/website/labels). Not all labels are used by SIG Docs. +For a list of all labels, see the [website repository's Labels section](https://github.com/kubernetes/website/labels). +Not all labels are used by SIG Docs. ### Issue lifecycle labels @@ -177,7 +188,9 @@ and avoids duplicate work on the same problem. ### Dead link issues -If the dead link issue is in the API or `kubectl` documentation, assign them `/priority critical-urgent` until the problem is fully understood. Assign all other dead link issues `/priority important-longterm`, as they must be manually fixed. +If the dead link issue is in the API or `kubectl` documentation, assign them +`/priority critical-urgent` until the problem is fully understood. Assign all +other dead link issues `/priority important-longterm`, as they must be manually fixed. ### Blog issues @@ -222,4 +235,49 @@ https://github.com/kubernetes/kubernetes/issues. If this is a documentation issue, please re-open this issue. ``` +### Squashing +As an approver, when you review pull requests (PRs), there are various cases +where you might do the following: + +- Advise the contributor to squash their commits. +- Squash the commits for the contributor. +- Advise the contributor not to squash yet. +- Prevent squashing. + +**Advising contributors to squash**: A new contributor might not know that they +should squash commits in their pull requests (PRs). If this is the case, advise +them to do so, provide links to useful information, and offer to arrange help if +they need it. Some useful links: + +- [Opening pull requests and squashing your commits](/docs/contribute/new-content/open-a-pr#squashing-commits) + for documentation contributors. +- [GitHub Workflow](https://www.k8s.dev/docs/guide/github-workflow/), including diagrams, for developers. + +**Squashing commits for contributors**: If a contributor might have difficulty +squashing commits or there is time pressure to merge a PR, you can perform the +squash for them: + +- The kubernetes/website repo is + [configured to allow squashing for pull request merges](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/configuring-commit-squashing-for-pull-requests). + Simply select the *Squash commits* button. +- In the PR, if the contributor enables maintainers to manage the PR, you can + squash their commits and update their fork with the result. Before you squash, + advise them to save and push their latest changes to the PR. After you squash, + advise them to pull the squashed commit to their local clone. +- You can get GitHub to squash the commits by using a label so that Tide / GitHub + performs the squash or by clicking the *Squash commits* button when you merge the PR. + +**Advise contributors to avoid squashing** + +- If one commit does something broken or unwise, and the last commit reverts this + error, don't squash the commits. Even though the "Files changed" tab in the PR + on GitHub and the Netlify preview will both look OK, merging this PR might create + rebase or merge conflicts for other folks. Intervene as you see fit to avoid that + risk to other contributors. + +**Never squash** + +- If you're launching a localization or releasing the docs for a new version, + you are merging in a branch that's not from a user's fork, _never squash the commits_. + Not squashing is essential because you must maintain the commit history for those files. diff --git a/content/en/docs/reference/_index.md b/content/en/docs/reference/_index.md index a24535ba0ce..960881e77f0 100644 --- a/content/en/docs/reference/_index.md +++ b/content/en/docs/reference/_index.md @@ -77,6 +77,7 @@ operator to use or manage a cluster. * [kubeconfig (v1)](/docs/reference/config-api/kubeconfig.v1/) * [kube-apiserver admission (v1)](/docs/reference/config-api/apiserver-admission.v1/) * [kube-apiserver configuration (v1alpha1)](/docs/reference/config-api/apiserver-config.v1alpha1/) and +* [kube-apiserver configuration (v1beta1)](/docs/reference/config-api/apiserver-config.v1beta1/) and [kube-apiserver configuration (v1)](/docs/reference/config-api/apiserver-config.v1/) * [kube-apiserver encryption (v1)](/docs/reference/config-api/apiserver-encryption.v1/) * [kube-apiserver event rate limit (v1alpha1)](/docs/reference/config-api/apiserver-eventratelimit.v1alpha1/) diff --git a/content/en/docs/reference/config-api/apiserver-config.v1beta1.md b/content/en/docs/reference/config-api/apiserver-config.v1beta1.md new file mode 100644 index 00000000000..0ed8e17a44d --- /dev/null +++ b/content/en/docs/reference/config-api/apiserver-config.v1beta1.md @@ -0,0 +1,268 @@ +--- +title: kube-apiserver Configuration (v1beta1) +content_type: tool-reference +package: apiserver.k8s.io/v1beta1 +auto_generated: true +--- +

Package v1beta1 is the v1beta1 version of the API.

+ + +## Resource Types + + +- [EgressSelectorConfiguration](#apiserver-k8s-io-v1beta1-EgressSelectorConfiguration) + + + +## `EgressSelectorConfiguration` {#apiserver-k8s-io-v1beta1-EgressSelectorConfiguration} + + + +

EgressSelectorConfiguration provides versioned configuration for egress selector clients.

+ + + + + + + + + + + + + + +
FieldDescription
apiVersion
string
apiserver.k8s.io/v1beta1
kind
string
EgressSelectorConfiguration
egressSelections [Required]
+[]EgressSelection +
+

connectionServices contains a list of egress selection client configurations

+
+ +## `Connection` {#apiserver-k8s-io-v1beta1-Connection} + + +**Appears in:** + +- [EgressSelection](#apiserver-k8s-io-v1beta1-EgressSelection) + + +

Connection provides the configuration for a single egress selection client.

+ + + + + + + + + + + + + + +
FieldDescription
proxyProtocol [Required]
+ProtocolType +
+

Protocol is the protocol used to connect from client to the konnectivity server.

+
transport
+Transport +
+

Transport defines the transport configurations we use to dial to the konnectivity server. +This is required if ProxyProtocol is HTTPConnect or GRPC.

+
+ +## `EgressSelection` {#apiserver-k8s-io-v1beta1-EgressSelection} + + +**Appears in:** + +- [EgressSelectorConfiguration](#apiserver-k8s-io-v1beta1-EgressSelectorConfiguration) + + +

EgressSelection provides the configuration for a single egress selection client.

+ + + + + + + + + + + + + + +
FieldDescription
name [Required]
+string +
+

name is the name of the egress selection. +Currently supported values are "controlplane", "master", "etcd" and "cluster" +The "master" egress selector is deprecated in favor of "controlplane"

+
connection [Required]
+Connection +
+

connection is the exact information used to configure the egress selection

+
+ +## `ProtocolType` {#apiserver-k8s-io-v1beta1-ProtocolType} + +(Alias of `string`) + +**Appears in:** + +- [Connection](#apiserver-k8s-io-v1beta1-Connection) + + +

ProtocolType is a set of valid values for Connection.ProtocolType

+ + + + +## `TCPTransport` {#apiserver-k8s-io-v1beta1-TCPTransport} + + +**Appears in:** + +- [Transport](#apiserver-k8s-io-v1beta1-Transport) + + +

TCPTransport provides the information to connect to konnectivity server via TCP

+ + + + + + + + + + + + + + +
FieldDescription
url [Required]
+string +
+

URL is the location of the konnectivity server to connect to. +As an example it might be "https://127.0.0.1:8131"

+
tlsConfig
+TLSConfig +
+

TLSConfig is the config needed to use TLS when connecting to konnectivity server

+
+ +## `TLSConfig` {#apiserver-k8s-io-v1beta1-TLSConfig} + + +**Appears in:** + +- [TCPTransport](#apiserver-k8s-io-v1beta1-TCPTransport) + + +

TLSConfig provides the authentication information to connect to konnectivity server +Only used with TCPTransport

+ + + + + + + + + + + + + + + + + +
FieldDescription
caBundle
+string +
+

caBundle is the file location of the CA to be used to determine trust with the konnectivity server. +Must be absent/empty if TCPTransport.URL is prefixed with http:// +If absent while TCPTransport.URL is prefixed with https://, default to system trust roots.

+
clientKey
+string +
+

clientKey is the file location of the client key to be used in mtls handshakes with the konnectivity server. +Must be absent/empty if TCPTransport.URL is prefixed with http:// +Must be configured if TCPTransport.URL is prefixed with https://

+
clientCert
+string +
+

clientCert is the file location of the client certificate to be used in mtls handshakes with the konnectivity server. +Must be absent/empty if TCPTransport.URL is prefixed with http:// +Must be configured if TCPTransport.URL is prefixed with https://

+
+ +## `Transport` {#apiserver-k8s-io-v1beta1-Transport} + + +**Appears in:** + +- [Connection](#apiserver-k8s-io-v1beta1-Connection) + + +

Transport defines the transport configurations we use to dial to the konnectivity server

+ + + + + + + + + + + + + + +
FieldDescription
tcp
+TCPTransport +
+

TCP is the TCP configuration for communicating with the konnectivity server via TCP +ProxyProtocol of GRPC is not supported with TCP transport at the moment +Requires at least one of TCP or UDS to be set

+
uds
+UDSTransport +
+

UDS is the UDS configuration for communicating with the konnectivity server via UDS +Requires at least one of TCP or UDS to be set

+
+ +## `UDSTransport` {#apiserver-k8s-io-v1beta1-UDSTransport} + + +**Appears in:** + +- [Transport](#apiserver-k8s-io-v1beta1-Transport) + + +

UDSTransport provides the information to connect to konnectivity server via UDS

+ + + + + + + + + + + +
FieldDescription
udsName [Required]
+string +
+

UDSName is the name of the unix domain socket to connect to konnectivity server +This does not use a unix:// prefix. (Eg: /etc/srv/kubernetes/konnectivity-server/konnectivity-server.socket)

+
+ \ No newline at end of file diff --git a/content/en/docs/reference/labels-annotations-taints/_index.md b/content/en/docs/reference/labels-annotations-taints/_index.md index 03397f462f5..504d8700c26 100644 --- a/content/en/docs/reference/labels-annotations-taints/_index.md +++ b/content/en/docs/reference/labels-annotations-taints/_index.md @@ -104,6 +104,53 @@ The cluster autoscaler never evicts Pods that have this annotation explicitly se `"false"`; you could set that on an important Pod that you want to keep running. If this annotation is not set then the cluster autoscaler follows its Pod-level behavior. +### config.kubernetes.io/local-config + +Example: `config.kubernetes.io/local-config: "true"` + +Used on: All objects + +This annotation is used in manifests to mark an object as local configuration that should not be submitted to the Kubernetes API. + +A value of "true" for this annotation declares that the object is only consumed by client-side tooling and should not be submitted to the API server. + +A value of "false" can be used to declare that the object should be submitted to the API server even when it would otherwise be assumed to be local. + +This annotation is part of the Kubernetes Resource Model (KRM) Functions Specification, which is used by Kustomize and similar third-party tools. For example, Kustomize removes objects with this annotation from its final build output. + + +### internal.config.kubernetes.io/* (reserved prefix) {#internal.config.kubernetes.io-reserved-wildcard} + +Used on: All objects + +This prefix is reserved for internal use by tools that act as orchestrators in accordance with the Kubernetes Resource Model (KRM) Functions Specification. Annotations with this prefix are internal to the orchestration process and are not persisted to the manifests on the filesystem. In other words, the orchestrator tool should set these annotations when reading files from the local filesystem and remove them when writing the output of functions back to the filesystem. + +A KRM function **must not** modify annotations with this prefix, unless otherwise specified for a given annotation. This enables orchestrator tools to add additional internal annotations, without requiring changes to existing functions. + +### internal.config.kubernetes.io/path + +Example: `internal.config.kubernetes.io/path: "relative/file/path.yaml"` + +Used on: All objects + +This annotation records the slash-delimited, OS-agnostic, relative path to the manifest file the object was loaded from. The path is relative to a fixed location on the filesystem, determined by the orchestrator tool. + +This annotation is part of the Kubernetes Resource Model (KRM) Functions Specification, which is used by Kustomize and similar third-party tools. + +A KRM Function **should not** modify this annotation on input objects unless it is modifying the referenced files. A KRM Function **may** include this annotation on objects it generates. + +### internal.config.kubernetes.io/index + +Example: `internal.config.kubernetes.io/index: "2"` + +Used on: All objects + +This annotation records the zero-indexed position of the YAML document that contains the object within the manifest file the object was loaded from. Note that YAML documents are separated by three dashes (`---`) and can each contain one object. When this annotation is not specified, a value of 0 is implied. + +This annotation is part of the Kubernetes Resource Model (KRM) Functions Specification, which is used by Kustomize and similar third-party tools. + +A KRM Function **should not** modify this annotation on input objects unless it is modifying the referenced files. A KRM Function **may** include this annotation on objects it generates. + ### kubernetes.io/arch Example: `kubernetes.io/arch: "amd64"` diff --git a/content/en/docs/setup/production-environment/tools/kubespray.md b/content/en/docs/setup/production-environment/tools/kubespray.md index f8adaaa4c02..72b106807e6 100644 --- a/content/en/docs/setup/production-environment/tools/kubespray.md +++ b/content/en/docs/setup/production-environment/tools/kubespray.md @@ -52,7 +52,7 @@ Kubespray provides the following utilities to help provision your environment: * [Terraform](https://www.terraform.io/) scripts for the following cloud providers: * [AWS](https://github.com/kubernetes-sigs/kubespray/tree/master/contrib/terraform/aws) * [OpenStack](https://github.com/kubernetes-sigs/kubespray/tree/master/contrib/terraform/openstack) - * [Equinix Metal](https://github.com/kubernetes-sigs/kubespray/tree/master/contrib/terraform/metal) + * [Equinix Metal](https://github.com/kubernetes-sigs/kubespray/tree/master/contrib/terraform/equinix) ### (2/5) Compose an inventory file diff --git a/content/fr/docs/getting-started-guides/_index.md b/content/fr/docs/getting-started-guides/_index.md deleted file mode 100644 index 316935fa075..00000000000 --- a/content/fr/docs/getting-started-guides/_index.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Solutions indépendantes -weight: 50 ---- diff --git a/content/fr/docs/getting-started-guides/fedora/_index.md b/content/fr/docs/getting-started-guides/fedora/_index.md deleted file mode 100644 index 3ef192901bc..00000000000 --- a/content/fr/docs/getting-started-guides/fedora/_index.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Serveurs physiques -weight: 60 ---- diff --git a/content/hi/docs/reference/glossary/istio.md b/content/hi/docs/reference/glossary/istio.md index 0170abbe4d1..87fe3659176 100644 --- a/content/hi/docs/reference/glossary/istio.md +++ b/content/hi/docs/reference/glossary/istio.md @@ -2,7 +2,7 @@ title: Istio id: istio date: 2018-04-12 -full_link: https://istio.io/docs/concepts/what-is-istio/ +full_link: https://istio.io/latest/about/service-mesh/#what-is-istio short_description: > एक ओपन प्लैटफ़ॉर्म (कुबेरनेट्स-विशिष्ट नहीं) जो माइक्रोसर्विसेज को एकीकृत करने, ट्रैफ़िक प्रवाह को प्रबंधित करने, नीतियों को लागू करने और टेलीमेट्री डेटा को एकत्र करने का एक समान तरीका प्रदान करता हैं। aka: diff --git a/content/ja/docs/concepts/workloads/controllers/daemonset.md b/content/ja/docs/concepts/workloads/controllers/daemonset.md index 2aab0df7f22..68ada81e2eb 100644 --- a/content/ja/docs/concepts/workloads/controllers/daemonset.md +++ b/content/ja/docs/concepts/workloads/controllers/daemonset.md @@ -69,7 +69,7 @@ DaemonSet内のPodテンプレートでは、[`RestartPolicy`](/ja/docs/concepts 上記の2つが指定された場合は、2つの条件をANDでどちらも満たすものを結果として返します。 -もし`spec.selector`が指定されたとき、`.spec.template.metadata.labels`とマッチしなければなりません。この2つの値がマッチしない設定をした場合、APIによってリジェクトされます。 +`spec.selector`は`.spec.template.metadata.labels`とマッチしなければなりません。この2つの値がマッチしない設定をした場合、APIによってリジェクトされます。 ### 選択したNode上でPodを稼働させる {#running-pods-on-select-nodes} diff --git a/content/ja/docs/contribute/review/reviewing-prs.md b/content/ja/docs/contribute/review/reviewing-prs.md index 6659d463546..a77ce8930b1 100644 --- a/content/ja/docs/contribute/review/reviewing-prs.md +++ b/content/ja/docs/contribute/review/reviewing-prs.md @@ -22,22 +22,55 @@ weight: 10 レビューを始める前に、以下のことを心に留めてください。 -- [CNCFの行動規範](https://github.com/cncf/foundation/blob/master/code-of-conduct.md)を読み、いかなる時にも行動規範にしたがって行動するようにする。 +- [CNCFの行動規範](https://github.com/cncf/foundation/blob/main/code-of-conduct.md)を読み、いかなる時にも行動規範にしたがって行動するようにする。 - 礼儀正しく、思いやりを持ち、助け合う気持ちを持つ。 - 変更点だけでなく、PRのポジティブな側面についてもコメントする。 - 相手の気持ちに共感して、自分のレビューが相手にどのように受け取られるのかをよく意識する。 - 相手の善意を前提として、疑問点を明確にする質問をする。 -- 経験を積んだコントリビューターの場合、コンテンツに大幅な変更が必要な新規のコントリビューターとペアを組んで作業に取り組むことを考える。 +- 経験を積んだコントリビューターの場合、コンテンツに大幅な変更が必要な作業を行う新規のコントリビューターとペアを組んで取り組むことを考える。 ## レビューのプロセス -一般に、コンテンツや文体に対するプルリクエストは、英語でレビューを行います。 +一般に、コンテンツや文体に対するプルリクエストは、英語でレビューを行います。図1は、レビュープロセスについて手順の概要を示しています。 各ステップの詳細は次のとおりです。 + +**(訳注:SIG Docs jaでは、日本語でも対応しています。日本語の翻訳に対するレビューは、日本語でも構いません。ただし、プルリクエストの作成者や他のコントリビューターが必ずしも日本語を理解できるとは限りませんので、注意して発言してください。)** + + + + +{{< mermaid >}} +flowchart LR + subgraph fourth[レビューの開始] + direction TB + S[ ] -.- + M[コメントを追加] --> N[変更の確認] + N --> O[Commentを選択] + end + subgraph third[PRの選択] + direction TB + T[ ] -.- + J[説明とコメントを読む]--> K[Netlifyプレビューで
変更点を表示] + end + + A[オープン状態の
PR一覧を確認]--> B[オープン状態のPRを
ラベルで絞り込む] + B --> third --> fourth + + +classDef grey fill:#dddddd,stroke:#ffffff,stroke-width:px,color:#000000, font-size:15px; +classDef white fill:#ffffff,stroke:#000,stroke-width:px,color:#000,font-weight:bold +classDef spacewhite fill:#ffffff,stroke:#fff,stroke-width:0px,color:#000 +class A,B,J,K,M,N,O grey +class S,T spacewhite +class third,fourth white +{{}} + +図1. レビュープロセスの手順 1. [https://github.com/kubernetes/website/pulls](https://github.com/kubernetes/website/pulls)に移動します。Kubernetesのウェブサイトとドキュメントに対するopen状態のプルリクエスト一覧が表示されます。 2. open状態のPRに、以下に示すラベルを1つ以上使って絞り込みます。 - - `cncf-cla: yes` (推奨): CLAにサインしていないコントリビューターが提出したPRはマージできません。詳しい情報は、[CLAの署名](/docs/contribute/new-content/overview/#sign-the-cla)を読んでください。 + - `cncf-cla: yes` (推奨): CLAにサインしていないコントリビューターが提出したPRはマージできません。詳しい情報は、[CLAの署名](/docs/contribute/new-content/#sign-the-cla)を読んでください。 - `language/en` (推奨): 英語のPRだけに絞り込みます。 - `size/`: 特定の大きさのPRだけに絞り込みます。レビューを始めたばかりの人は、小さなPRから始めてください。 @@ -47,12 +80,17 @@ weight: 10 - PRの説明を読み、行われた変更について理解し、関連するissueがあればそれも読みます。 - 他のレビュアのコメントがあれば読みます。 - **Files changed**タブをクリックし、変更されたファイルと行を確認します。 - - **Conversation**タブの下にあるPRのbuild checkセクションまでスクロールし、**deploy/netlify**の行の**Details**リンクをクリックして、Netlifyのプレビュービルドで変更点をプレビューします。 + - **Conversation**タブの下にあるPRのbuild checkセクションまでスクロールし、Netlifyのプレビュービルドで変更点をプレビューします。これはスクリーンショットです(これは、GitHubのデスクトップサイトを見せています。タブレットやスマートフォンデバイスでレビューしている場合は、GitHubウェブのUIは少し異なります): + {{< figure src="/images/docs/github_netlify_deploy_preview.png" alt="GitHub pull request details including link to Netlify preview" >}} + プレビューを開くには、チェックリストの**deploy/netlify**行の**Details**リンクをクリックします。 4. **Files changed**タブに移動してレビューを始めます。 1. コメントしたい場合は行の横の`+`マークをクリックします。 2. その行に関するコメントを書き、**Add single comment**(1つのコメントだけを残したい場合)または**Start a review**(複数のコメントを行いたい場合)のいずれかをクリックします。 - 3. コメントをすべて書いたら、ページ上部の**Review changes**をクリックします。ここでは、レビューの要約を追加できます(コントリビューターにポジティブなコメントも書きましょう!)。必要に応じて、PRを承認したり、コメントしたり、変更をリクエストします。新しいコントリビューターの場合は**Comment**だけが行えます。 + 3. コメントをすべて書いたら、ページ上部の**Review changes**をクリックします。ここでは、レビューの要約を追加できます(コントリビューターにポジティブなコメントも書きましょう!)。常に「Comment」を使用してください。 + + - レビューの終了時、「Request changes」ボタンをクリックしないでください。さらに変更される前にマージされるのをブロックしたい場合、「/hold」コメントを残すことができます。Holdを設定する理由を説明し、必要に応じて、自分や他のレビューアがHoldを解除できる条件を指定してください。 + - レビューの終了時、「Approve」ボタンをクリックしないでください。大抵の場合、「/approve」コメントを残すことが推奨されます。 ## レビューのチェックリスト @@ -61,6 +99,9 @@ weight: 10 ### 言語と文法 - 言語や文法に明らかな間違いはないですか? もっとよい言い方はないですか? + - 作成者が変更している箇所の用語や文法に注目してください。作成者がページ全体の変更を目的として明確にしていない限り、そのページのすべての問題を修正する義務はありません。 + - 既存のページを変更するPRである場合、変更されている箇所に注目してレビューしてください。その変更されたコンテンツは、技術的および編集の正確性についてレビューしてください。PRの作成者が対処しようとしている内容と直接関係のない間違いを見つけた場合、それは別のIssueとして扱うべきです(既存のIssueが無いことを確認してください)。 + - コンテンツを*移動*するPull Requestに注意してください。作成者がページの名前を変更したり、2つのページを結合したりする場合、通常、私たち(Kubernetes SIG Docs)は、その移動されたコンテンツ内で見つけられるすべての文法やスペルの間違いを修正することを作成者に要求することを避けています。 - もっと簡単な単語に置き換えられる複雑な単語や古い単語はありませんか? - 使われている単語や専門用語や言い回しで差別的ではない別の言葉に置き換えられるものはありませんか? - 言葉選びや大文字の使い方は[style guide](/docs/contribute/style/style-guide/)に従っていますか? @@ -77,10 +118,16 @@ weight: 10 - PRはページ名、slug/alias、アンカーリンクの変更や削除をしていますか? その場合、このPRの変更の結果、リンク切れは発生しませんか? ページ名を変更してslugはそのままにするなど、他の選択肢はありませんか? - PRは新しいページを作成するものですか? その場合、次の点に注意してください。 - ページは正しい[page content type](/docs/contribute/style/page-content-types/)と関係するHugoのshortcodeを使用していますか? - - セクションの横のナビゲーション(または全体)にページは正しく表示されますか? + - セクションの横のナビゲーションにページは正しく表示されますか(または表示されませんか)? - ページは[Docs Home](/docs/home/)に一覧されますか? - Netlifyのプレビューで変更は確認できますか? 特にリスト、コードブロック、テーブル、備考、画像などに注意してください。 ### その他 -PRに関して誤字や空白などの小さな問題を指摘する場合は、コメントの前に`nit:`と書いてください。こうすることで、PRの作者は問題が深刻なものではないことが分かります。 +- [些細な編集](https://www.kubernetes.dev/docs/guide/pull-requests/#trivial-edits)に注意してください。些細な編集だと思われる変更を見つけた場合は、そのポリシーを指摘してください (それが本当に改善である場合は、変更を受け入れても問題ありません)。 +- 空白の修正を行っている作成者には、PRの最初のコミットでそれを行い、その後に他の変更を加えるよう促してください。これにより、マージとレビューの両方が容易になります。特に、大量の空白文字の整理と共に1回のコミットで発生する些細な変更に注意してください(もしそれを見つけたら、作成者に修正を促してください)。 + +レビュアーが誤字や不適切な空白など、PRの本質でない小さな問題を発見した場合は、コメントの先頭に`nit:`を付けてください。これにより、作成者はこのフィードバックが重要でないことを知ることができます。 + +Pull Requestの承認を検討する際、残りのすべてのフィードバックがnitとしてマークされていれば、残っていたとしてもPRをマージできます。その場合、残っているnitに関するIssueをオープンすると役立つことがよくあります。その新しいIssueを[Good First Issue](https://www.kubernetes.dev/docs/guide/help-wanted/#good-first-issue)としてマークするための条件を満たすことができるかどうか検討してください。それができたら、これらは良い情報源になります。 + diff --git a/content/ja/docs/reference/command-line-tools-reference/feature-gates.md b/content/ja/docs/reference/command-line-tools-reference/feature-gates.md index 5667cbee61b..436a80752da 100644 --- a/content/ja/docs/reference/command-line-tools-reference/feature-gates.md +++ b/content/ja/docs/reference/command-line-tools-reference/feature-gates.md @@ -49,6 +49,7 @@ content_type: concept | `AnyVolumeDataSource` | `false` | Alpha | 1.18 | 1.23 | | `AnyVolumeDataSource` | `true` | Beta | 1.24 | | | `AppArmor` | `true` | Beta | 1.4 | | +| `CheckpointContainer` | `false` | Alpha | 1.25 | | | `CPUManagerPolicyAlphaOptions` | `false` | Alpha | 1.23 | | | `CPUManagerPolicyBetaOptions` | `true` | Beta | 1.23 | | | `CPUManagerPolicyOptions` | `false` | Alpha | 1.22 | 1.22 | @@ -354,6 +355,7 @@ GAになってからさらなる変更を加えることは現実的ではない `APIPriorityAndFairness`: 各サーバーで優先順位付けと公平性を備えた要求の並行性を管理できるようにします(`RequestManagement`から名前が変更されました)。 - `APIResponseCompression`:`LIST`や`GET`リクエストのAPIレスポンスを圧縮します。 - `AppArmor`: Dockerを使用する場合にLinuxノードでAppArmorによる強制アクセスコントロールを有効にします。詳細は[AppArmorチュートリアル](/ja/docs/tutorials/clusters/apparmor/)で確認できます。 +- `ContainerCheckpoint`: kubeletチェックポイントAPIを有効にします。詳細は[KubeletチェックポイントAPI](/ja/docs/reference/node/kubelet-checkpoint-api/)で確認できます。 - `AttachVolumeLimit`: ボリュームプラグインを有効にすることでノードにアタッチできるボリューム数の制限を設定できます。 - `BalanceAttachedNodeVolumes`: スケジューリング中にバランスのとれたリソース割り当てを考慮するノードのボリュームカウントを含めます。判断を行う際に、CPU、メモリー使用率、およびボリュームカウントが近いノードがスケジューラーによって優先されます。 - `BlockVolume`: PodでRawブロックデバイスの定義と使用を有効にします。詳細は[Rawブロックボリュームのサポート](/docs/concepts/storage/persistent-volumes/#raw-block-volume-support)で確認できます。 diff --git a/content/ja/docs/reference/glossary/service-catalog.md b/content/ja/docs/reference/glossary/service-catalog.md index b05d1528d87..1893564bf13 100644 --- a/content/ja/docs/reference/glossary/service-catalog.md +++ b/content/ja/docs/reference/glossary/service-catalog.md @@ -4,13 +4,13 @@ id: service-catalog date: 2018-04-12 full_link: short_description: > - Kubernetesクラスターで稼働するアプリケーションが、クラウドプロバイダーによって提供されるデータストアサービスのように、外部のマネージドソフトウェアを容易に使えるようにするための拡張APIです。 + Kubernetesクラスターで稼働するアプリケーションが、クラウドプロバイダーによって提供されるデータストアサービスのように、外部のマネージドソフトウェアを容易に使えるようにするための古い拡張APIです。 aka: tags: - extension --- - Kubernetesクラスターで稼働するアプリケーションが、クラウドプロバイダーによって提供されるデータストアサービスのように、外部のマネージドソフトウェアを容易に使えるようにするための拡張APIです。 + Kubernetesクラスターで稼働するアプリケーションが、クラウドプロバイダーによって提供されるデータストアサービスのように、外部のマネージドソフトウェアを容易に使えるようにするための古い拡張APIです。 -サービスカタログを使用することで、提供されている{{< glossary_tooltip text="マネージドサービス" term_id="managed-service" >}}を、それらのサービスがどのように作成されるか、また管理されるかについての知識を無しに、一覧表示したり、プロビジョニングや使用をすることができます。 +サービスカタログを使用することで、提供されている{{< glossary_tooltip text="マネージドサービス" term_id="managed-service" >}}を、それらのサービスがどのように作成されるか、また管理されるかについての知識無しに、一覧表示したり、プロビジョニングやバインドが可能でした。 \ No newline at end of file diff --git a/content/ja/docs/reference/kubectl/_index.md b/content/ja/docs/reference/kubectl/_index.md index d48f0aba583..255a6131aba 100644 --- a/content/ja/docs/reference/kubectl/_index.md +++ b/content/ja/docs/reference/kubectl/_index.md @@ -66,6 +66,32 @@ kubectl [command] [TYPE] [NAME] [flags] ヘルプが必要な場合は、ターミナルウィンドウから`kubectl help`を実行してください。 +## クラスター内認証と名前空間のオーバーライド {#in-cluster-authentication-and-namespace-overrides} + +デフォルトでは、`kubectl`は最初にPod内で動作しているか、つまりクラスター内で動作しているかどうかを判断します。まず、`KUBERNETES_SERVICE_HOST`と`KUBERNETES_SERVICE_PORT`の環境変数を確認し、サービスアカウントのトークンファイルが`/var/run/secrets/kubernetes.io/serviceaccount/token`に存在するかどうかを確認します。3つともクラスター内で見つかった場合、クラスター内認証とみなされます。 + +後方互換性を保つため、クラスター内認証時に`POD_NAMESPACE`環境変数が設定されている場合には、サービスアカウントトークンのデフォルトの名前空間が上書きされます。名前空間のデフォルトに依存しているすべてのマニフェストやツールは、この影響を受けます。 + +**`POD_NAMESPACE`環境変数** + +`POD_NAMESPACE`環境変数が設定されている場合、名前空間に属するリソースのCLI操作は、デフォルトで環境変数の値になります。例えば、変数に`seattle`が設定されている場合、`kubectl get pods`は、`seattle`名前空間のPodを返します。これは、Podが名前空間に属するリソースであり、コマンドで名前空間が指定されていないためです。`kubectl api-resources`の出力を見て、リソースが名前空間に属するかどうかを判断してください。 + +明示的に`--namespace `を使用すると、この動作は上書きされます。 + +**kubectlによるServiceAccountトークンの処理方法** + +以下の条件がすべて成立した場合、 +* `/var/run/secrets/kubernetes.io/serviceaccount/token`にマウントされたKubernetesサービスアカウントのトークンファイルがある +* `KUBERNETES_SERVICE_HOST`環境変数が設定されている +* `KUBERNETES_SERVICE_PORT`環境変数が設定されている +* kubectlコマンドラインで名前空間を明示的に指定しない + +kubectlはクラスター内で実行されているとみなして、そのServiceAccountの名前空間(これはPodの名前空間と同じです)を検索し、その名前空間に対して機能します。これは、クラスターの外の動作とは異なります。kubectlがクラスターの外で実行され、名前空間を指定しない場合、kubectlコマンドは、クライアント構成の現在のコンテキストに設定されている名前空間に対して動作します。kubectlのデフォルトの名前空間を変更するには、次のコマンドを使用できます。 + +```shell +kubectl config set-context --current --namespace= +``` + ## 操作 以下の表に、`kubectl`のすべての操作の簡単な説明と一般的な構文を示します。 @@ -93,6 +119,7 @@ kubectl [command] [TYPE] [NAME] [flags] `diff` | `kubectl diff -f FILENAME [flags]`| ファイルまたは標準出力と、現在の設定との差分を表示します。 `drain` | `kubectl drain NODE [options]` | メンテナンスの準備のためにNodeをdrainします。 `edit` | kubectl edit (-f FILENAME | TYPE NAME | TYPE/NAME) [flags] | デファルトのエディタを使い、サーバー上の1つ以上のリソースリソースの定義を編集し、更新します。 +`events` | `kubectl events` | イベントを一覧表示します。 `exec` | `kubectl exec POD [-c CONTAINER] [-i] [-t] [flags] [-- COMMAND [args...]]` | Pod内のコンテナに対して、コマンドを実行します。 `explain` | `kubectl explain [--recursive=false] [flags]` | 様々なリソースのドキュメントを取得します。例えば、Pod、Node、Serviceなどです。 `expose` | kubectl expose (-f FILENAME | TYPE NAME | TYPE/NAME) [--port=port] [--protocol=TCP|UDP] [--target-port=number-or-name] [--name=name] [--external-ip=external-ip-of-service] [--type=type] [flags] | ReplicationController、Service、Podを、新しいKubernetesサービスとして公開します。 @@ -122,59 +149,66 @@ kubectl [command] [TYPE] [NAME] [flags] 以下の表に、サポートされているすべてのリソースと、省略されたエイリアスの一覧を示します。 -(この出力は`kubectl api-resources`から取得でき、Kubernetes 1.13.3時点で正確でした。) +(この出力は`kubectl api-resources`から取得でき、Kubernetes 1.25.0時点で正確でした。) -| リソース名 | 短縮名 | APIグループ | 名前空間に属するか | リソースの種類 | +| リソース名 | 短縮名 | APIバージョン | 名前空間に属するか | リソースの種類 | |---|---|---|---|---| -| `bindings` | | | true | Binding| -| `componentstatuses` | `cs` | | false | ComponentStatus | -| `configmaps` | `cm` | | true | ConfigMap | -| `endpoints` | `ep` | | true | Endpoints | -| `limitranges` | `limits` | | true | LimitRange | -| `namespaces` | `ns` | | false | Namespace | -| `nodes` | `no` | | false | Node | -| `persistentvolumeclaims` | `pvc` | | true | PersistentVolumeClaim | -| `persistentvolumes` | `pv` | | false | PersistentVolume | -| `pods` | `po` | | true | Pod | -| `podtemplates` | | | true | PodTemplate | -| `replicationcontrollers` | `rc` | | true| ReplicationController | -| `resourcequotas` | `quota` | | true | ResourceQuota | -| `secrets` | | | true | Secret | -| `serviceaccounts` | `sa` | | true | ServiceAccount | -| `services` | `svc` | | true | Service | -| `mutatingwebhookconfigurations` | | admissionregistration.k8s.io | false | MutatingWebhookConfiguration | -| `validatingwebhookconfigurations` | | admissionregistration.k8s.io | false | ValidatingWebhookConfiguration | -| `customresourcedefinitions` | `crd`, `crds` | apiextensions.k8s.io | false | CustomResourceDefinition | -| `apiservices` | | apiregistration.k8s.io | false | APIService | -| `controllerrevisions` | | apps | true | ControllerRevision | -| `daemonsets` | `ds` | apps | true | DaemonSet | -| `deployments` | `deploy` | apps | true | Deployment | -| `replicasets` | `rs` | apps | true | ReplicaSet | -| `statefulsets` | `sts` | apps | true | StatefulSet | -| `tokenreviews` | | authentication.k8s.io | false | TokenReview | -| `localsubjectaccessreviews` | | authorization.k8s.io | true | LocalSubjectAccessReview | -| `selfsubjectaccessreviews` | | authorization.k8s.io | false | SelfSubjectAccessReview | -| `selfsubjectrulesreviews` | | authorization.k8s.io | false | SelfSubjectRulesReview | -| `subjectaccessreviews` | | authorization.k8s.io | false | SubjectAccessReview | -| `horizontalpodautoscalers` | `hpa` | autoscaling | true | HorizontalPodAutoscaler | -| `cronjobs` | `cj` | batch | true | CronJob | -| `jobs` | | batch | true | Job | -| `certificatesigningrequests` | `csr` | certificates.k8s.io | false | CertificateSigningRequest | -| `leases` | | coordination.k8s.io | true | Lease | -| `events` | `ev` | events.k8s.io | true | Event | -| `ingresses` | `ing` | extensions | true | Ingress | -| `networkpolicies` | `netpol` | networking.k8s.io | true | NetworkPolicy | -| `poddisruptionbudgets` | `pdb` | policy | true | PodDisruptionBudget | -| `podsecuritypolicies` | `psp` | policy | false | PodSecurityPolicy | -| `clusterrolebindings` | | rbac.authorization.k8s.io | false | ClusterRoleBinding | -| `clusterroles` | | rbac.authorization.k8s.io | false | ClusterRole | -| `rolebindings` | | rbac.authorization.k8s.io | true | RoleBinding | -| `roles` | | rbac.authorization.k8s.io | true | Role | -| `priorityclasses` | `pc` | scheduling.k8s.io | false | PriorityClass | -| `csidrivers` | | storage.k8s.io | false | CSIDriver | -| `csinodes` | | storage.k8s.io | false | CSINode | -| `storageclasses` | `sc` | storage.k8s.io | false | StorageClass | -| `volumeattachments` | | storage.k8s.io | false | VolumeAttachment | +| `bindings` | | v1 | true | Binding | +| `componentstatuses` | `cs` | v1 | false | ComponentStatus | +| `configmaps` | `cm` | v1 | true | ConfigMap | +| `endpoints` | `ep` | v1 | true | Endpoints | +| `events` | `ev` | v1 | true | Event | +| `limitranges` | `limits` | v1 | true | LimitRange | +| `namespaces` | `ns` | v1 | false | Namespace | +| `nodes` | `no` | v1 | false | Node | +| `persistentvolumeclaims` | `pvc` | v1 | true | PersistentVolumeClaim | +| `persistentvolumes` | `pv` | v1 | false | PersistentVolume | +| `pods` | `po` | v1 | true | Pod | +| `podtemplates` | | v1 | true | PodTemplate | +| `replicationcontrollers` | `rc` | v1 | true | ReplicationController | +| `resourcequotas` | `quota` | v1 | true | ResourceQuota | +| `secrets` | | v1 | true | Secret | +| `serviceaccounts` | `sa` | v1 | true | ServiceAccount | +| `services` | `svc` | v1 | true | Service | +| `mutatingwebhookconfigurations` | | admissionregistration.k8s.io/v1 | false | MutatingWebhookConfiguration | +| `validatingwebhookconfigurations` | | admissionregistration.k8s.io/v1 | false | ValidatingWebhookConfiguration | +| `customresourcedefinitions` | `crd,crds` | apiextensions.k8s.io/v1 | false | CustomResourceDefinition | +| `apiservices` | | apiregistration.k8s.io/v1 | false | APIService | +| `controllerrevisions` | | apps/v1 | true | ControllerRevision | +| `daemonsets` | `ds` | apps/v1 | true | DaemonSet | +| `deployments` | `deploy` | apps/v1 | true | Deployment | +| `replicasets` | `rs` | apps/v1 | true | ReplicaSet | +| `statefulsets` | `sts` | apps/v1 | true | StatefulSet | +| `tokenreviews` | | authentication.k8s.io/v1 | false | TokenReview | +| `localsubjectaccessreviews` | | authorization.k8s.io/v1 | true | LocalSubjectAccessReview | +| `selfsubjectaccessreviews` | | authorization.k8s.io/v1 | false | SelfSubjectAccessReview | +| `selfsubjectrulesreviews` | | authorization.k8s.io/v1 | false | SelfSubjectRulesReview | +| `subjectaccessreviews` | | authorization.k8s.io/v1 | false | SubjectAccessReview | +| `horizontalpodautoscalers` | `hpa` | autoscaling/v2 | true | HorizontalPodAutoscaler | +| `cronjobs` | `cj` | batch/v1 | true | CronJob | +| `jobs` | | batch/v1 | true | Job | +| `certificatesigningrequests` | `csr` | certificates.k8s.io/v1 | false | CertificateSigningRequest | +| `leases` | | coordination.k8s.io/v1 | true | Lease | +| `endpointslices` | | discovery.k8s.io/v1 | true | EndpointSlice | +| `events` | `ev` | events.k8s.io/v1 | true | Event | +| `flowschemas` | | flowcontrol.apiserver.k8s.io/v1beta2 | false | FlowSchema | +| `prioritylevelconfigurations` | | flowcontrol.apiserver.k8s.io/v1beta2 | false | PriorityLevelConfiguration | +| `ingressclasses` | | networking.k8s.io/v1 | false | IngressClass | +| `ingresses` | `ing` | networking.k8s.io/v1 | true | Ingress | +| `networkpolicies` | `netpol` | networking.k8s.io/v1 | true | NetworkPolicy | +| `runtimeclasses` | | node.k8s.io/v1 | false | RuntimeClass | +| `poddisruptionbudgets` | `pdb` | policy/v1 | true | PodDisruptionBudget | +| `podsecuritypolicies` | `psp` | policy/v1beta1 | false | PodSecurityPolicy | +| `clusterrolebindings` | | rbac.authorization.k8s.io/v1 | false | ClusterRoleBinding | +| `clusterroles` | | rbac.authorization.k8s.io/v1 | false | ClusterRole | +| `rolebindings` | | rbac.authorization.k8s.io/v1 | true | RoleBinding | +| `roles` | | rbac.authorization.k8s.io/v1 | true | Role | +| `priorityclasses` | `pc` | scheduling.k8s.io/v1 | false | PriorityClass | +| `csidrivers` | | storage.k8s.io/v1 | false | CSIDriver | +| `csinodes` | | storage.k8s.io/v1 | false | CSINode | +| `csistoragecapacities` | | storage.k8s.io/v1 | true | CSIStorageCapacity | +| `storageclasses` | `sc` | storage.k8s.io/v1 | false | StorageClass | +| `volumeattachments` | | storage.k8s.io/v1 | false | VolumeAttachment | ## 出力オプション diff --git a/content/ja/docs/reference/node/kubelet-checkpoint-api.md b/content/ja/docs/reference/node/kubelet-checkpoint-api.md new file mode 100644 index 00000000000..085b223f3ce --- /dev/null +++ b/content/ja/docs/reference/node/kubelet-checkpoint-api.md @@ -0,0 +1,82 @@ +--- +content_type: "reference" +title: KubeletチェックポイントAPI +weight: 10 +--- + +{{< feature-state for_k8s_version="v1.25" state="alpha" >}} + +コンテナのチェックポイントは実行中のコンテナのステートフルコピーを作成するための機能です。 +コンテナのステートフルコピーがあると、デバックや類似の目的のために別のコンピューターに移動させることができます。 + +チェックポイントコンテナデータを復元可能なコンピューターに移動させる場合、その復元したコンテナは、チェックポイントが作成された正確に同じ地点で実行が再開されます。 +保存したデータを検査することも可能です。 +ただし、検査を行うための適したツールを保持している必要があります。 + +コンテナのチェックポイントを作成することで、セキュリティ影響が発生する場合があります。 +通常、チェックポイントはチェックポイントされたコンテナ内のすべてのプロセスのすべてのメモリーページを含んでいます。 +メモリー内で使用された全てがローカルディスク上で利用できるようになることを意味しています。 +これはすべてのプライベートデータを含んでおり、もしかしたら暗号化に使用した鍵も含まれているかもしれません。 +基礎となるCRI実装(そのノード上のコンテナランタイム)は、`root`ユーザーのみがアクセス可能なチェックポイントアーカイブを作成するべきです。 +チェックポイントアーカイブが他のシステムに転送された場合、全てのメモリーページがチェックポイントアーカイブのオーナーによって読み取れるようになることを覚えておくことが重要です。 + +## 操作方法 {#operations} + +### `post` 指定したコンテナのチェックポイント {#post-checkpoint} + +指定したPodから指定したコンテナのチェックポイントを作成するようにkubeletに指示します。 + +kubeletチェックポイントインターフェイスへのアクセスの制御方法についての詳細な情報は、[Kubelet authentication/authorization reference](/docs/reference/access-authn-authz/kubelet-authn-authz)を参照してください。 + +kubeletは基礎となる{{}}実装にチェックポイントをリクエストします。 +チェックポイントリクエストでは、kubeletが`checkpoint---.tar`のようなチェックポイントアーカイブの名前を指定します。 +併せて、(`--root-dir`で定義される)rootディレクトリ配下の`checkpoints`ディレクトリに、チェックポイントアーカイブを保存することをリクエストします。 +デフォルトは`/var/lib/kubelet/checkpoints`です。 + +チェックポイントアーカイブは _tar_ フォーマットであり、[`tar`](https://pubs.opengroup.org/onlinepubs/7908799/xcu/tar.html)の実装を使用して一覧表示できます。 +アーカイブの内容は、基礎となるCRI実装(ノード上のコンテナランタイム)に依存します。 + +#### HTTPリクエスト {#post-checkpoint-request} + +POST /checkpoint/{namespace}/{pod}/{container} + +#### パラメーター {#post-checkpoint-params} + +- **namespace** (*パス内*): string, 必須項目 + + {{< glossary_tooltip term_id="namespace" >}} + +- **pod** (*パス内*): string, 必須項目 + + {{< glossary_tooltip term_id="pod" >}} + +- **container** (*パス内*): string, 必須項目 + + {{< glossary_tooltip term_id="container" >}} + +- **timeout** (*クエリ内*): integer + + チェックポイントの作成が終了するまで待機する秒単位のタイムアウト。 + ゼロまたはタイムアウトが指定されていない場合、デフォルトは{{}}タイムアウトの値が使用されます。 + チェックポイント作成時間はコンテナの使用メモリーに直接依存します。 + コンテナの使用メモリーが多いほど、対応するチェックポイントを作成するために必要な時間が長くなります。 + +#### レスポンス {#post-checkpoint-response} + +200: OK + +401: Unauthorized + +404: Not Found (`ContainerCheckpoint`フィーチャーゲートが無効の場合) + +404: Not Found (指定した`namespace`や`pod`、`container`が見つからない場合) + +500: Internal Server Error (CRI実装でチェックポイント中にエラーが発生した場合(詳細はエラーメッセージを参照)) + +500: Internal Server Error (CRI実装がチェックポイントCRI APIを実装していない場合(詳細はエラーメッセージを参照)) + +{{< comment >}} +TODO: CRI実装がチェックポイントや復元の機能を持つ場合のリターンコードについてさらなる情報を追加すること。 + このTODOは、CRI実装が新しいContainerCheckpoint CRI APIコールを実装するために、Kubernetesの変更をマージすることを必要とするため、リリース前には修正できません。 + これを修正するためには1.25リリースの後を待つ必要があります。 +{{< /comment >}} diff --git a/content/ja/docs/tasks/service-catalog/_index.md b/content/ja/docs/tasks/service-catalog/_index.md deleted file mode 100644 index a7d91e4ea7a..00000000000 --- a/content/ja/docs/tasks/service-catalog/_index.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: "サービスカタログ" -description: サービスカタログ拡張APIをインストールする -weight: 150 ---- - diff --git a/content/ja/docs/tasks/service-catalog/install-service-catalog-using-helm.md b/content/ja/docs/tasks/service-catalog/install-service-catalog-using-helm.md deleted file mode 100644 index ff894fba291..00000000000 --- a/content/ja/docs/tasks/service-catalog/install-service-catalog-using-helm.md +++ /dev/null @@ -1,118 +0,0 @@ ---- -title: Helmを使用したサービスカタログのインストール -content_type: task ---- - - -{{< glossary_definition term_id="service-catalog" length="all" prepend="サービスカタログは" >}} - -[Helm](https://helm.sh/)を使用してKubernetesクラスターにサービスカタログをインストールします。手順の最新情報は[kubernetes-sigs/service-catalog](https://github.com/kubernetes-sigs/service-catalog/blob/master/docs/install.md)リポジトリーを参照してください。 - - - - -## {{% heading "prerequisites" %}} - -* [サービスカタログ](/docs/concepts/extend-kubernetes/service-catalog/)の基本概念を理解してください。 -* サービスカタログを使用するには、Kubernetesクラスターのバージョンが1.7以降である必要があります。 -* KubernetesクラスターのクラスターDNSを有効化する必要があります。 - * クラウド上のKubernetesクラスター、または{{< glossary_tooltip text="Minikube" term_id="minikube" >}}を使用している場合、クラスターDNSはすでに有効化されています。 - * `hack/local-up-cluster.sh`を使用している場合は、環境変数`KUBE_ENABLE_CLUSTER_DNS`が設定されていることを確認し、インストールスクリプトを実行してください。 -* [kubectlのインストールおよびセットアップ](/ja/docs/tasks/tools/install-kubectl/)を参考に、v1.7以降のkubectlをインストールし、設定を行ってください。 -* v2.7.0以降の[Helm](https://helm.sh/)をインストールしてください。 - * [Helm install instructions](https://helm.sh/docs/intro/install/)を参考にしてください。 - * 上記のバージョンのHelmをすでにインストールしている場合は、`helm init`を実行し、HelmのサーバーサイドコンポーネントであるTillerをインストールしてください。 - - - - - -## Helmリポジトリーにサービスカタログを追加 - -Helmをインストールし、以下のコマンドを実行することでローカルマシンに*service-catalog*のHelmリポジトリーを追加します。 - - -```shell -helm repo add svc-cat https://kubernetes-sigs.github.io/service-catalog -``` - -以下のコマンドを実行し、インストールに成功していることを確認します。 - -```shell -helm search service-catalog -``` - -インストールが成功していれば、出力は以下のようになります: - -``` -NAME CHART VERSION APP VERSION DESCRIPTION -svc-cat/catalog 0.2.1 service-catalog API server and controller-manager helm chart -svc-cat/catalog-v0.2 0.2.2 service-catalog API server and controller-manager helm chart -``` - -## RBACの有効化 - -KubernetesクラスターのRBACを有効化することで、Tiller Podに`cluster-admin`アクセスを持たせます。 - -v0.25以前のMinikubeを使用している場合は、明示的にRBACを有効化して起動する必要があります: - -```shell -minikube start --extra-config=apiserver.Authorization.Mode=RBAC -``` - -v0.26以降のMinikubeを使用している場合は、以下のコマンドを実行してください。 - -```shell -minikube start -``` - -v0.26以降のMinikubeを使用している場合、`--extra-config`を指定しないでください。 -このフラグは--extra-config=apiserver.authorization-modeを指定するものに変更されており、現在MinikubeではデフォルトでRBACが有効化されています。 -古いフラグを指定すると、スタートコマンドが応答しなくなることがあります。 - -`hack/local-up-cluster.sh`を使用している場合、環境変数`AUTHORIZATION_MODE`を以下の値に設定してください: - -``` -AUTHORIZATION_MODE=Node,RBAC hack/local-up-cluster.sh -O -``` - -`helm init`は、デフォルトで`kube-system`のnamespaceにTiller Podをインストールし、Tillerは`default`のServiceAccountを使用するように設定されています。 - -{{< note >}} -`helm init`を実行する際に`--tiller-namespace`または`--service-account`のフラグを使用する場合、以下のコマンドの`--serviceaccount`フラグには適切なnamespaceとServiceAccountを指定する必要があります。 -{{< /note >}} - -Tillerに`cluster-admin`アクセスを設定する場合: - -```shell -kubectl create clusterrolebinding tiller-cluster-admin \ - --clusterrole=cluster-admin \ - --serviceaccount=kube-system:default -``` - - -## Kubernetesクラスターにサービスカタログをインストール - -以下のコマンドを使用して、Helmリポジトリーのrootからサービスカタログをインストールします: - -{{< tabs name="helm-versions" >}} -{{% tab name="Helm バージョン3" %}} -```shell -helm install catalog svc-cat/catalog --namespace catalog -``` -{{% /tab %}} -{{% tab name="Helm バージョン2" %}} -```shell -helm install svc-cat/catalog --name catalog --namespace catalog -``` -{{% /tab %}} -{{< /tabs >}} - - - -## {{% heading "whatsnext" %}} - -* [sample service brokers](https://github.com/openservicebrokerapi/servicebroker/blob/master/gettingStarted.md#sample-service-brokers) -* [kubernetes-sigs/service-catalog](https://github.com/kubernetes-sigs/service-catalog) - - diff --git a/content/ja/docs/tasks/service-catalog/install-service-catalog-using-sc.md b/content/ja/docs/tasks/service-catalog/install-service-catalog-using-sc.md deleted file mode 100644 index 86b4e589e6c..00000000000 --- a/content/ja/docs/tasks/service-catalog/install-service-catalog-using-sc.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: SCを使用したサービスカタログのインストール -content_type: task ---- - - -{{< glossary_definition term_id="service-catalog" length="all" prepend="サービスカタログは" >}} - -GCPの[Service Catalog Installer](https://github.com/GoogleCloudPlatform/k8s-service-catalog#installation)ツールを使うと、Kubernetesクラスター上にサービスカタログを簡単にインストール・アンインストールして、Google Cloudのプロジェクトに紐付けることもできます。 - -サービスカタログ自体は、Google Cloudだけではなく、どのような種類のマネージドサービスでも動作します。 - -## {{% heading "prerequisites" %}} - -* [サービスカタログ](/docs/concepts/extend-kubernetes/service-catalog/)の基本概念を理解してください。 -* [Go 1.6+](https://golang.org/dl/)をインストールして、`GOPATH`を設定してください。 -* SSLに関するファイルを生成するために必要な[cfssl](https://github.com/cloudflare/cfssl)ツールをインストールしてください。 -* サービスカタログを使用するには、Kubernetesクラスターのバージョンが1.7以降である必要があります。 -* [kubectlのインストールおよびセットアップ](/ja/docs/tasks/tools/install-kubectl/)を参考に、v1.7以降のkubectlをインストールし、設定を行ってください。 -* サービスカタログをインストールするためには、kubectlのユーザーが*cluster-admin*ロールにバインドされている必要があります。正しくバインドされていることを確認するには、次のコマンドを実行します。 - - kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user= - - -## ローカル環境に`sc`をインストールする - -インストーラーは、ローカルのコンピューター上で`sc`と呼ばれるCLIツールとして実行します。 - -`go get`を使用してインストールします。 - -```shell -go get github.com/GoogleCloudPlatform/k8s-service-catalog/installer/cmd/sc -``` - -これで、`sc`が`GOPATH/bin`ディレクトリー内にインストールされたはずです。 - -## Kubernetesクラスターにサービスカタログをインストールする - -まず、すべての依存関係がインストールされていることを確認します。次のコマンドを実行してください。 - -```shell -sc check -``` - -チェックが成功したら、次のように表示されるはずです。 - -``` -Dependency check passed. You are good to go. -``` - -次に、バックアップに使用したい`storageclass`を指定して、installコマンドを実行します。 - -```shell -sc install --etcd-backup-storageclass "standard" -``` - -## サービスカタログのアンインストール - -Kubernetesクラスターからサービスカタログをアンインストールしたい場合は、`sc`ツールを使って次のコマンドを実行します。 - -```shell -sc uninstall -``` - -## {{% heading "whatsnext" %}} - -* [サービスブローカーのサンプル](https://github.com/openservicebrokerapi/servicebroker/blob/master/gettingStarted.md#sample-service-brokers)を読む。 -* [kubernetes-incubator/service-catalog](https://github.com/kubernetes-incubator/service-catalog)プロジェクトを探索する。 diff --git a/content/pt-br/docs/tasks/configure-pod-container/extended-resource.md b/content/pt-br/docs/tasks/configure-pod-container/extended-resource.md new file mode 100644 index 00000000000..ed376306bfa --- /dev/null +++ b/content/pt-br/docs/tasks/configure-pod-container/extended-resource.md @@ -0,0 +1,139 @@ +--- +title: Atribuindo Recursos Estendidos a um Contêiner +content_type: task +weight: 40 +--- + + + +{{< feature-state state="stable" >}} + +Esta página mostra como atribuir recursos estendidos a um Contêiner. + + +## {{% heading "prerequisites" %}} + + +{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} + +Antes de fazer este exercício, faça o exercício em +[Anunciar recursos estendidos para um Nó](/docs/tasks/administer-cluster/extended-resource-node/). +Isso configurará um de seus nós para anunciar um recurso de *dongle*. + + + +## Atribua um recurso estendido a um Pod + +Para solicitar um recurso estendido, inclua o campo `resources:requests` no seu +manifesto do contêiner. Recursos estendidos são totalmente qualificados +com qualquer domínio fora do `*.kubernetes.io/`. Nomes de recursos estendidos válidos +tem a forma de `example.com/foo`, onde `example.com` é substituído pelo domínio +da sua organização e `foo` é um nome descritivo de recurso. + +Aqui está o arquivo de configuração para um pod que possui um contêiner: + +{{< codenew file="pods/resource/extended-resource-pod.yaml" >}} + +No arquivo de configuração, você pode ver que o contêiner solicita 3 *dongles*. + +Crie um Pod: + +```shell +kubectl apply -f https://k8s.io/examples/pods/resource/extended-resource-pod.yaml +``` + +Verifique se o pod está em execução: + +```shell +kubectl get pod extended-resource-demo +``` + +Descreva o pod: + +```shell +kubectl describe pod extended-resource-demo +``` + +A saída mostra as solicitações de *dongle*: + +```yaml +Limits: + example.com/dongle: 3 +Requests: + example.com/dongle: 3 +``` + +## Tente criar um segundo Pod + +Aqui está o arquivo de configuração para um pod que possui um contêiner. +O contêiner solicita dois *dongles*. + +{{< codenew file="pods/resource/extended-resource-pod-2.yaml" >}} + +O Kubernetes não poderá satisfazer o pedido de dois *dongles*, porque o primeiro pod +usou três dos quatro *dongles* disponíveis. + +Tente criar um pod: + +```shell +kubectl apply -f https://k8s.io/examples/pods/resource/extended-resource-pod-2.yaml +``` + +Descreva o pod: + +```shell +kubectl describe pod extended-resource-demo-2 +``` + +A saída mostra que o pod não pode ser agendado, porque não há nó que tenha +2 *dongles* disponíveis: + +``` +Conditions: + Type Status + PodScheduled False +... +Events: + ... + ... Warning FailedScheduling pod (extended-resource-demo-2) failed to fit in any node +fit failure summary on nodes : Insufficient example.com/dongle (1) +``` + +Veja o status do pod: + +```shell +kubectl get pod extended-resource-demo-2 +``` + +A saída mostra que o Pod foi criado, mas não está programado para ser executado em um nó. +Tem um status de pendente: + +```yaml +NAME READY STATUS RESTARTS AGE +extended-resource-demo-2 0/1 Pending 0 6m +``` + +## Limpeza + +Exclua os Pods que você criou para este exercício: + +```shell +kubectl delete pod extended-resource-demo +kubectl delete pod extended-resource-demo-2 +``` + + + +## {{% heading "whatsnext" %}} + + +### Para desenvolvedores de aplicativos + +* [Atribuir recursos de memória a contêineres e Pods](/docs/tasks/configure-pod-container/assign-memory-resource/) +* [Atribuir recursos de CPU a contêineres e Pods](/docs/tasks/configure-pod-container/assign-cpu-resource/) + +### Para administradores de cluster + +* [Anunciar recursos estendidos para um nó](/docs/tasks/administer-cluster/extended-resource-node/) + + diff --git a/content/pt-br/examples/pods/resource/extended-resource-pod-2.yaml b/content/pt-br/examples/pods/resource/extended-resource-pod-2.yaml new file mode 100644 index 00000000000..9c15d9ec864 --- /dev/null +++ b/content/pt-br/examples/pods/resource/extended-resource-pod-2.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Pod +metadata: + name: extended-resource-demo-2 +spec: + containers: + - name: extended-resource-demo-2-ctr + image: nginx + resources: + requests: + example.com/dongle: 2 + limits: + example.com/dongle: 2 diff --git a/content/pt-br/examples/pods/resource/extended-resource-pod.yaml b/content/pt-br/examples/pods/resource/extended-resource-pod.yaml new file mode 100644 index 00000000000..4fb3de740e0 --- /dev/null +++ b/content/pt-br/examples/pods/resource/extended-resource-pod.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Pod +metadata: + name: extended-resource-demo +spec: + containers: + - name: extended-resource-demo-ctr + image: nginx + resources: + requests: + example.com/dongle: 3 + limits: + example.com/dongle: 3 diff --git a/content/zh-cn/blog/_posts/2015-04-00-Borg-Predecessor-To-Kubernetes.md b/content/zh-cn/blog/_posts/2015-04-00-Borg-Predecessor-To-Kubernetes.md index 9f766237f3f..876152bc893 100644 --- a/content/zh-cn/blog/_posts/2015-04-00-Borg-Predecessor-To-Kubernetes.md +++ b/content/zh-cn/blog/_posts/2015-04-00-Borg-Predecessor-To-Kubernetes.md @@ -14,12 +14,11 @@ url: /blog/2015/04/Borg-Predecessor-To-Kubernetes Google has been running containerized workloads in production for more than a decade. Whether it's service jobs like web front-ends and stateful servers, infrastructure systems like [Bigtable](http://research.google.com/archive/bigtable.html) and [Spanner](http://research.google.com/archive/spanner.html), or batch frameworks like [MapReduce](http://research.google.com/archive/mapreduce.html) and [Millwheel](http://research.google.com/pubs/pub41378.html), virtually everything at Google runs as a container. Today, we took the wraps off of Borg, Google’s long-rumored internal container-oriented cluster-management system, publishing details at the academic computer systems conference [Eurosys](http://eurosys2015.labri.fr/). You can find the paper [here](https://research.google.com/pubs/pub43438.html). --> 十多年来,谷歌一直在生产中运行容器化工作负载。 -无论是像网络前端和有状态服务器之类的工作,像 [Bigtable](http://research.google.com/archive/bigtable.html) 和 +无论是像网络前端和有状态服务器之类的工作,像 [Bigtable](http://research.google.com/archive/bigtable.html) 和 [Spanner](http://research.google.com/archive/spanner.html)一样的基础架构系统,或是像 [MapReduce](http://research.google.com/archive/mapreduce.html) 和 [Millwheel](http://research.google.com/pubs/pub41378.html)一样的批处理框架, Google 的几乎一切都是以容器的方式运行的。今天,我们揭开了 Borg 的面纱,Google 传闻已久的面向容器的内部集群管理系统,并在学术计算机系统会议 [Eurosys](http://eurosys2015.labri.fr/) 上发布了详细信息。你可以在 [此处](https://research.google.com/pubs/pub43438.html) 找到论文。 - @@ -33,15 +32,15 @@ To give you a flavor, here are four Kubernetes features that came from our exper Kubernetes 中的以下四个功能特性源于我们从 Borg 获得的经验: -1) [Pods](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/pods.md). +1) [Pods](/zh-cn/docs/concepts/workloads/pods/)。 Pod 是 Kubernetes 中调度的单位。 它是一个或多个容器在其中运行的资源封装。 保证属于同一 Pod 的容器可以一起调度到同一台计算机上,并且可以通过本地卷共享状态。 Borg 有一个类似的抽象,称为 alloc(“资源分配”的缩写)。 Borg 中 alloc 的常见用法包括运行 Web 服务器,该服务器生成日志,一起部署一个轻量级日志收集进程, @@ -54,12 +53,10 @@ Pods not only support these use cases, but they also provide an environment simi --> Pod 不仅支持这些用例,而且还提供类似于在单个 VM 中运行多个进程的环境 -- Kubernetes 用户可以在 Pod 中部署多个位于同一地点的协作过程,而不必放弃一个应用程序一个容器的部署模型。 - - -2) [服务](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/services.md)。 +2) [服务](/zh-cn/docs/concepts/services-networking/service/)。 尽管 Borg 的主要角色是管理任务和计算机的生命周期,但是在 Borg 上运行的应用程序还可以从许多其它集群服务中受益,包括命名和负载均衡。 Kubernetes 使用服务抽象支持命名和负载均衡:带名字的服务,会映射到由标签选择器定义的一组动态 Pod 集(请参阅下一节)。 集群中的任何容器都可以使用服务名称链接到服务。 @@ -68,30 +65,24 @@ Under the covers, Kubernetes automatically load-balances connections to the serv --> 在幕后,Kubernetes 会自动在与标签选择器匹配到 Pod 之间对与服务的连接进行负载均衡,并跟踪 Pod 在哪里运行,由于故障,它们会随着时间的推移而重新安排。 - - -3) [标签](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/labels.md)。 + +3) [标签](/zh-cn/docs/concepts/overview/working-with-objects/labels/)。 Borg 中的容器通常是一组相同或几乎相同的容器中的一个副本,该容器对应于 Internet 服务的一层(例如 Google Maps 的前端)或批处理作业的工人(例如 MapReduce)。 该集合称为 Job ,每个副本称为任务。 尽管 Job 是一个非常有用的抽象,但它可能是有限的。 例如,用户经常希望将其整个服务(由许多 Job 组成)作为一个实体进行管理,或者统一管理其服务的几个相关实例,例如单独的 Canary 和稳定的发行版。 另一方面,用户经常希望推理和控制 Job 中的任务子集 --最常见的示例是在滚动更新期间,此时作业的不同子集需要具有不同的配置。 - 通过使用标签组织 Pod ,Kubernetes 比 Borg 支持更灵活的集合,标签是用户附加到 Pod(实际上是系统中的任何对象)的任意键/值对。 用户可以通过在其 Pod 上使用 “job:\” 标签来创建与 Borg Jobs 等效的分组,但是他们还可以使用其他标签来标记服务名称,服务实例(生产,登台,测试)以及一般而言,其 pod 的任何子集。 标签查询(称为“标签选择器”)用于选择操作应用于哪一组 Pod 。 -结合起来,标签和[复制控制器](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/replication-controller.md) 允许非常灵活的更新语义,以及跨等效项的操作 Borg Jobs。 - - +结合起来,标签和[复制控制器](/zh-cn/docs/concepts/workloads/controllers/replicationcontroller/) 允许非常灵活的更新语义,以及跨等效项的操作 Borg Jobs。 @@ -107,11 +97,8 @@ Thanks to the advent of software-defined overlay networks such as [flannel](http 这消除了管理端口的基础架构的复杂性,并允许开发人员选择他们想要的任何端口,而不需要其软件适应基础架构选择的端口。 后一点对于使现成的易于运行 Kubernetes 上的开源应用程序至关重要 -- 可以将 Pod 视为 VMs 或物理主机,可以访问整个端口空间,他们可能与其他 Pod 共享同一台物理计算机,这一事实已被忽略。 - 随着基于容器的微服务架构的日益普及,Google 从内部运行此类系统所汲取的经验教训已引起外部 DevOps 社区越来越多的兴趣。 通过揭示集群管理器 Borg 的一些内部工作原理,并将下一代集群管理器构建为一个开源项目(Kubernetes)和一个公开可用的托管服务([Google Container Engine](http://cloud.google.com/container-engine)),我们希望这些课程可以使 Google 之外的广大社区受益,并推动容器调度和集群管理方面的最新技术发展。 - - diff --git a/content/zh-cn/blog/_posts/2021-04-06-PodSecurityPolicy-Past-Present-and-Future.md b/content/zh-cn/blog/_posts/2021-04-06-PodSecurityPolicy-Past-Present-and-Future.md index e617d121a67..ea95c78d2df 100644 --- a/content/zh-cn/blog/_posts/2021-04-06-PodSecurityPolicy-Past-Present-and-Future.md +++ b/content/zh-cn/blog/_posts/2021-04-06-PodSecurityPolicy-Past-Present-and-Future.md @@ -13,6 +13,21 @@ title: "PodSecurityPolicy Deprecation: Past, Present, and Future" --> 作者:Tabitha Sable(Kubernetes SIG Security) +{{% pageinfo color="primary" %}} + +**更新:随着 Kubernetes v1.25 的发布,PodSecurityPolicy 已被删除。** + + +**你可以在 [Kubernetes 1.25 发布说明](/zh-cn/blog/2022/08/23/kubernetes-v1-25-release/#pod-security-changes) +中阅读有关删除 PodSecurityPolicy 的更多信息。** + +{{% /pageinfo %}} + -目前 Jintao 是 [ingress-nginx](https://kubernetes.github.io/ingress-nginx/) 项目的 Reviewer。 +目前 Jintao 是 [ingress-nginx](https://kubernetes.github.io/ingress-nginx/) 项目的 Maintainer。 他建议关注开源公司的工作机会,这样你就可以找到一个可以让你全职贡献的机会。 对于新的贡献者们,Jintao 表示如果有人想为一个开源项目做重大贡献, diff --git a/content/zh-cn/blog/_posts/2023-01-05-retroactive-default-storage-class.md b/content/zh-cn/blog/_posts/2023-01-05-retroactive-default-storage-class.md index 9162281c74b..02d5133ab6d 100644 --- a/content/zh-cn/blog/_posts/2023-01-05-retroactive-default-storage-class.md +++ b/content/zh-cn/blog/_posts/2023-01-05-retroactive-default-storage-class.md @@ -19,8 +19,10 @@ slug: retroactive-default-storage-class **译者:** Michael Yao (DaoCloud) Kubernetes v1.25 引入了一个 Alpha 特性来更改默认 StorageClass 被分配到 PersistentVolumeClaim (PVC) 的方式。 @@ -28,7 +30,8 @@ Kubernetes v1.25 引入了一个 Alpha 特性来更改默认 StorageClass 被分 此外,任何未分配 StorageClass 的 PVC 都可以在后续被更新。此特性在 Kubernetes 1.26 中已进阶至 Beta。 有关如何使用的更多细节,请参阅 Kubernetes @@ -38,7 +41,9 @@ or you can read on to learn about why the Kubernetes project is making this chan ## 为什么 StorageClass 赋值需要改进 {#why-did-sc-assignment-need-improvements} @@ -46,10 +51,10 @@ Users might already be familiar with a similar feature that assigns default Stor 这个目前由[准入控制器](/zh-cn/docs/reference/access-authn-authz/admission-controllers/#defaultstorageclass)处理。 但是,如果在创建 PVC 时没有定义默认 StorageClass 会怎样? @@ -66,9 +71,11 @@ With the alpha feature enabled, there were two options admins had when they want 启用这个 Alpha 特性后,管理员想要更改默认 StorageClass 时会有两个选项: 1. 在移除与 PVC 关联的旧 StorageClass 之前,创建一个新的 StorageClass 作为默认值。 这将导致在短时间内出现两个默认值。此时,如果用户要创建一个 PersistentVolumeClaim, @@ -77,9 +84,11 @@ At this point, if a user were to create a PersistentVolumeClaim with storageClas 2. 先移除旧的默认值再创建一个新的默认 StorageClass。这将导致短时间内没有默认值。 接下来如果用户创建一个 PersistentVolumeClaim,并将 storageClassName 设置为 null @@ -89,8 +98,10 @@ The user would have to fix this by deleting the PVC and recreating it once the d ### 集群安装期间的资源顺序 {#resource-ordering-during-cluster-installation} @@ -101,8 +112,10 @@ This is because any Pods that required storage would rely on the presence of a d ## 发生了什么变化 {#what-changed} @@ -113,7 +126,10 @@ storageClassName 设置为 `null` 且未被绑定的所有 PersistentVolumeClaim ### Null `storageClassName` 与 `storageClassName: ""` - 有什么影响? {#null-vs-empty-string} @@ -123,7 +139,10 @@ Before this feature was introduced, those values were equal in terms of behavior 启用此新特性时,我们希望保持此行为,但也希望能够更新 StorageClass 名称。 考虑到这些限制,此特性更改了 `null` 的语义。 @@ -132,7 +151,8 @@ With these constraints in mind, the feature changes the semantics of null< 所以行为将保持不变。 @@ -179,7 +199,9 @@ The tables below show all these cases to better describe when PVC binds and when ## 如何使用 {#how-to-use-it} @@ -218,7 +240,9 @@ If you would like to see the feature in action and verify it works fine in your ``` 2. 在没有默认 StorageClass 时创建 PersistentVolumeClaim。 PVC 不会制备或绑定(除非当前已存在一个合适的 PV),PVC 将保持在 `Pending` 状态。 @@ -226,7 +250,7 @@ If you would like to see the feature in action and verify it works fine in your ``` $ kc get pvc NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE - pvc-1 Pending + pvc-1 Pending ``` ### 新指标 {#new-metrics} @@ -264,7 +291,8 @@ To help you see that the feature is working as expected we also introduced a new Kubernetes 项目运行一个名为 `registry.k8s.io`、由社区管理的镜像仓库来托管其容器镜像。 2023 年 4 月 3 日,旧仓库 `k8s.gcr.io` 将被冻结,Kubernetes 及其相关子项目的镜像将不再推送到这个旧仓库。 @@ -32,7 +39,9 @@ Kubernetes 项目带来的好处。这篇博客再次宣布后续版本的 Kuber 这次变更对贡献者意味着: @@ -40,10 +49,18 @@ What does this change mean for contributors: 这次变更对终端用户意味着: @@ -77,7 +94,8 @@ What does this change mean for end users: ## 下一步 {#whats-next} @@ -91,14 +109,19 @@ uniq -c ``` 旧的镜像仓库可能存在其他依赖项。请确保你检查了所有潜在的依赖项,以保持集群健康和最新。 ## 致谢 {#acknowledgments} @@ -107,7 +130,14 @@ __改变是艰难的__,但只有镜像服务平台演进才能确保 Kubernete 确保我们能够做出尽可能最好的决策、履行计划并尽最大努力传达这些计划。 衷心感谢: diff --git a/content/zh-cn/blog/_posts/2023-03-17-kubernetes-1.27-deprecations-and-removals.md b/content/zh-cn/blog/_posts/2023-03-17-kubernetes-1.27-deprecations-and-removals.md index 303f04d41fe..2d16ba1df9c 100644 --- a/content/zh-cn/blog/_posts/2023-03-17-kubernetes-1.27-deprecations-and-removals.md +++ b/content/zh-cn/blog/_posts/2023-03-17-kubernetes-1.27-deprecations-and-removals.md @@ -402,6 +402,20 @@ Kubernetes v1.25 版本还稳定了对 DaemonSet Pod 的浪涌支持, 其实现是为了最大限度地减少部署期间 DaemonSet 的停机时间。 `DaemonSetUpdateSurge` 特性门控将在 Kubernetes v1.27 中被移除。 + +### 移除 `--container-runtime` 命令行参数 + + +kubelet 接受一个已弃用的命令行参数 `--container-runtime`, +并且在移除 dockershim 代码后,唯一有效的值将是 `remote`。 +Kubernetes v1.27 将移除该参数,该参数自 v1.24 版本以来已被弃用。 + * `queue-full`,表明已经有太多请求排队, * `concurrency-limit`,表示将 PriorityLevelConfiguration 配置为 `Reject` 而不是 `Queue`,或者 * `time-out`,表示在其排队时间超期的请求仍在队列中。 + * `cancelled`,表示该请求未被清除锁定,已从队列中移除。 -- 通常情况下,集群的用户账号可能会从企业数据库进行同步,创建新用户需要特殊权限,并且涉及到复杂的业务流程。 +- 通常情况下,集群的用户账号可能会从企业数据库进行同步, + 创建新用户需要特殊权限,并且涉及到复杂的业务流程。 服务账号创建有意做得更轻量,允许集群用户为了具体的任务按需创建服务账号。 - 将 ServiceAccount 的创建与新用户注册的步骤分离开来,使工作负载更易于遵从权限最小化原则。 + 将 ServiceAccount 的创建与新用户注册的步骤分离开来, + 使工作负载更易于遵从权限最小化原则。 -没有特定的机制可以使通过 TokenRequest 签发的令牌无效。如果你不再信任为某个 Pod 绑定的服务账号令牌, +没有特定的机制可以使通过 TokenRequest 签发的令牌无效。 +如果你不再信任为某个 Pod 绑定的服务账号令牌, 你可以删除该 Pod。删除 Pod 将使其绑定的服务账号令牌过期。 {{< /note >}} @@ -211,9 +214,10 @@ The tokens obtained using this method have bounded lifetimes, and are automatica invalidated when the Pod they are mounted into is deleted. --> 在包括 Kubernetes v{{< skew currentVersion >}} 在内最近的几个版本中,使用 -[TokenRequest](/zh-cn/docs/reference/kubernetes-api/authentication-resources/token-request-v1/) API -[直接获得](#bound-service-account-token-volume) API 凭据,并使用投射卷挂载到 Pod 中。 -使用这种方法获得的令牌具有绑定的生命周期,当挂载的 Pod 被删除时这些令牌将自动失效。 +[TokenRequest](/zh-cn/docs/reference/kubernetes-api/authentication-resources/token-request-v1/) +API [直接获得](#bound-service-account-token-volume) API 凭据, +并使用投射卷挂载到 Pod 中。使用这种方法获得的令牌具有绑定的生命周期, +当挂载的 Pod 被删除时这些令牌将自动失效。 +## 控制平面细节 {#control-plane-details} + +ServiceAccount 控制器管理名字空间内的 ServiceAccount, +并确保每个活跃的名字空间中都存在名为 `default` 的 ServiceAccount。 + + -## 控制平面细节 {#control-plane-details} - ### 令牌控制器 {#token-controller} 服务账号令牌控制器作为 `kube-controller-manager` 的一部分运行,以异步的形式工作。 其职责包括: - 监测 ServiceAccount 的删除并删除所有相应的服务账号令牌 Secret。 -- 监测服务账号令牌 Secret 的添加,保证相应的 ServiceAccount 存在,如有需要, - 向 Secret 中添加令牌。 +- 监测服务账号令牌 Secret 的添加,保证相应的 ServiceAccount 存在, + 如有需要,向 Secret 中添加令牌。 - 监测服务账号令牌 Secret 的删除,如有需要,从相应的 ServiceAccount 中移除引用。 -你必须通过 `--service-account-private-key-file` 标志为 `kube-controller-manager` -的令牌控制器传入一个服务账号私钥文件。该私钥用于为所生成的服务账号令牌签名。 -同样地,你需要通过 `--service-account-key-file` 标志将对应的公钥通知给 +你必须通过 `--service-account-private-key-file` 标志为 +`kube-controller-manager`的令牌控制器传入一个服务账号私钥文件。 +该私钥用于为所生成的服务账号令牌签名。同样地,你需要通过 +`--service-account-key-file` 标志将对应的公钥通知给 kube-apiserver。公钥用于在身份认证过程中校验令牌。 要为 ServiceAccount 创建一个不过期、持久化的 API 令牌, -请创建一个类型为 `kubernetes.io/service-account-token` 的 Secret,附带引用 ServiceAccount 的注解。 -控制平面随后生成一个长久的令牌,并使用生成的令牌数据更新该 Secret。 +请创建一个类型为 `kubernetes.io/service-account-token` 的 Secret, +附带引用 ServiceAccount 的注解。控制平面随后生成一个长久的令牌, +并使用生成的令牌数据更新该 Secret。 以下是此类 Secret 的示例清单: @@ -491,7 +506,7 @@ token: ... If you launch a new Pod into the `examplens` namespace, it can use the `myserviceaccount` service-account-token Secret that you just created. --> -如果你在 `examplens` 名字空间中启动新的 Pod,可以使用你刚刚创建的 +如果你在 `examplens` 名字空间中启动一个新的 Pod,它可以使用你刚刚创建的 `myserviceaccount` service-account-token Secret。 -## 控制平面细节 {#control-plane-details} - -### ServiceAccount 控制器 {#serviceaccount-controller} - -ServiceAccount 控制器管理名字空间内的 ServiceAccount,并确保每个活跃的名字空间中都存在名为 -“default” 的 ServiceAccount。 - - -### 令牌控制器 - -服务账号令牌控制器作为 `kube-controller-manager` 的一部分运行,以异步的形式工作。 -其职责包括: - -- 监测 ServiceAccount 的创建并创建相应的服务账号令牌 Secret 以允许 API 访问。 -- 监测 ServiceAccount 的删除并删除所有相应的服务账号令牌 Secret。 -- 监测服务账号令牌 Secret 的添加,保证相应的 ServiceAccount 存在,如有需要, - 向 Secret 中添加令牌。 -- 监测 Secret 的删除,如有需要,从相应的 ServiceAccount 中移除引用。 - - -你必须通过 `--service-account-private-key-file` 标志为 `kube-controller-manager` -的令牌控制器传入一个服务账号私钥文件。该私钥用于为所生成的服务账号令牌签名。 -同样地,你需要通过 `--service-account-key-file` 标志将对应的公钥通知给 -kube-apiserver。公钥用于在身份认证过程中校验令牌。 - ## {{% heading "whatsnext" %}} -节点压力驱逐不用于 [API 发起的驱逐](/docs/reference/generated/kubernetes-api/v1.23/)。 +节点压力驱逐不用于 [API 发起的驱逐](/zh-cn/docs/concepts/scheduling-eviction/api-eviction/)。 diff --git a/content/zh-cn/docs/tasks/debug/debug-application/debug-pods.md b/content/zh-cn/docs/tasks/debug/debug-application/debug-pods.md index 290ab9074ea..a03d12030b8 100644 --- a/content/zh-cn/docs/tasks/debug/debug-application/debug-pods.md +++ b/content/zh-cn/docs/tasks/debug/debug-application/debug-pods.md @@ -162,7 +162,7 @@ If you misspelled `command` as `commnd` then will give an error like this: 例如,运行 `kubectl apply --validate -f mypod.yaml`。 如果 `command` 被误拼成 `commnd`,你将会看到下面的错误信息: -``` +```shell I0805 10:43:25.129850 46757 schema.go:126] unknown field: commnd I0805 10:43:25.129973 46757 schema.go:129] this may be a false alarm, see https://github.com/kubernetes/kubernetes/issues/6842 pods/mypod @@ -279,17 +279,17 @@ Verify that the pod's `containerPort` matches up with the Service's `targetPort` #### 网络流量未被转发 {#network-traffic-is-not-forwarded} -请参阅[调试 Service](/zh-cn/docs/tasks/debug/debug-applications/debug-service/) 了解更多信息。 +请参阅[调试 Service](/zh-cn/docs/tasks/debug/debug-application/debug-service/) 了解更多信息。 ## {{% heading "whatsnext" %}} 如果上述方法都不能解决你的问题, -请按照[调试 Service 文档](/zh-cn/docs/tasks/debug/debug-applications/debug-service/)中的介绍, +请按照[调试 Service 文档](/zh-cn/docs/tasks/debug/debug-application/debug-service/)中的介绍, 确保你的 `Service` 处于 Running 态,有 `Endpoints` 被创建,`Pod` 真的在提供服务; DNS 服务已配置并正常工作,iptables 规则也以安装并且 `kube-proxy` 也没有异常行为。 diff --git a/content/zh-cn/docs/tutorials/services/pods-and-endpoint-termination-flow.md b/content/zh-cn/docs/tutorials/services/pods-and-endpoint-termination-flow.md new file mode 100644 index 00000000000..edec75d2a8b --- /dev/null +++ b/content/zh-cn/docs/tutorials/services/pods-and-endpoint-termination-flow.md @@ -0,0 +1,302 @@ +--- +title: 探索 Pod 及其端点的终止行为 +content_type: tutorial +weight: 60 +--- + + + + + +一旦你参照[使用 Service 连接到应用](/zh-cn/docs/tutorials/services/connect-applications-service/)中概述的那些步骤使用 +Service 连接到了你的应用,你就有了一个持续运行的多副本应用暴露在了网络上。 +本教程帮助你了解 Pod 的终止流程,探索实现连接排空的几种方式。 + + + + +## Pod 及其端点的终止过程 {#termination-process-for-pods-and-endpoints} + +你经常会遇到需要终止 Pod 的场景,例如为了升级或缩容。 +为了改良应用的可用性,实现一种合适的活跃连接排空机制变得重要。 + +本教程将通过使用一个简单的 nginx Web 服务器演示此概念, +解释 Pod 终止的流程及其与相应端点状态和移除的联系。 + + + + +## 端点终止的示例流程 {#example-flow-with-endpoint-termination} + +以下是 [Pod 终止](/zh-cn/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination)文档中所述的流程示例。 + +假设你有包含单个 nginx 副本(仅用于演示目的)的一个 Deployment 和一个 Service: + +{{< codenew file="service/pod-with-graceful-termination.yaml" >}} + + +```yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nginx-deployment + labels: + app: nginx +spec: + replicas: 1 + selector: + matchLabels: + app: nginx + template: + metadata: + labels: + app: nginx + spec: + terminationGracePeriodSeconds: 120 # 超长优雅期 + containers: + - name: nginx + image: nginx:latest + ports: + - containerPort: 80 + lifecycle: + preStop: + exec: + # 实际生产环境中的 Pod 终止可能需要执行任何时长,但不会超过 terminationGracePeriodSeconds。 + # 在本例中,只需挂起至少 terminationGracePeriodSeconds 所指定的持续时间, + # 在 120 秒时容器将被强制终止。 + # 请注意,在所有这些时间点 nginx 都将继续处理请求。 + command: [ + "/bin/sh", "-c", "sleep 180" + ] + +--- + +apiVersion: v1 +kind: Service +metadata: + name: nginx-service +spec: + selector: + app: nginx + ports: + - protocol: TCP + port: 80 + targetPort: 80 +``` + + +一旦 Pod 和 Service 开始运行,你就可以获取对应的所有 EndpointSlices 的名称: + +```shell +kubectl get endpointslice +``` + + +输出类似于: + +```none +NAME ADDRESSTYPE PORTS ENDPOINTS AGE +nginx-service-6tjbr IPv4 80 10.12.1.199,10.12.1.201 22m +``` + + +你可以查看其 status 并验证已经有一个端点被注册: + +```shell +kubectl get endpointslices -o json -l kubernetes.io/service-name=nginx-service +``` + + +输出类似于: + +```none +{ + "addressType": "IPv4", + "apiVersion": "discovery.k8s.io/v1", + "endpoints": [ + { + "addresses": [ + "10.12.1.201" + ], + "conditions": { + "ready": true, + "serving": true, + "terminating": false + } + } + ] +} +``` + + +现在让我们终止这个 Pod 并验证该 Pod 正在遵从体面终止期限的配置进行终止: + +```shell +kubectl delete pod nginx-deployment-7768647bf9-b4b9s +``` + + +查看所有 Pod: + +```shell +kubectl get pods +``` + + +输出类似于: + +```none +NAME READY STATUS RESTARTS AGE +nginx-deployment-7768647bf9-b4b9s 1/1 Terminating 0 4m1s +nginx-deployment-7768647bf9-rkxlw 1/1 Running 0 8s +``` + + +你可以看到新的 Pod 已被调度。 + +当系统在为新的 Pod 创建新的端点时,旧的端点仍处于 Terminating 状态: + +```shell +kubectl get endpointslice -o json nginx-service-6tjbr +``` + + +输出类似于: + +```none +{ + "addressType": "IPv4", + "apiVersion": "discovery.k8s.io/v1", + "endpoints": [ + { + "addresses": [ + "10.12.1.201" + ], + "conditions": { + "ready": false, + "serving": true, + "terminating": true + }, + "nodeName": "gke-main-default-pool-dca1511c-d17b", + "targetRef": { + "kind": "Pod", + "name": "nginx-deployment-7768647bf9-b4b9s", + "namespace": "default", + "uid": "66fa831c-7eb2-407f-bd2c-f96dfe841478" + }, + "zone": "us-central1-c" + }, + ] + { + "addresses": [ + "10.12.1.202" + ], + "conditions": { + "ready": true, + "serving": true, + "terminating": false + }, + "nodeName": "gke-main-default-pool-dca1511c-d17b", + "targetRef": { + "kind": "Pod", + "name": "nginx-deployment-7768647bf9-rkxlw", + "namespace": "default", + "uid": "722b1cbe-dcd7-4ed4-8928-4a4d0e2bbe35" + }, + "zone": "us-central1-c" + } +} +``` + + +这种设计使得应用可以在终止期间公布自己的状态,而客户端(如负载均衡器)则可以实现连接排空功能。 +这些客户端可以检测到正在终止的端点,并为这些端点实现特殊的逻辑。 + + +在 Kubernetes 中,正在终止的端点始终将其 `ready` 状态设置为 `false`。 +这是为了满足向后兼容的需求,确保现有的负载均衡器不会将 Pod 用于常规流量。 +如果需要排空正被终止的 Pod 上的流量,可以将 `serving` 状况作为实际的就绪状态。 + +当 Pod 被删除时,旧的端点也会被删除。 + +## {{% heading "whatsnext" %}} + + +* 了解如何[使用 Service 连接到应用](/zh-cn/docs/tutorials/services/connect-applications-service/) +* 进一步了解[使用 Service 访问集群中的应用](/zh-cn/docs/tasks/access-application-cluster/service-access-application-cluster/) +* 进一步了解[使用 Service 把前端连接到后端](/zh-cn/docs/tasks/access-application-cluster/connecting-frontend-backend/) +* 进一步了解[创建外部负载均衡器](/zh-cn/docs/tasks/access-application-cluster/create-external-load-balancer/) diff --git a/content/zh-cn/examples/service/pod-with-graceful-termination.yaml b/content/zh-cn/examples/service/pod-with-graceful-termination.yaml new file mode 100644 index 00000000000..1343555b5fc --- /dev/null +++ b/content/zh-cn/examples/service/pod-with-graceful-termination.yaml @@ -0,0 +1,32 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nginx-deployment + labels: + app: nginx +spec: + replicas: 1 + selector: + matchLabels: + app: nginx + template: + metadata: + labels: + app: nginx + spec: + terminationGracePeriodSeconds: 120 # 超长优雅期 + containers: + - name: nginx + image: nginx:latest + ports: + - containerPort: 80 + lifecycle: + preStop: + exec: + # 实际生产环境中的 Pod 终止可能需要执行任何时长,但不会超过 terminationGracePeriodSeconds。 + # 在本例中,只需挂起至少 terminationGracePeriodSeconds 所指定的持续时间, + # 在 120 秒时容器将被强制终止。 + # 请注意,在所有这些时间点 nginx 都将继续处理请求。 + command: [ + "/bin/sh", "-c", "sleep 180" + ] diff --git a/data/announcements/scheduled.yaml b/data/announcements/scheduled.yaml index 9c797ec1917..79e6e2e5b0c 100644 --- a/data/announcements/scheduled.yaml +++ b/data/announcements/scheduled.yaml @@ -143,7 +143,7 @@ announcements: Please read our [announcement](/blog/2023/02/06/k8s-gcr-io-freeze-announcement/) for more details. - name: Redirecting k8s.gcr.io - Before - startTime: 2023-03-10T00:00:00 # This should run before and after Kubecon EU 2023 + startTime: 2023-03-10T00:00:00 # This should run before the redirect endTime: 2023-03-26T00:00:00 style: "background: #c70202" title: Legacy k8s.gcr.io container image registry will be redirected to registry.k8s.io @@ -153,11 +153,11 @@ announcements: Please read our [announcement](/blog/2023/03/10/image-registry-redirect/) for more details. - name: Redirecting k8s.gcr.io - After - startTime: 2023-04-05T00:00:00 # This should run before and after Kubecon EU 2023 + startTime: 2023-03-27T00:00:00 # This should run after the redirect begins endTime: 2023-05-31T00:00:00 style: "background: #c70202" - title: Legacy k8s.gcr.io container image registry will be redirected to registry.k8s.io + title: Legacy k8s.gcr.io container image registry is being redirected to registry.k8s.io message: | - k8s.gcr.io image registry is being redirected to registry.k8s.io (since Monday March 20th).
+ k8s.gcr.io image registry is gradually being redirected to registry.k8s.io (since Monday March 20th).
All images available in k8s.gcr.io are available at registry.k8s.io.
Please read our [announcement](/blog/2023/03/10/image-registry-redirect/) for more details.