Merge branch 'master' into fix-restart-always-docs
This commit is contained in:
commit
4d52cb6dd5
|
|
@ -6,6 +6,8 @@
|
|||
your pull request. The description should explain what will change,
|
||||
and why.
|
||||
|
||||
PLEASE title the FIRST commit appropriately, so that if you squash all
|
||||
your commits into one, the combined commit message makes sense.
|
||||
For overall help on editing and submitting pull requests, visit:
|
||||
https://kubernetes.io/docs/contribute/start/#improve-existing-content
|
||||
|
||||
|
|
|
|||
|
|
@ -182,6 +182,7 @@ aliases:
|
|||
- idealhack
|
||||
- markthink
|
||||
- SataQiu
|
||||
- tanjunchen
|
||||
- tengqm
|
||||
- xiangpengzhao
|
||||
- xichengliudui
|
||||
|
|
@ -222,3 +223,13 @@ aliases:
|
|||
- mfilocha
|
||||
- nvtkaszpir
|
||||
- kpucynski
|
||||
sig-docs-uk-owners: # Admins for Ukrainian content
|
||||
- anastyakulyk
|
||||
- butuzov
|
||||
- MaxymVlasov
|
||||
sig-docs-uk-reviews: # PR reviews for Ukrainian content
|
||||
- anastyakulyk
|
||||
- butuzov
|
||||
- idvoretskyi
|
||||
- MaxymVlasov
|
||||
- Potapy4
|
||||
|
|
|
|||
|
|
@ -0,0 +1,71 @@
|
|||
# Документація Kubernetes
|
||||
|
||||
[](https://travis-ci.org/kubernetes/website)
|
||||
[](https://github.com/kubernetes/website/releases/latest)
|
||||
|
||||
Вітаємо! В цьому репозиторії міститься все необхідне для роботи над [сайтом і документацією Kubernetes](https://kubernetes.io/). Ми щасливі, що ви хочете зробити свій внесок!
|
||||
|
||||
## Внесок у документацію
|
||||
|
||||
Ви можете створити копію цього репозиторія у своєму акаунті на GitHub, натиснувши на кнопку **Fork**, що розташована справа зверху. Ця копія називатиметься *fork* (відгалуження). Зробіть будь-які необхідні зміни у своєму відгалуженні. Коли ви будете готові надіслати їх нам, перейдіть до свого відгалуження і створіть новий pull request, щоб сповістити нас.
|
||||
|
||||
Після того, як ви створили pull request, рецензент Kubernetes зобов’язується надати вам по ньому чіткий і конструктивний коментар. **Ваш обов’язок як творця pull request - відкоригувати його відповідно до зауважень рецензента Kubernetes.** Також, зауважте: може статися так, що ви отримаєте коментарі від декількох рецензентів Kubernetes або від іншого рецензента, ніж той, якого вам було призначено від початку. Крім того, за потреби один із ваших рецензентів може запросити технічну перевірку від одного з [технічних рецензентів Kubernetes](https://github.com/kubernetes/website/wiki/Tech-reviewers). Рецензенти намагатимуться відреагувати вчасно, проте час відповіді може відрізнятися в залежності від обставин.
|
||||
|
||||
Більше інформації про внесок у документацію Kubernetes ви знайдете у наступних джерелах:
|
||||
|
||||
* [Внесок: з чого почати](https://kubernetes.io/docs/contribute/start/)
|
||||
* [Візуалізація запропонованих змін до документації](http://kubernetes.io/docs/contribute/intermediate#view-your-changes-locally)
|
||||
* [Використання шаблонів сторінок](http://kubernetes.io/docs/contribute/style/page-templates/)
|
||||
* [Керівництво зі стилю оформлення документації](http://kubernetes.io/docs/contribute/style/style-guide/)
|
||||
* [Переклад документації Kubernetes іншими мовами](https://kubernetes.io/docs/contribute/localization/)
|
||||
|
||||
## Запуск сайту локально за допомогою Docker
|
||||
|
||||
Для локального запуску сайту Kubernetes рекомендовано запустити спеціальний [Docker](https://docker.com)-образ, що містить генератор статичних сайтів [Hugo](https://gohugo.io).
|
||||
|
||||
> Якщо ви працюєте під Windows, вам знадобиться ще декілька інструментів, які можна встановити за допомогою [Chocolatey](https://chocolatey.org). `choco install make`
|
||||
|
||||
> Якщо ви вважаєте кращим запустити сайт локально без використання Docker, дивіться пункт нижче [Запуск сайту локально за допомогою Hugo](#запуск-сайту-локально-зa-допомогою-hugo).
|
||||
|
||||
Якщо у вас вже [запущений](https://www.docker.com/get-started) Docker, зберіть локальний Docker-образ `kubernetes-hugo`:
|
||||
|
||||
```bash
|
||||
make docker-image
|
||||
```
|
||||
|
||||
Після того, як образ зібрано, ви можете запустити сайт локально:
|
||||
|
||||
```bash
|
||||
make docker-serve
|
||||
```
|
||||
|
||||
Відкрийте у своєму браузері http://localhost:1313, щоб побачити сайт. По мірі того, як ви змінюєте вихідний код, Hugo актуалізує сайт відповідно до внесених змін і оновлює сторінку у браузері.
|
||||
|
||||
## Запуск сайту локально зa допомогою Hugo
|
||||
|
||||
Для інструкцій по установці Hugo дивіться [офіційну документацію](https://gohugo.io/getting-started/installing/). Обов’язково встановіть розширену версію Hugo, яка позначена змінною оточення `HUGO_VERSION` у файлі [`netlify.toml`](netlify.toml#L9).
|
||||
|
||||
Після установки Hugo, запустіть сайт локально командою:
|
||||
|
||||
```bash
|
||||
make serve
|
||||
```
|
||||
|
||||
Команда запустить локальний Hugo-сервер на порту 1313. Відкрийте у своєму браузері http://localhost:1313, щоб побачити сайт. По мірі того, як ви змінюєте вихідний код, Hugo актуалізує сайт відповідно до внесених змін і оновлює сторінку у браузері.
|
||||
|
||||
## Спільнота, обговорення, внесок і підтримка
|
||||
|
||||
Дізнайтеся, як долучитися до спільноти Kubernetes на [сторінці спільноти](http://kubernetes.io/community/).
|
||||
|
||||
Для зв’язку із супроводжуючими проекту скористайтеся:
|
||||
|
||||
- [Slack](https://kubernetes.slack.com/messages/sig-docs)
|
||||
- [Поштова розсилка](https://groups.google.com/forum/#!forum/kubernetes-sig-docs)
|
||||
|
||||
### Кодекс поведінки
|
||||
|
||||
Участь у спільноті Kubernetes визначається правилами [Кодексу поведінки спільноти Kubernetes](code-of-conduct.md).
|
||||
|
||||
## Дякуємо!
|
||||
|
||||
Долучення до спільноти - запорука успішного розвитку Kubernetes. Ми цінуємо ваш внесок у наш сайт і документацію!
|
||||
|
|
@ -28,7 +28,7 @@ For more information about contributing to the Kubernetes documentation, see:
|
|||
|[Indonesian README](README-id.md)|[Chinese README](README-zh.md)|
|
||||
|[Japanese README](README-ja.md)|[Vietnamese README](README-vi.md)|
|
||||
|[Russian README](README-ru.md)|[Italian README](README-it.md)|
|
||||
|[Polish README](README-pl.md)||
|
||||
|[Polish README](README-pl.md)|[Ukrainian README](README-uk.md)|
|
||||
|||
|
||||
|
||||
## Running the website locally using Docker
|
||||
|
|
|
|||
12
config.toml
12
config.toml
|
|
@ -298,3 +298,15 @@ contentDir = "content/pl"
|
|||
time_format_blog = "01.02.2006"
|
||||
# A list of language codes to look for untranslated content, ordered from left to right.
|
||||
language_alternatives = ["en"]
|
||||
|
||||
[languages.uk]
|
||||
title = "Kubernetes"
|
||||
description = "Довершена система оркестрації контейнерів"
|
||||
languageName = "Українська"
|
||||
weight = 14
|
||||
contentDir = "content/uk"
|
||||
|
||||
[languages.uk.params]
|
||||
time_format_blog = "02.01.2006"
|
||||
# A list of language codes to look for untranslated content, ordered from left to right.
|
||||
language_alternatives = ["en"]
|
||||
|
|
|
|||
|
|
@ -24,17 +24,17 @@ The new concept of a path type allows you to specify how a path should be matche
|
|||
The Ingress resource was designed with simplicity in mind, providing a simple set of fields that would be applicable in all use cases. Over time, as use cases evolved, implementations began to rely on a long list of custom annotations for further configuration. The new `IngressClass` resource provides a way to replace some of those annotations.
|
||||
|
||||
Each `IngressClass` specifies which controller should implement Ingresses of the class and can reference a custom resource with additional parameters.
|
||||
```
|
||||
apiVersion: networking.k8s.io/v1beta1
|
||||
kind: IngressClass
|
||||
```yaml
|
||||
apiVersion: "networking.k8s.io/v1beta1"
|
||||
kind: "IngressClass"
|
||||
metadata:
|
||||
name: external-lb
|
||||
name: "external-lb"
|
||||
spec:
|
||||
controller: example.com/ingress-controller
|
||||
controller: "example.com/ingress-controller"
|
||||
parameters:
|
||||
apiGroup: k8s.example.com/v1alpha
|
||||
kind: IngressParameters
|
||||
name: external-lb
|
||||
apiGroup: "k8s.example.com/v1alpha"
|
||||
kind: "IngressParameters"
|
||||
name: "external-lb"
|
||||
```
|
||||
|
||||
### Specifying the Class of an Ingress
|
||||
|
|
@ -51,30 +51,30 @@ IngressClass resource will ensure that new Ingresses without an `ingressClassNam
|
|||
## Support for Hostname Wildcards
|
||||
Many Ingress providers have supported wildcard hostname matching like `*.foo.com` matching `app1.foo.com`, but until now the spec assumed an exact FQDN match of the host. Hosts can now be precise matches (for example “`foo.bar.com`”) or a wildcard (for example “`*.foo.com`”). Precise matches require that the http host header matches the Host setting. Wildcard matches require the http host header is equal to the suffix of the wildcard rule.
|
||||
|
||||
| Host | Host header | Match? |
|
||||
| ------------- |-------------| -----|
|
||||
| `*.foo.com` | `*.foo.com` | Matches based on shared suffix |
|
||||
| `*.foo.com` | `*.foo.com` | No match, wildcard only covers a single DNS label |
|
||||
| `*.foo.com` | `foo.com` | No match, wildcard only covers a single DNS label |
|
||||
| Host | Host header | Match? |
|
||||
| ----------- |-------------------| --------------------------------------------------|
|
||||
| `*.foo.com` | `bar.foo.com` | Matches based on shared suffix |
|
||||
| `*.foo.com` | `baz.bar.foo.com` | No match, wildcard only covers a single DNS label |
|
||||
| `*.foo.com` | `foo.com` | No match, wildcard only covers a single DNS label |
|
||||
|
||||
### Putting it All Together
|
||||
These new Ingress features allow for much more configurability. Here’s an example of an Ingress that makes use of pathType, `ingressClassName`, and a hostname wildcard:
|
||||
|
||||
```
|
||||
apiVersion: networking.k8s.io/v1beta1
|
||||
kind: Ingress
|
||||
```yaml
|
||||
apiVersion: "networking.k8s.io/v1beta1"
|
||||
kind: "Ingress"
|
||||
metadata:
|
||||
name: example-ingress
|
||||
name: "example-ingress"
|
||||
spec:
|
||||
ingressClassName: external-lb
|
||||
ingressClassName: "external-lb"
|
||||
rules:
|
||||
- host: *.example.com
|
||||
- host: "*.example.com"
|
||||
http:
|
||||
paths:
|
||||
- path: /example
|
||||
pathType: Prefix
|
||||
- path: "/example"
|
||||
pathType: "Prefix"
|
||||
backend:
|
||||
serviceName: example-service
|
||||
serviceName: "example-service"
|
||||
servicePort: 80
|
||||
```
|
||||
|
||||
|
|
@ -84,4 +84,4 @@ Since these features are new in Kubernetes 1.18, each Ingress controller impleme
|
|||
## The Future of Ingress
|
||||
The Ingress API is on pace to graduate from beta to a stable API in Kubernetes 1.19. It will continue to provide a simple way to manage inbound network traffic for Kubernetes workloads. This API has intentionally been kept simple and lightweight, but there has been a desire for greater configurability for more advanced use cases.
|
||||
|
||||
Work is currently underway on a new highly configurable set of APIs that will provide an alternative to Ingress in the future. These APIs are being referred to as the new “Service APIs”. They are not intended to replace any existing APIs, but instead provide a more configurable alternative for complex use cases. For more information, check out the [Service APIs repo on GitHub](http://github.com/kubernetes-sigs/service-apis).
|
||||
Work is currently underway on a new highly configurable set of APIs that will provide an alternative to Ingress in the future. These APIs are being referred to as the new “Service APIs”. They are not intended to replace any existing APIs, but instead provide a more configurable alternative for complex use cases. For more information, check out the [Service APIs repo on GitHub](http://github.com/kubernetes-sigs/service-apis).
|
||||
|
|
|
|||
|
|
@ -0,0 +1,68 @@
|
|||
---
|
||||
layout: blog
|
||||
title: "API Priority and Fairness Alpha"
|
||||
date: 2020-04-06
|
||||
slug: kubernetes-1-18-feature-api-priority-and-fairness-alpha
|
||||
---
|
||||
|
||||
**Authors:** Min Kim (Ant Financial), Mike Spreitzer (IBM), Daniel Smith (Google)
|
||||
|
||||
This blog describes “API Priority And Fairness”, a new alpha feature in Kubernetes 1.18. API Priority And Fairness permits cluster administrators to divide the concurrency of the control plane into different weighted priority levels. Every request arriving at a kube-apiserver will be categorized into one of the priority levels and get its fair share of the control plane’s throughput.
|
||||
|
||||
## What problem does this solve?
|
||||
Today the apiserver has a simple mechanism for protecting itself against CPU and memory overloads: max-in-flight limits for mutating and for readonly requests. Apart from the distinction between mutating and readonly, no other distinctions are made among requests; consequently, there can be undesirable scenarios where one subset of the requests crowds out other requests.
|
||||
|
||||
In short, it is far too easy for Kubernetes workloads to accidentally DoS the apiservers, causing other important traffic--like system controllers or leader elections---to fail intermittently. In the worst cases, a few broken nodes or controllers can push a busy cluster over the edge, turning a local problem into a control plane outage.
|
||||
|
||||
## How do we solve the problem?
|
||||
The new feature “API Priority and Fairness” is about generalizing the existing max-in-flight request handler in each apiserver, to make the behavior more intelligent and configurable. The overall approach is as follows.
|
||||
|
||||
1. Each request is matched by a _Flow Schema_. The Flow Schema states the Priority Level for requests that match it, and assigns a “flow identifier” to these requests. Flow identifiers are how the system determines whether requests are from the same source or not.
|
||||
2. Priority Levels may be configured to behave in several ways. Each Priority Level gets its own isolated concurrency pool. Priority levels also introduce the concept of queuing requests that cannot be serviced immediately.
|
||||
3. To prevent any one user or namespace from monopolizing a Priority Level, they may be configured to have multiple queues. [“Shuffle Sharding”](https://aws.amazon.com/builders-library/workload-isolation-using-shuffle-sharding/#What_is_shuffle_sharding.3F) is used to assign each flow of requests to a subset of the queues.
|
||||
4. Finally, when there is capacity to service a request, a [“Fair Queuing”](https://en.wikipedia.org/wiki/Fair_queuing) algorithm is used to select the next request. Within each priority level the queues compete with even fairness.
|
||||
|
||||
Early results have been very promising! Take a look at this [analysis](https://github.com/kubernetes/kubernetes/pull/88177#issuecomment-588945806).
|
||||
|
||||
## How do I try this out?
|
||||
You are required to prepare the following things in order to try out the feature:
|
||||
|
||||
* Download and install a kubectl greater than v1.18.0 version
|
||||
* Enabling the new API groups with the command line flag `--runtime-config="flowcontrol.apiserver.k8s.io/v1alpha1=true"` on the kube-apiservers
|
||||
* Switch on the feature gate with the command line flag `--feature-gates=APIPriorityAndFairness=true` on the kube-apiservers
|
||||
|
||||
After successfully starting your kube-apiservers, you will see a few default FlowSchema and PriorityLevelConfiguration resources in the cluster. These default configurations are designed for a general protection and traffic management for your cluster.
|
||||
You can examine and customize the default configuration by running the usual tools, e.g.:
|
||||
|
||||
* `kubectl get flowschemas`
|
||||
* `kubectl get prioritylevelconfigurations`
|
||||
|
||||
|
||||
## How does this work under the hood?
|
||||
Upon arrival at the handler, a request is assigned to exactly one priority level and exactly one flow within that priority level. Hence understanding how FlowSchema and PriorityLevelConfiguration works will be helping you manage the request traffic going through your kube-apiservers.
|
||||
|
||||
* FlowSchema: FlowSchema will identify a PriorityLevelConfiguration object and the way to compute the request’s “flow identifier”. Currently we support matching requests according to: the identity making the request, the verb, and the target object. The identity can match in terms of: a username, a user group name, or a ServiceAccount. And as for the target objects, we can match by apiGroup, resource[/subresource], and namespace.
|
||||
* The flow identifier is used for shuffle sharding, so it’s important that requests have the same flow identifier if they are from the same source! We like to consider scenarios with “elephants” (which send many/heavy requests) vs “mice” (which send few/light requests): it is important to make sure the elephant’s requests all get the same flow identifier, otherwise they will look like many different mice to the system!
|
||||
* See the API Documentation [here](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#flowschema-v1alpha1-flowcontrol-apiserver-k8s-io)!
|
||||
|
||||
* PriorityLevelConfiguration: Defines a priority level.
|
||||
* For apiserver self requests, and any reentrant traffic (e.g., admission webhooks which themselves make API requests), a Priority Level can be marked “exempt”, which means that no queueing or limiting of any sort is done. This is to prevent priority inversions.
|
||||
* Each non-exempt Priority Level is configured with a number of "concurrency shares" and gets an isolated pool of concurrency to use. Requests of that Priority Level run in that pool when it is not full, never anywhere else. Each apiserver is configured with a total concurrency limit (taken to be the sum of the old limits on mutating and readonly requests), and this is then divided among the Priority Levels in proportion to their concurrency shares.
|
||||
* A non-exempt Priority Level may select a number of queues and a "hand size" to use for the shuffle sharding. Shuffle sharding maps flows to queues in a way that is better than consistent hashing. A given flow has access to a small collection of queues, and for each incoming request the shortest queue is chosen. When a Priority Level has queues, it also sets a limit on queue length. There is also a limit placed on how long a request can wait in its queue; this is a fixed fraction of the apiserver's request timeout. A request that cannot be executed and cannot be queued (any longer) is rejected.
|
||||
* Alternatively, a non-exempt Priority Level may select immediate rejection instead of waiting in a queue.
|
||||
* See the [API documentation](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#prioritylevelconfiguration-v1alpha1-flowcontrol-apiserver-k8s-io) for this feature.
|
||||
|
||||
## What’s missing? When will there be a beta?
|
||||
We’re already planning a few enhancements based on alpha and there will be more as users send feedback to our community. Here’s a list of them:
|
||||
|
||||
* Traffic management for WATCH and EXEC requests
|
||||
* Adjusting and improving the default set of FlowSchema/PriorityLevelConfiguration
|
||||
* Enhancing observability on how this feature works
|
||||
* Join the discussion [here](https://github.com/kubernetes/enhancements/pull/1632)
|
||||
|
||||
Possibly treat LIST requests differently depending on an estimate of how big their result will be.
|
||||
|
||||
## How can I get involved?
|
||||
As always! Reach us on slack [#sig-api-machinery](https://kubernetes.slack.com/messages/sig-api-machinery), or through the [mailing list](https://groups.google.com/forum/#!forum/kubernetes-sig-api-machinery). We have lots of exciting features to build and can use all sorts of help.
|
||||
|
||||
Many thanks to the contributors that have gotten this feature this far: Aaron Prindle, Daniel Smith, Jonathan Tomer, Mike Spreitzer, Min Kim, Bruce Ma, Yu Liao, Mengyi Zhou!
|
||||
|
|
@ -97,13 +97,28 @@ public networks.
|
|||
|
||||
### SSH Tunnels
|
||||
|
||||
Kubernetes supports SSH tunnels to protect the Master -> Cluster communication
|
||||
Kubernetes supports SSH tunnels to protect the Master → Cluster communication
|
||||
paths. In this configuration, the apiserver initiates an SSH tunnel to each node
|
||||
in the cluster (connecting to the ssh server listening on port 22) and passes
|
||||
all traffic destined for a kubelet, node, pod, or service through the tunnel.
|
||||
This tunnel ensures that the traffic is not exposed outside of the network in
|
||||
which the nodes are running.
|
||||
|
||||
SSH tunnels are currently deprecated so you shouldn't opt to use them unless you know what you are doing. A replacement for this communication channel is being designed.
|
||||
SSH tunnels are currently deprecated so you shouldn't opt to use them unless you
|
||||
know what you are doing. The Konnectivity service is a replacement for this
|
||||
communication channel.
|
||||
|
||||
### Konnectivity service
|
||||
{{< feature-state for_k8s_version="v1.18" state="beta" >}}
|
||||
|
||||
As a replacement to the SSH tunnels, the Konnectivity service provides TCP
|
||||
level proxy for the Master → Cluster communication. The Konnectivity consists of
|
||||
two parts, the Konnectivity server and the Konnectivity agents, running in the
|
||||
Master network and the Cluster network respectively. The Konnectivity agents
|
||||
initiate connections to the Konnectivity server and maintain the connections.
|
||||
All Master → Cluster traffic then goes through these connections.
|
||||
|
||||
See [Konnectivity Service Setup](/docs/tasks/setup-konnectivity/) on how to set
|
||||
it up in your cluster.
|
||||
|
||||
{{% /capture %}}
|
||||
|
|
|
|||
|
|
@ -18,12 +18,12 @@ potentially crashing the API server, but these flags are not enough to ensure
|
|||
that the most important requests get through in a period of high traffic.
|
||||
|
||||
The API Priority and Fairness feature (APF) is an alternative that improves upon
|
||||
aforementioned max-inflight limitations. APF classifies
|
||||
and isolates requests in a more fine-grained way. It also introduces
|
||||
aforementioned max-inflight limitations. APF classifies
|
||||
and isolates requests in a more fine-grained way. It also introduces
|
||||
a limited amount of queuing, so that no requests are rejected in cases
|
||||
of very brief bursts. Requests are dispatched from queues using a
|
||||
fair queuing technique so that, for example, a poorly-behaved {{<
|
||||
glossary_tooltip text="controller" term_id="controller" >}}) need not
|
||||
fair queuing technique so that, for example, a poorly-behaved
|
||||
{{< glossary_tooltip text="controller" term_id="controller" >}} need not
|
||||
starve others (even at the same priority level).
|
||||
|
||||
{{< caution >}}
|
||||
|
|
|
|||
|
|
@ -427,12 +427,20 @@ We'll guide you through how to create and update applications with Deployments.
|
|||
Let's say you were running version 1.14.2 of nginx:
|
||||
|
||||
```shell
|
||||
kubectl run my-nginx --image=nginx:1.14.2 --replicas=3
|
||||
kubectl create deployment my-nginx --image=nginx:1.14.2
|
||||
```
|
||||
```shell
|
||||
deployment.apps/my-nginx created
|
||||
```
|
||||
|
||||
with 3 replicas (so the old and new revisions can coexist):
|
||||
```shell
|
||||
kubectl scale deployment my-nginx --current-replicas=1 --replicas=3
|
||||
```
|
||||
```
|
||||
deployment.apps/my-nginx scaled
|
||||
```
|
||||
|
||||
To update to version 1.16.1, simply change `.spec.template.spec.containers[0].image` from `nginx:1.14.2` to `nginx:1.16.1`, with the kubectl commands we learned above.
|
||||
|
||||
```shell
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ weight: 70
|
|||
|
||||
{{% capture overview %}}
|
||||
|
||||
{{< feature-state for_k8s_version="1.14" state="stable" >}}
|
||||
{{< feature-state for_k8s_version="v1.14" state="stable" >}}
|
||||
|
||||
[Pods](/docs/user-guide/pods) can have _priority_. Priority indicates the
|
||||
importance of a Pod relative to other Pods. If a Pod cannot be scheduled, the
|
||||
|
|
@ -145,7 +145,7 @@ description: "This priority class should be used for XYZ service pods only."
|
|||
|
||||
## Non-preempting PriorityClass {#non-preempting-priority-class}
|
||||
|
||||
{{< feature-state for_k8s_version="1.15" state="alpha" >}}
|
||||
{{< feature-state for_k8s_version="v1.15" state="alpha" >}}
|
||||
|
||||
Pods with `PreemptionPolicy: Never` will be placed in the scheduling queue
|
||||
ahead of lower-priority pods,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ weight: 10
|
|||
|
||||
{{% capture overview %}}
|
||||
|
||||
{{< feature-state for_k8s_version="1.16" state="alpha" >}}
|
||||
{{< feature-state for_k8s_version="v1.16" state="alpha" >}}
|
||||
|
||||
The kube-scheduler can be configured to enable bin packing of resources along with extended resources using `RequestedToCapacityRatioResourceAllocation` priority function. Priority functions can be used to fine-tune the kube-scheduler as per custom needs.
|
||||
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ when there are node problems, which is described in the next section.
|
|||
|
||||
## Taint based Evictions
|
||||
|
||||
{{< feature-state for_k8s_version="1.18" state="stable" >}}
|
||||
{{< feature-state for_k8s_version="v1.18" state="stable" >}}
|
||||
|
||||
Earlier we mentioned the `NoExecute` taint effect, which affects pods that are already
|
||||
running on the node as follows
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ The `Terminating`, `NotTerminating`, and `NotBestEffort` scopes restrict a quota
|
|||
|
||||
### Resource Quota Per PriorityClass
|
||||
|
||||
{{< feature-state for_k8s_version="1.12" state="beta" >}}
|
||||
{{< feature-state for_k8s_version="v1.12" state="beta" >}}
|
||||
|
||||
Pods can be created at a specific [priority](/docs/concepts/configuration/pod-priority-preemption/#pod-priority).
|
||||
You can control a pod's consumption of system resources based on a pod's priority, by using the `scopeSelector`
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ weight: 70
|
|||
|
||||
{{% capture overview %}}
|
||||
|
||||
{{< feature-state for_k8s_version="1.14" state="beta" >}}
|
||||
{{< feature-state for_k8s_version="v1.14" state="beta" >}}
|
||||
|
||||
[kube-scheduler](/docs/concepts/scheduling/kube-scheduler/#kube-scheduler)
|
||||
is the Kubernetes default scheduler. It is responsible for placement of Pods
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ weight: 60
|
|||
|
||||
{{% capture overview %}}
|
||||
|
||||
{{< feature-state for_k8s_version="1.15" state="alpha" >}}
|
||||
{{< feature-state for_k8s_version="v1.15" state="alpha" >}}
|
||||
|
||||
The scheduling framework is a pluggable architecture for Kubernetes Scheduler
|
||||
that makes scheduler customizations easy. It adds a new set of "plugin" APIs to
|
||||
|
|
|
|||
|
|
@ -534,6 +534,25 @@ to just expose one or more nodes' IPs directly.
|
|||
Note that this Service is visible as `<NodeIP>:spec.ports[*].nodePort`
|
||||
and `.spec.clusterIP:spec.ports[*].port`. (If the `--nodeport-addresses` flag in kube-proxy is set, <NodeIP> would be filtered NodeIP(s).)
|
||||
|
||||
For example:
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: my-service
|
||||
spec:
|
||||
type: NodePort
|
||||
selector:
|
||||
app: MyApp
|
||||
ports:
|
||||
# By default and for convenience, the `targetPort` is set to the same value as the `port` field.
|
||||
- port: 80
|
||||
targetPort: 80
|
||||
# Optional field
|
||||
# By default and for convenience, the Kubernetes control plane will allocate a port from a range (default: 30000-32767)
|
||||
nodePort: 30007
|
||||
```
|
||||
|
||||
### Type LoadBalancer {#loadbalancer}
|
||||
|
||||
On cloud providers which support external load balancers, setting the `type`
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@ This document describes the current state of _persistent volumes_ in Kubernetes.
|
|||
|
||||
Managing storage is a distinct problem from managing compute instances. The PersistentVolume subsystem provides an API for users and administrators that abstracts details of how storage is provided from how it is consumed. To do this, we introduce two new API resources: PersistentVolume and PersistentVolumeClaim.
|
||||
|
||||
A PersistentVolume (PV) is a piece of storage in the cluster that has been provisioned by an administrator or dynamically provisioned using [Storage Classes](/docs/concepts/storage/storage-classes/). It is a resource in the cluster just like a node is a cluster resource. PVs are volume plugins like Volumes, but have a lifecycle independent of any individual Pod that uses the PV. This API object captures the details of the implementation of the storage, be that NFS, iSCSI, or a cloud-provider-specific storage system.
|
||||
A _PersistentVolume_ (PV) is a piece of storage in the cluster that has been provisioned by an administrator or dynamically provisioned using [Storage Classes](/docs/concepts/storage/storage-classes/). It is a resource in the cluster just like a node is a cluster resource. PVs are volume plugins like Volumes, but have a lifecycle independent of any individual Pod that uses the PV. This API object captures the details of the implementation of the storage, be that NFS, iSCSI, or a cloud-provider-specific storage system.
|
||||
|
||||
A PersistentVolumeClaim (PVC) is a request for storage by a user. It is similar to a Pod. Pods consume node resources and PVCs consume PV resources. Pods can request specific levels of resources (CPU and Memory). Claims can request specific size and access modes (e.g., they can be mounted once read/write or many times read-only).
|
||||
A _PersistentVolumeClaim_ (PVC) is a request for storage by a user. It is similar to a Pod. Pods consume node resources and PVCs consume PV resources. Pods can request specific levels of resources (CPU and Memory). Claims can request specific size and access modes (e.g., they can be mounted once read/write or many times read-only).
|
||||
|
||||
While PersistentVolumeClaims allow a user to consume abstract storage resources, it is common that users need PersistentVolumes with varying properties, such as performance, for different problems. Cluster administrators need to be able to offer a variety of PersistentVolumes that differ in more ways than just size and access modes, without exposing users to the details of how those volumes are implemented. For these needs, there is the _StorageClass_ resource.
|
||||
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ The following plugins support `WaitForFirstConsumer` with pre-created Persistent
|
|||
* All of the above
|
||||
* [Local](#local)
|
||||
|
||||
{{< feature-state state="stable" for_k8s_version="1.17" >}}
|
||||
{{< feature-state state="stable" for_k8s_version="v1.17" >}}
|
||||
[CSI volumes](/docs/concepts/storage/volumes/#csi) are also supported with dynamic provisioning
|
||||
and pre-created PVs, but you'll need to look at the documentation for a specific CSI driver
|
||||
to see its supported topology keys and examples.
|
||||
|
|
@ -410,7 +410,7 @@ parameters:
|
|||
round-robin-ed across all active zones where Kubernetes cluster has a node.
|
||||
|
||||
{{< note >}}
|
||||
{{< feature-state state="deprecated" for_k8s_version="1.11" >}}
|
||||
{{< feature-state state="deprecated" for_k8s_version="v1.11" >}}
|
||||
This internal provisioner of OpenStack is deprecated. Please use [the external cloud provider for OpenStack](https://github.com/kubernetes/cloud-provider-openstack).
|
||||
{{< /note >}}
|
||||
|
||||
|
|
@ -813,10 +813,10 @@ volumeBindingMode: WaitForFirstConsumer
|
|||
```
|
||||
|
||||
Local volumes do not currently support dynamic provisioning, however a StorageClass
|
||||
should still be created to delay volume binding until pod scheduling. This is
|
||||
should still be created to delay volume binding until Pod scheduling. This is
|
||||
specified by the `WaitForFirstConsumer` volume binding mode.
|
||||
|
||||
Delaying volume binding allows the scheduler to consider all of a pod's
|
||||
Delaying volume binding allows the scheduler to consider all of a Pod's
|
||||
scheduling constraints when choosing an appropriate PersistentVolume for a
|
||||
PersistentVolumeClaim.
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ weight: 20
|
|||
|
||||
{{% capture overview %}}
|
||||
|
||||
{{< feature-state for_k8s_version="1.17" state="beta" >}}
|
||||
{{< feature-state for_k8s_version="v1.17" state="beta" >}}
|
||||
In Kubernetes, a _VolumeSnapshot_ represents a snapshot of a volume on a storage system. This document assumes that you are already familiar with Kubernetes [persistent volumes](/docs/concepts/storage/persistent-volumes/).
|
||||
|
||||
{{% /capture %}}
|
||||
|
|
|
|||
|
|
@ -71,8 +71,8 @@ have some advantages for start-up related code:
|
|||
a mechanism to block or delay app container startup until a set of preconditions are met. Once
|
||||
preconditions are met, all of the app containers in a Pod can start in parallel.
|
||||
* Init containers can securely run utilities or custom code that would otherwise make an app
|
||||
container image less secure. By keeping unnecessary tools separate you can limit the attack
|
||||
surface of your app container image.
|
||||
container image less secure. By keeping unnecessary tools separate you can limit the attack
|
||||
surface of your app container image.
|
||||
|
||||
|
||||
### Examples
|
||||
|
|
@ -245,8 +245,11 @@ init containers. [What's next](#what-s-next) contains a link to a more detailed
|
|||
|
||||
## Detailed behavior
|
||||
|
||||
During the startup of a Pod, each init container starts in order, after the
|
||||
network and volumes are initialized. Each container must exit successfully before
|
||||
During Pod startup, the kubelet delays running init containers until the networking
|
||||
and storage are ready. Then the kubelet runs the Pod's init containers in the order
|
||||
they appear in the Pod's spec.
|
||||
|
||||
Each init container must exit successfully before
|
||||
the next container starts. If a container fails to start due to the runtime or
|
||||
exits with failure, it is retried according to the Pod `restartPolicy`. However,
|
||||
if the Pod `restartPolicy` is set to Always, the init containers use
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ You can use _topology spread constraints_ to control how {{< glossary_tooltip te
|
|||
|
||||
### Enable Feature Gate
|
||||
|
||||
The `EvenPodsSpread` [feature gate] (/docs/reference/command-line-tools-reference/feature-gates/)
|
||||
The `EvenPodsSpread` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
|
||||
must be enabled for the
|
||||
{{< glossary_tooltip text="API Server" term_id="kube-apiserver" >}} **and**
|
||||
{{< glossary_tooltip text="scheduler" term_id="kube-scheduler" >}}.
|
||||
|
|
@ -62,10 +62,10 @@ metadata:
|
|||
name: mypod
|
||||
spec:
|
||||
topologySpreadConstraints:
|
||||
- maxSkew: <integer>
|
||||
topologyKey: <string>
|
||||
whenUnsatisfiable: <string>
|
||||
labelSelector: <object>
|
||||
- maxSkew: <integer>
|
||||
topologyKey: <string>
|
||||
whenUnsatisfiable: <string>
|
||||
labelSelector: <object>
|
||||
```
|
||||
|
||||
You can define one or multiple `topologySpreadConstraint` to instruct the kube-scheduler how to place each incoming Pod in relation to the existing Pods across your cluster. The fields are:
|
||||
|
|
@ -73,8 +73,8 @@ You can define one or multiple `topologySpreadConstraint` to instruct the kube-s
|
|||
- **maxSkew** describes the degree to which Pods may be unevenly distributed. It's the maximum permitted difference between the number of matching Pods in any two topology domains of a given topology type. It must be greater than zero.
|
||||
- **topologyKey** is the key of node labels. If two Nodes are labelled with this key and have identical values for that label, the scheduler treats both Nodes as being in the same topology. The scheduler tries to place a balanced number of Pods into each topology domain.
|
||||
- **whenUnsatisfiable** indicates how to deal with a Pod if it doesn't satisfy the spread constraint:
|
||||
- `DoNotSchedule` (default) tells the scheduler not to schedule it.
|
||||
- `ScheduleAnyway` tells the scheduler to still schedule it while prioritizing nodes that minimize the skew.
|
||||
- `DoNotSchedule` (default) tells the scheduler not to schedule it.
|
||||
- `ScheduleAnyway` tells the scheduler to still schedule it while prioritizing nodes that minimize the skew.
|
||||
- **labelSelector** is used to find matching Pods. Pods that match this label selector are counted to determine the number of Pods in their corresponding topology domain. See [Label Selectors](/docs/concepts/overview/working-with-objects/labels/#label-selectors) for more details.
|
||||
|
||||
You can read more about this field by running `kubectl explain Pod.spec.topologySpreadConstraints`.
|
||||
|
|
@ -160,8 +160,9 @@ There are some implicit conventions worth noting here:
|
|||
- Only the Pods holding the same namespace as the incoming Pod can be matching candidates.
|
||||
|
||||
- Nodes without `topologySpreadConstraints[*].topologyKey` present will be bypassed. It implies that:
|
||||
1. the Pods located on those nodes do not impact `maxSkew` calculation - in the above example, suppose "node1" does not have label "zone", then the 2 Pods will be disregarded, hence the incomingPod will be scheduled into "zoneA".
|
||||
2. the incoming Pod has no chances to be scheduled onto this kind of nodes - in the above example, suppose a "node5" carrying label `{zone-typo: zoneC}` joins the cluster, it will be bypassed due to the absence of label key "zone".
|
||||
|
||||
1. the Pods located on those nodes do not impact `maxSkew` calculation - in the above example, suppose "node1" does not have label "zone", then the 2 Pods will be disregarded, hence the incomingPod will be scheduled into "zoneA".
|
||||
2. the incoming Pod has no chances to be scheduled onto this kind of nodes - in the above example, suppose a "node5" carrying label `{zone-typo: zoneC}` joins the cluster, it will be bypassed due to the absence of label key "zone".
|
||||
|
||||
- Be aware of what will happen if the incomingPod’s `topologySpreadConstraints[*].labelSelector` doesn’t match its own labels. In the above example, if we remove the incoming Pod’s labels, it can still be placed onto "zoneB" since the constraints are still satisfied. However, after the placement, the degree of imbalance of the cluster remains unchanged - it’s still zoneA having 2 Pods which hold label {foo:bar}, and zoneB having 1 Pod which holds label {foo:bar}. So if this is not what you expect, we recommend the workload’s `topologySpreadConstraints[*].labelSelector` to match its own labels.
|
||||
|
||||
|
|
@ -182,7 +183,7 @@ There are some implicit conventions worth noting here:
|
|||
and you know that "zoneC" must be excluded. In this case, you can compose the yaml as below, so that "mypod" will be placed onto "zoneB" instead of "zoneC". Similarly `spec.nodeSelector` is also respected.
|
||||
|
||||
{{< codenew file="pods/topology-spread-constraints/one-constraint-with-nodeaffinity.yaml" >}}
|
||||
|
||||
|
||||
### Cluster-level default constraints
|
||||
|
||||
{{< feature-state for_k8s_version="v1.18" state="alpha" >}}
|
||||
|
|
@ -207,16 +208,16 @@ kind: KubeSchedulerConfiguration
|
|||
|
||||
profiles:
|
||||
pluginConfig:
|
||||
- name: PodTopologySpread
|
||||
args:
|
||||
defaultConstraints:
|
||||
- maxSkew: 1
|
||||
topologyKey: failure-domain.beta.kubernetes.io/zone
|
||||
whenUnsatisfiable: ScheduleAnyway
|
||||
- name: PodTopologySpread
|
||||
args:
|
||||
defaultConstraints:
|
||||
- maxSkew: 1
|
||||
topologyKey: failure-domain.beta.kubernetes.io/zone
|
||||
whenUnsatisfiable: ScheduleAnyway
|
||||
```
|
||||
|
||||
{{< note >}}
|
||||
The score produced by default scheduling constraints might conflict with the
|
||||
The score produced by default scheduling constraints might conflict with the
|
||||
score produced by the
|
||||
[`DefaultPodTopologySpread` plugin](/docs/reference/scheduling/profiles/#scheduling-plugins).
|
||||
It is recommended that you disable this plugin in the scheduling profile when
|
||||
|
|
@ -229,14 +230,14 @@ In Kubernetes, directives related to "Affinity" control how Pods are
|
|||
scheduled - more packed or more scattered.
|
||||
|
||||
- For `PodAffinity`, you can try to pack any number of Pods into qualifying
|
||||
topology domain(s)
|
||||
topology domain(s)
|
||||
- For `PodAntiAffinity`, only one Pod can be scheduled into a
|
||||
single topology domain.
|
||||
single topology domain.
|
||||
|
||||
The "EvenPodsSpread" feature provides flexible options to distribute Pods evenly across different
|
||||
topology domains - to achieve high availability or cost-saving. This can also help on rolling update
|
||||
workloads and scaling out replicas smoothly.
|
||||
See [Motivation](https://github.com/kubernetes/enhancements/blob/master/keps/sig-scheduling/20190221-even-pods-spreading.md#motivation) for more details.
|
||||
See [Motivation](https://github.com/kubernetes/enhancements/blob/master/keps/sig-scheduling/20190221-pod-topology-spread.md#motivation) for more details.
|
||||
|
||||
## Known Limitations
|
||||
|
||||
|
|
|
|||
|
|
@ -4,59 +4,74 @@ title: Contribute to Kubernetes docs
|
|||
linktitle: Contribute
|
||||
main_menu: true
|
||||
weight: 80
|
||||
card:
|
||||
name: contribute
|
||||
weight: 10
|
||||
title: Start contributing
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
|
||||
If you would like to help contribute to the Kubernetes documentation or website,
|
||||
we're happy to have your help! Anyone can contribute, whether you're new to the
|
||||
project or you've been around a long time, and whether you self-identify as a
|
||||
developer, an end user, or someone who just can't stand seeing typos.
|
||||
This website is maintained by [Kubernetes SIG Docs](/docs/contribute/#get-involved-with-sig-docs).
|
||||
|
||||
Kubernetes documentation contributors:
|
||||
|
||||
- Improve existing content
|
||||
- Create new content
|
||||
- Translate the documentation
|
||||
- Manage and publish the documentation parts of the Kubernetes release cycle
|
||||
|
||||
Kubernetes documentation welcomes improvements from all contributors, new and experienced!
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture body %}}
|
||||
|
||||
## Getting Started
|
||||
## Getting started
|
||||
|
||||
Anyone can open an issue describing problems or desired improvements with documentation, or contribute a change with a pull request (PR).
|
||||
Some tasks require more trust and need more access in the Kubernetes organization.
|
||||
See [Participating in SIG Docs](/docs/contribute/participating/) for more details about
|
||||
of roles and permissions.
|
||||
|
||||
Kubernetes documentation resides in a GitHub repository. While we welcome
|
||||
contributions from anyone, you do need basic comfort with git and GitHub to
|
||||
operate effectively in the Kubernetes community.
|
||||
Anyone can open an issue about documentation, or contribute a change with a pull request (PR) to the [`kubernetes/website` GitHub repository](https://github.com/kubernetes/website). You need to be comfortable with [git](https://git-scm.com/) and [GitHub](https://lab.github.com/) to operate effectively in the Kubernetes community.
|
||||
|
||||
To get involved with documentation:
|
||||
|
||||
1. Sign the CNCF [Contributor License Agreement](https://github.com/kubernetes/community/blob/master/CLA.md).
|
||||
2. Familiarize yourself with the [documentation repository](https://github.com/kubernetes/website) and the website's [static site generator](https://gohugo.io).
|
||||
3. Make sure you understand the basic processes for [improving content](https://kubernetes.io/docs/contribute/start/#improve-existing-content) and [reviewing changes](https://kubernetes.io/docs/contribute/start/#review-docs-pull-requests).
|
||||
3. Make sure you understand the basic processes for [opening a pull request](/docs/contribute/new-content/open-a-pr/) and [reviewing changes](/docs/contribute/review/reviewing-prs/).
|
||||
|
||||
## Contributions best practices
|
||||
Some tasks require more trust and more access in the Kubernetes organization.
|
||||
See [Participating in SIG Docs](/docs/contribute/participating/) for more details about
|
||||
roles and permissions.
|
||||
|
||||
- Do write clear and meaningful GIT commit messages.
|
||||
- Make sure to include _Github Special Keywords_ which references the issue and automatically closes the issue when PR is merged.
|
||||
- When you make a small change to a PR like fixing a typo, any style change, or changing grammar. Make sure you squash your commits so that you dont get a large number of commits for a relatively small change.
|
||||
- Make sure you include a nice PR description depicting the code you have changes, why to change a following piece of code and ensuring there is sufficient information for the reviewer to understand your PR.
|
||||
- Additional Readings :
|
||||
- [chris.beams.io/posts/git-commit/](https://chris.beams.io/posts/git-commit/)
|
||||
- [github.com/blog/1506-closing-issues-via-pull-requests ](https://github.com/blog/1506-closing-issues-via-pull-requests )
|
||||
- [davidwalsh.name/squash-commits-git ](https://davidwalsh.name/squash-commits-git )
|
||||
## Your first contribution
|
||||
|
||||
- Read the [Contribution overview](/docs/contribute/new-content/overview/) to learn about the different ways you can contribute.
|
||||
- [Open a pull request using GitHub](/docs/contribute/new-content/new-content/#changes-using-github) to existing documentation and learn more about filing issues in GitHub.
|
||||
- [Review pull requests](/docs/contribute/review/reviewing-prs/) from other Kubernetes community members for accuracy and language.
|
||||
- Read the Kubernetes [content](/docs/contribute/style/content-guide/) and [style guides](/docs/contribute/style/style-guide/) so you can leave informed comments.
|
||||
- Learn how to [use page templates](/docs/contribute/style/page-templates/) and [Hugo shortcodes](/docs/contribute/style/hugo-shortcodes/) to make bigger changes.
|
||||
|
||||
## Next steps
|
||||
|
||||
- Learn to [work from a local clone](/docs/contribute/new-content/new-content/#fork-the-repo) of the repository.
|
||||
- Document [features in a release](/docs/contribute/new-content/new-features/).
|
||||
- Participate in [SIG Docs](/docs/contribute/participating/), and become a [member or reviewer](/docs/contribute/participating/#roles-and-responsibilities).
|
||||
- Start or help with a [localization](/docs/contribute/localization/).
|
||||
|
||||
## Get involved with SIG Docs
|
||||
|
||||
[SIG Docs](/docs/contribute/participating/) is the group of contributors who publish and maintain Kubernetes documentation and the website. Getting involved with SIG Docs is a great way for Kubernetes contributors (feature development or otherwise) to have a large impact on the Kubernetes project.
|
||||
|
||||
SIG Docs communicates with different methods:
|
||||
|
||||
- [Join `#sig-docs` on the Kubernetes Slack instance](http://slack.k8s.io/). Make sure to
|
||||
introduce yourself!
|
||||
- [Join the `kubernetes-sig-docs` mailing list](https://groups.google.com/forum/#!forum/kubernetes-sig-docs),
|
||||
where broader discussions take place and official decisions are recorded.
|
||||
- Join the [weekly SIG Docs video meeting](https://github.com/kubernetes/community/tree/master/sig-docs). Meetings are always announced on `#sig-docs` and added to the [Kubernetes community meetings calendar](https://calendar.google.com/calendar/embed?src=cgnt364vd8s86hr2phapfjc6uk%40group.calendar.google.com&ctz=America/Los_Angeles). You'll need to download the [Zoom client](https://zoom.us/download) or dial in using a phone.
|
||||
|
||||
## Other ways to contribute
|
||||
|
||||
- To contribute to the Kubernetes community through online forums like Twitter or Stack Overflow, or learn about local meetups and Kubernetes events, visit the [Kubernetes community site](/community/).
|
||||
- To contribute to feature development, read the [contributor cheatsheet](https://github.com/kubernetes/community/tree/master/contributors/guide/contributor-cheatsheet) to get started.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture whatsnext %}}
|
||||
|
||||
- For more information about the basics of contributing to documentation, read [Start contributing](/docs/contribute/start/).
|
||||
- Follow the [Kubernetes documentation style guide](/docs/contribute/style/style-guide/) when proposing changes.
|
||||
- For more information about SIG Docs, read [Participating in SIG Docs](/docs/contribute/participating/).
|
||||
- For more information about localizing Kubernetes docs, read [Localizing Kubernetes documentation](/docs/contribute/localization/).
|
||||
- Visit the [Kubernetes community site](/community/). Participate on Twitter or Stack Overflow, learn about local Kubernetes meetups and events, and more.
|
||||
- Read the [contributor cheatsheet](https://github.com/kubernetes/community/tree/master/contributors/guide/contributor-cheatsheet) to get involved with Kubernetes feature development.
|
||||
- Submit a [blog post or case study](/docs/contribute/new-content/blogs-case-studies/).
|
||||
|
||||
{{% /capture %}}
|
||||
|
|
|
|||
|
|
@ -2,14 +2,14 @@
|
|||
title: Advanced contributing
|
||||
slug: advanced
|
||||
content_template: templates/concept
|
||||
weight: 30
|
||||
weight: 98
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
|
||||
This page assumes that you've read and mastered the
|
||||
[Start contributing](/docs/contribute/start/) and
|
||||
[Intermediate contributing](/docs/contribute/intermediate/) topics and are ready
|
||||
This page assumes that you understand how to
|
||||
[contribute to new content](/docs/contribute/new-content/overview) and
|
||||
[review others' work](/docs/contribute/review/reviewing-prs/), and are ready
|
||||
to learn about more ways to contribute. You need to use the Git command line
|
||||
client and other tools for some of these tasks.
|
||||
|
||||
|
|
@ -19,7 +19,7 @@ client and other tools for some of these tasks.
|
|||
|
||||
## Be the PR Wrangler for a week
|
||||
|
||||
SIG Docs [approvers](/docs/contribute/participating/#approvers) take regular turns as the PR wrangler for the repository and are added to the [PR Wrangler rotation scheduler](https://github.com/kubernetes/website/wiki/PR-Wranglers#2019-schedule-q1q2) for weekly rotations.
|
||||
SIG Docs [approvers](/docs/contribute/participating/#approvers) take week-long turns [wrangling PRs](https://github.com/kubernetes/website/wiki/PR-Wranglers) for the repository.
|
||||
|
||||
The PR wrangler’s duties include:
|
||||
|
||||
|
|
@ -37,9 +37,9 @@ The PR wrangler’s duties include:
|
|||
- Assign `Docs Review` and `Tech Review` labels to indicate the PR's review status.
|
||||
- Assign`Needs Doc Review` or `Needs Tech Review` for PRs that haven't yet been reviewed.
|
||||
- Assign `Doc Review: Open Issues` or `Tech Review: Open Issues` for PRs that have been reviewed and require further input or action before merging.
|
||||
- Assign `/lgtm` and `/approve` labels to PRs that can be merged.
|
||||
- Assign `/lgtm` and `/approve` labels to PRs that can be merged.
|
||||
- Merge PRs when they are ready, or close PRs that shouldn’t be accepted.
|
||||
- Triage and tag incoming issues daily. See [Intermediate contributing](/docs/contribute/intermediate/) for guidelines on how SIG Docs uses metadata.
|
||||
- Triage and tag incoming issues daily. See [Triage and categorize issues](/docs/contribute/review/for-approvers/#triage-and-categorize-issues) for guidelines on how SIG Docs uses metadata.
|
||||
|
||||
### Helpful GitHub queries for wranglers
|
||||
|
||||
|
|
@ -60,9 +60,9 @@ reviewed is usually small. These queries specifically exclude localization PRs,
|
|||
|
||||
### When to close Pull Requests
|
||||
|
||||
Reviews and approvals are one tool to keep our PR queue short and current. Another tool is closure.
|
||||
Reviews and approvals are one tool to keep our PR queue short and current. Another tool is closure.
|
||||
|
||||
- Close any PR where the CLA hasn’t been signed for two weeks.
|
||||
- Close any PR where the CLA hasn’t been signed for two weeks.
|
||||
PR authors can reopen the PR after signing the CLA, so this is a low-risk way to make sure nothing gets merged without a signed CLA.
|
||||
|
||||
- Close any PR where the author has not responded to comments or feedback in 2 or more weeks.
|
||||
|
|
@ -82,7 +82,7 @@ An automated service, [`fejta-bot`](https://github.com/fejta-bot) automatically
|
|||
SIG Docs [members](/docs/contribute/participating/#members) can propose improvements.
|
||||
|
||||
After you've been contributing to the Kubernetes documentation for a while, you
|
||||
may have ideas for improvement to the [Style Guide](/docs/contribute/style/style-guide/)
|
||||
may have ideas for improving the [Style Guide](/docs/contribute/style/style-guide/)
|
||||
, the [Content Guide](/docs/contribute/style/content-guide/), the toolchain used to build
|
||||
the documentation, the website style, the processes for reviewing and merging
|
||||
pull requests, or other aspects of the documentation. For maximum transparency,
|
||||
|
|
@ -134,21 +134,21 @@ rotated among SIG Docs approvers.
|
|||
## Serve as a New Contributor Ambassador
|
||||
|
||||
SIG Docs [approvers](/docs/contribute/participating/#approvers) can serve as
|
||||
New Contributor Ambassadors.
|
||||
New Contributor Ambassadors.
|
||||
|
||||
New Contributor Ambassadors work together to welcome new contributors to SIG-Docs,
|
||||
New Contributor Ambassadors welcome new contributors to SIG-Docs,
|
||||
suggest PRs to new contributors, and mentor new contributors through their first
|
||||
few PR submissions.
|
||||
few PR submissions.
|
||||
|
||||
Responsibilities for New Contributor Ambassadors include:
|
||||
Responsibilities for New Contributor Ambassadors include:
|
||||
|
||||
- Being available on the [Kubernetes #sig-docs channel](https://kubernetes.slack.com) to answer questions from new contributors.
|
||||
- Working with PR wranglers to identify good first issues for new contributors.
|
||||
- Mentoring new contributors through their first few PRs to the docs repo.
|
||||
- Monitoring the [#sig-docs Slack channel](https://kubernetes.slack.com) for questions from new contributors.
|
||||
- Working with PR wranglers to identify good first issues for new contributors.
|
||||
- Mentoring new contributors through their first few PRs to the docs repo.
|
||||
- Helping new contributors create the more complex PRs they need to become Kubernetes members.
|
||||
- [Sponsoring contributors](/docs/contribute/advanced/#sponsor-a-new-contributor) on their path to becoming Kubernetes members.
|
||||
- [Sponsoring contributors](/docs/contribute/advanced/#sponsor-a-new-contributor) on their path to becoming Kubernetes members.
|
||||
|
||||
Current New Contributor Ambassadors are announced at each SIG-Docs meeting, and in the [Kubernetes #sig-docs channel](https://kubernetes.slack.com).
|
||||
Current New Contributor Ambassadors are announced at each SIG-Docs meeting, and in the [Kubernetes #sig-docs channel](https://kubernetes.slack.com).
|
||||
|
||||
## Sponsor a new contributor
|
||||
|
||||
|
|
@ -180,12 +180,12 @@ Approvers must meet the following requirements to be a co-chair:
|
|||
- Have been a SIG Docs approver for at least 6 months
|
||||
- Have [led a Kubernetes docs release](/docs/contribute/advanced/#coordinate-docs-for-a-kubernetes-release) or shadowed two releases
|
||||
- Understand SIG Docs workflows and tooling: git, Hugo, localization, blog subproject
|
||||
- Understand how other Kubernetes SIGs and repositories affect the SIG Docs workflow, including: [teams in k/org](https://github.com/kubernetes/org/blob/master/config/kubernetes/sig-docs/teams.yaml), [process in k/community](https://github.com/kubernetes/community/tree/master/sig-docs), plugins in [k/test-infra](https://github.com/kubernetes/test-infra/), and the role of [SIG Architecture](https://github.com/kubernetes/community/tree/master/sig-architecture).
|
||||
- Understand how other Kubernetes SIGs and repositories affect the SIG Docs workflow, including: [teams in k/org](https://github.com/kubernetes/org/blob/master/config/kubernetes/sig-docs/teams.yaml), [process in k/community](https://github.com/kubernetes/community/tree/master/sig-docs), plugins in [k/test-infra](https://github.com/kubernetes/test-infra/), and the role of [SIG Architecture](https://github.com/kubernetes/community/tree/master/sig-architecture).
|
||||
- Commit at least 5 hours per week (and often more) to the role for a minimum of 6 months
|
||||
|
||||
### Responsibilities
|
||||
|
||||
The role of co-chair is primarily one of service: co-chairs handle process and policy, schedule and run meetings, schedule PR wranglers, and generally do the things that no one else wants to do in order to build contributor capacity.
|
||||
The role of co-chair is one of service: co-chairs build contributor capacity, handle process and policy, schedule and run meetings, schedule PR wranglers, advocate for docs in the Kubernetes community, make sure that docs succeed in Kubernetes release cycles, and keep SIG Docs focused on effective priorities.
|
||||
|
||||
Responsibilities include:
|
||||
|
||||
|
|
@ -228,7 +228,7 @@ For weekly meetings, copypaste the previous week's notes into the "Past meetings
|
|||
|
||||
**Honor folks' time**:
|
||||
|
||||
- Begin and end meetings punctually
|
||||
Begin and end meetings on time.
|
||||
|
||||
**Use Zoom effectively**:
|
||||
|
||||
|
|
@ -240,9 +240,9 @@ For weekly meetings, copypaste the previous week's notes into the "Past meetings
|
|||
### Recording meetings on Zoom
|
||||
|
||||
When you’re ready to start the recording, click Record to Cloud.
|
||||
|
||||
|
||||
When you’re ready to stop recording, click Stop.
|
||||
|
||||
The video uploads automatically to YouTube.
|
||||
|
||||
{{% /capture %}}
|
||||
{{% /capture %}}
|
||||
|
|
@ -1,967 +0,0 @@
|
|||
---
|
||||
title: Intermediate contributing
|
||||
slug: intermediate
|
||||
content_template: templates/concept
|
||||
weight: 20
|
||||
card:
|
||||
name: contribute
|
||||
weight: 50
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
|
||||
This page assumes that you've read and mastered the tasks in the
|
||||
[start contributing](/docs/contribute/start/) topic and are ready to
|
||||
learn about more ways to contribute.
|
||||
|
||||
{{< note >}}
|
||||
Some tasks require you to use the Git command line client and other tools.
|
||||
{{< /note >}}
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture body %}}
|
||||
|
||||
Now that you've gotten your feet wet and helped out with the Kubernetes docs in
|
||||
the ways outlined in the [start contributing](/docs/contribute/start/) topic,
|
||||
you may feel ready to do more. These tasks assume that you have, or are willing
|
||||
to gain, deeper knowledge of the following topic areas:
|
||||
|
||||
- Kubernetes concepts
|
||||
- Kubernetes documentation workflows
|
||||
- Where and how to find information about upcoming Kubernetes features
|
||||
- Strong research skills in general
|
||||
|
||||
These tasks are not as sequential as the beginner tasks. There is no expectation
|
||||
that one person does all of them all of the time.
|
||||
|
||||
## Learn about Prow
|
||||
|
||||
[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. You can perform a variety of actions such as [adding and removing
|
||||
labels](#add-and-remove-labels), closing issues, and assigning an approver. Type
|
||||
the Prow command into a comment field using the `/<command-name>` format. Some common
|
||||
commands are:
|
||||
|
||||
- `/lgtm` (looks good to me): adds the `lgtm` label, signalling that a reviewer has finished reviewing the PR
|
||||
- `/approve`: approves a PR so it can merge (approver use only)
|
||||
- `/assign`: assigns a person to review or approve a PR
|
||||
- `/close`: closes an issue or PR
|
||||
- `/hold`: adds the `do-not-merge/hold` label, indicating the PR cannot be automatically merged
|
||||
- `/hold cancel`: removes the `do-not-merge/hold` label
|
||||
|
||||
{{% note %}}
|
||||
Not all commands are available to every user. The Prow bot will tell you if you
|
||||
try to execute a command beyond your authorization level.
|
||||
{{% /note %}}
|
||||
|
||||
Familiarize yourself with the [list of Prow
|
||||
commands](https://prow.k8s.io/command-help) before you review PRs or triage issues.
|
||||
|
||||
|
||||
## Review pull requests
|
||||
|
||||
In any given week, a specific docs approver volunteers to do initial triage
|
||||
and review of [pull requests and issues](#triage-and-categorize-issues). This
|
||||
person is the "PR Wrangler" for the week. The schedule is maintained using the
|
||||
[PR Wrangler scheduler](https://github.com/kubernetes/website/wiki/PR-Wranglers).
|
||||
To be added to this list, 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, an automated system comments on each new PR and
|
||||
suggests reviewers and approvers for the PR, based on the list of approvers and
|
||||
reviewers in the affected files. The PR author is expected to follow the
|
||||
guidance of the bot, and this also helps PRs to get reviewed quickly.
|
||||
|
||||
We want to get pull requests (PRs) merged and published as quickly as possible.
|
||||
To ensure the docs are accurate and up to date, each PR needs to be reviewed by
|
||||
people who understand the content, as well as people with experience writing
|
||||
great documentation.
|
||||
|
||||
Reviewers and approvers need to provide actionable and constructive feedback to
|
||||
keep contributors engaged and help them to improve. Sometimes helping a new
|
||||
contributor get their PR ready to merge takes more time than just rewriting it
|
||||
yourself, but the project is better in the long term when we have a diversity of
|
||||
active participants.
|
||||
|
||||
Before you start reviewing PRs, make sure you are familiar with the
|
||||
[Documentation Content Guide](/docs/contribute/style/content-guide/), the
|
||||
[Documentation Style Guide](/docs/contribute/style/style-guide/),
|
||||
and the [code of conduct](/community/code-of-conduct/).
|
||||
|
||||
### Find a PR to review
|
||||
|
||||
To see all open PRs, go to the **Pull Requests** tab in the GitHub repository.
|
||||
A PR is eligible for review when it meets all of the following criteria:
|
||||
|
||||
- Has the `cncf-cla:yes` tag
|
||||
- Does not have WIP in the description
|
||||
- Does not a have tag including the phrase `do-not-merge`
|
||||
- Has no merge conflicts
|
||||
- Is based against the correct branch (usually `master` unless the PR relates to
|
||||
a feature that has not yet been released)
|
||||
- Is not being actively reviewed by another docs person (other technical
|
||||
reviewers are fine), unless that person has explicitly asked for your help. In
|
||||
particular, leaving lots of new comments after other review cycles have
|
||||
already been completed on a PR can be discouraging and counter-productive.
|
||||
|
||||
If a PR is not eligible to merge, leave a comment to let the author know about
|
||||
the problem and offer to help them fix it. If they've been informed and have not
|
||||
fixed the problem in several weeks or months, eventually their PR will be closed
|
||||
without merging.
|
||||
|
||||
If you're new to reviewing, or you don't have a lot of bandwidth, look for PRs
|
||||
with the `size/XS` or `size/S` tag set. The size is automatically determined by
|
||||
the number of lines the PR changes.
|
||||
|
||||
#### Reviewers and approvers
|
||||
|
||||
The Kubernetes website repo operates differently than some of the Kubernetes
|
||||
code repositories when it comes to the roles of reviewers and approvers. For
|
||||
more information about the responsibilities of reviewers and approvers, see
|
||||
[Participating](/docs/contribute/participating/). Here's an overview.
|
||||
|
||||
- A reviewer reviews pull request content for technical accuracy. A reviewer
|
||||
indicates that a PR is technically accurate by leaving a `/lgtm` comment on
|
||||
the PR.
|
||||
|
||||
{{< note >}}Don't add a `/lgtm` unless you are confident in the technical
|
||||
accuracy of the documentation modified or introduced in the PR.{{< /note >}}
|
||||
|
||||
- An approver reviews pull request content for docs quality and adherence to
|
||||
SIG Docs guidelines found in the Content and Style guides. Only people listed as
|
||||
approvers in the
|
||||
[`OWNERS`](https://github.com/kubernetes/website/blob/master/OWNERS) file can
|
||||
approve a PR. To approve a PR, leave an `/approve` comment on the PR.
|
||||
|
||||
A PR is merged when it has both a `/lgtm` comment from anyone in the Kubernetes
|
||||
organization and an `/approve` comment from an approver in the
|
||||
`sig-docs-maintainers` group, as long as it is not on hold and the PR author
|
||||
has signed the CLA.
|
||||
|
||||
{{< note >}}
|
||||
|
||||
The ["Participating"](/docs/contribute/participating/#approvers) section contains more information for reviewers and approvers, including specific responsibilities for approvers.
|
||||
|
||||
{{< /note >}}
|
||||
|
||||
### Review a PR
|
||||
|
||||
1. Read the PR description and read any attached issues or links, if
|
||||
applicable. "Drive-by reviewing" is sometimes more harmful than helpful, so
|
||||
make sure you have the right knowledge to provide a meaningful review.
|
||||
|
||||
2. If someone else is the best person to review this particular PR, let them
|
||||
know by adding a comment with `/assign @<github-username>`. If you have
|
||||
asked a non-docs person for technical review but still want to review the PR
|
||||
from a docs point of view, keep going.
|
||||
|
||||
3. Go to the **Files changed** tab. Look over all the changed lines. Removed
|
||||
content has a red background, and those lines also start with a `-` symbol.
|
||||
Added content has a green background, and those lines also start with a `+`
|
||||
symbol. Within a line, the actual modified content has a slightly darker
|
||||
green background than the rest of the line.
|
||||
|
||||
- Especially if the PR uses tricky formatting or changes CSS, Javascript,
|
||||
or other site-wide elements, you can preview the website with the PR
|
||||
applied. Go to the **Conversation** tab and click the **Details** link
|
||||
for the `deploy/netlify` test, near the bottom of the page. It opens in
|
||||
the same browser window by default, so open it in a new window so you
|
||||
don't lose your partial review. Switch back to the **Files changed** tab
|
||||
to resume your review.
|
||||
- Make sure the PR complies with the Content and Style guides; link the
|
||||
author to the relevant part of the guide(s) if it doesn't.
|
||||
- If you have a question, comment, or other feedback about a given
|
||||
change, hover over a line and click the blue-and-white `+` symbol that
|
||||
appears. Type your comment and click **Start a review**.
|
||||
- If you have more comments, leave them in the same way.
|
||||
- By convention, if you see a small problem that does not have to do with
|
||||
the main purpose of the PR, such as a typo or whitespace error, you can
|
||||
call it out, prefixing your comment with `nit:` so that the author knows
|
||||
you consider it trivial. They should still address it.
|
||||
- When you've reviewed everything, or if you didn't have any comments, go
|
||||
back to the top of the page and click **Review changes**. Choose either
|
||||
**Comment** or **Request Changes**. Add a summary of your review, and
|
||||
add appropriate
|
||||
[Prow commands](https://prow.k8s.io/command-help) to separate lines in
|
||||
the Review Summary field. SIG Docs follows the
|
||||
[Kubernetes code review process](https://github.com/kubernetes/community/blob/master/contributors/guide/owners.md#the-code-review-process).
|
||||
All of your comments will be sent to the PR author in a single
|
||||
notification.
|
||||
|
||||
- If you think the PR is ready to be merged, add the text `/approve` to
|
||||
your summary.
|
||||
- If the PR does not need additional technical review, add the
|
||||
text `/lgtm` as well.
|
||||
- If the PR *does* need additional technical review, add the text
|
||||
`/assign` with the GitHub username of the person who needs to
|
||||
provide technical review. Look at the `reviewers` field in the
|
||||
front-matter at the top of a given Markdown file to see who can
|
||||
provide technical review.
|
||||
- To prevent the PR from being merged, add `/hold`. This sets the
|
||||
label `do-not-merge/hold`.
|
||||
- If a PR has no conflicts and has the `lgtm` and `approve` labels but
|
||||
no `hold` label, it is merged automatically.
|
||||
- If a PR has the `lgtm` and/or `approve` labels and new changes are
|
||||
detected, these labels are removed automatically.
|
||||
|
||||
See
|
||||
[the list of all available slash commands](https://prow.k8s.io/command-help)
|
||||
that can be used in PRs.
|
||||
|
||||
- If you previously selected **Request changes** and the PR author has
|
||||
addressed your concerns, you can change your review status either in the
|
||||
**Files changed** tab or at the bottom of the **Conversation** tab. Be
|
||||
sure to add the `/approve` tag and assign technical reviewers if necessary,
|
||||
so that the PR can be merged.
|
||||
|
||||
### Commit into another person's PR
|
||||
|
||||
Leaving PR comments is helpful, but there may be times when you need to commit
|
||||
into another person's PR, rather than just leaving a review.
|
||||
|
||||
Resist the urge to "take over" for another person unless they explicitly ask
|
||||
you to, or you want to resurrect a long-abandoned PR. While it may be faster
|
||||
in the short term, it deprives the person of the chance to contribute.
|
||||
|
||||
The process you use depends on whether you need to edit a file that is already
|
||||
in the scope of the PR or a file that the PR has not yet touched.
|
||||
|
||||
You can't commit into someone else's PR if either of the following things is
|
||||
true:
|
||||
|
||||
- If the PR author pushed their branch directly to the
|
||||
[https://github.com/kubernetes/website/](https://github.com/kubernetes/website/)
|
||||
repository, only a reviewer with push access can commit into their PR.
|
||||
Authors should be encouraged to push their branch to their fork before
|
||||
opening the PR.
|
||||
- If the PR author explicitly disallowed edits from approvers, you can't
|
||||
commit into their PR unless they change this setting.
|
||||
|
||||
#### If the file is already changed by the PR
|
||||
|
||||
This method uses the GitHub UI. If you prefer, you can use the command line
|
||||
even if the file you want to change is part of the PR, if you are more
|
||||
comfortable working that way.
|
||||
|
||||
1. Click the **Files changed** tab.
|
||||
2. Scroll down to the file you want to edit, and click the pencil icon for
|
||||
that file.
|
||||
3. Make your changes, add a commit message in the field below the editor, and
|
||||
click **Commit changes**.
|
||||
|
||||
Your commit is now pushed to the branch the PR represents (probably on the
|
||||
author's fork) and now shows up in the PR and your changes are reflected in
|
||||
the **Files changed** tab. Leave a comment letting the PR author know you
|
||||
changed the PR.
|
||||
|
||||
If the author is using the command line rather than the GitHub UI to work on
|
||||
this PR, they need to fetch their fork's changes and rebase their local branch
|
||||
on the branch in their fork, before doing additional work on the PR.
|
||||
|
||||
#### If the file has not yet been changed by the PR
|
||||
|
||||
If changes need to be made to a file that is not yet included in the PR, you
|
||||
need to use the command line. You can always use this method, if you prefer it
|
||||
to the GitHub UI.
|
||||
|
||||
1. Get the URL for the author's fork. You can find it near the bottom of the
|
||||
**Conversation** tab. Look for the text **Add more commits by pushing to**.
|
||||
The first link after this phrase is to the branch, and the second link is
|
||||
to the fork. Copy the second link. Note the name of the branch for later.
|
||||
|
||||
2. Add the fork as a remote. In your terminal, go to your clone of the
|
||||
repository. Decide on a name to give the remote (such as the author's
|
||||
GitHub username), and add the remote using the following syntax:
|
||||
|
||||
```bash
|
||||
git remote add <name> <url-of-fork>
|
||||
```
|
||||
|
||||
3. Fetch the remote. This doesn't change any local files, but updates your
|
||||
clone's notion of the remote's objects (such as branches and tags) and
|
||||
their current state.
|
||||
|
||||
```bash
|
||||
git remote fetch <name>
|
||||
```
|
||||
|
||||
4. Check out the remote branch. This command will fail if you already have a
|
||||
local branch with the same name.
|
||||
|
||||
```bash
|
||||
git checkout <branch-from-PR>
|
||||
```
|
||||
|
||||
5. Make your changes, use `git add` to add them, and commit them.
|
||||
|
||||
6. Push your changes to the author's remote.
|
||||
|
||||
```bash
|
||||
git push <remote-name> <branch-name>
|
||||
```
|
||||
|
||||
7. Go back to the GitHub IU and refresh the PR. Your changes appear. Leave the
|
||||
PR author a comment letting them know you changed the PR.
|
||||
|
||||
If the author is using the command line rather than the GitHub UI to work on
|
||||
this PR, they need to fetch their fork's changes and rebase their local branch
|
||||
on the branch in their fork, before doing additional work on the PR.
|
||||
|
||||
## Work from a local clone
|
||||
|
||||
For changes that require multiple files or changes that involve creating new
|
||||
files or moving files around, working from a local Git clone makes more sense
|
||||
than relying on the GitHub UI. These instructions use the `git` command and
|
||||
assume that you have it installed locally. You can adapt them to use a local
|
||||
graphical Git client instead.
|
||||
|
||||
### Clone the repository
|
||||
|
||||
You only need to clone the repository once per physical system where you work
|
||||
on the Kubernetes documentation.
|
||||
|
||||
1. Create a fork of the `kubernetes/website` repository on GitHub. In your
|
||||
web browser, go to
|
||||
[https://github.com/kubernetes/website](https://github.com/kubernetes/website)
|
||||
and click the **Fork** button. After a few seconds, you are redirected to
|
||||
the URL for your fork, which is `https://github.com/<github_username>/website`.
|
||||
|
||||
2. In a terminal window, use `git clone` to clone the your fork.
|
||||
|
||||
```bash
|
||||
git clone git@github.com/<github_username>/website
|
||||
```
|
||||
|
||||
The new directory `website` is created in your current directory, with
|
||||
the contents of your GitHub repository. Your fork is your `origin`.
|
||||
|
||||
3. Change to the new `website` directory. Set the `kubernetes/website` repository as the `upstream` remote.
|
||||
|
||||
```bash
|
||||
cd website
|
||||
|
||||
git remote add upstream https://github.com/kubernetes/website.git
|
||||
```
|
||||
|
||||
4. Confirm your `origin` and `upstream` repositories.
|
||||
|
||||
```bash
|
||||
git remote -v
|
||||
```
|
||||
|
||||
Output is similar to:
|
||||
|
||||
```bash
|
||||
origin git@github.com:<github_username>/website.git (fetch)
|
||||
origin git@github.com:<github_username>/website.git (push)
|
||||
upstream https://github.com/kubernetes/website (fetch)
|
||||
upstream https://github.com/kubernetes/website (push)
|
||||
```
|
||||
|
||||
### Work on the local repository
|
||||
|
||||
Before you start a new unit of work on your local repository, you need to figure
|
||||
out which branch to base your work on. The answer depends on what you are doing,
|
||||
but the following guidelines apply:
|
||||
|
||||
- For general improvements to existing content, start from `master`.
|
||||
- For new content that is about features that already exist in a released
|
||||
version of Kubernetes, start from `master`.
|
||||
- For long-running efforts that multiple SIG Docs contributors will collaborate on,
|
||||
such as content reorganization, use a specific feature branch created for that
|
||||
effort.
|
||||
- For new content that relates to upcoming but unreleased Kubernetes versions,
|
||||
use the pre-release feature branch created for that Kubernetes version.
|
||||
|
||||
For more guidance, see
|
||||
[Choose which branch to use](/docs/contribute/start/#choose-which-git-branch-to-use).
|
||||
|
||||
After you decide which branch to start your work (or _base it on_, in Git
|
||||
terminology), use the following workflow to be sure your work is based on the
|
||||
most up-to-date version of that branch.
|
||||
|
||||
1. There are three different copies of the repository when you work locally:
|
||||
`local`, `upstream`, and `origin`. Fetch both the `origin` and `upstream` remotes. This
|
||||
updates your cache of the remotes without actually changing any of the copies.
|
||||
|
||||
```bash
|
||||
git fetch origin
|
||||
git fetch upstream
|
||||
```
|
||||
|
||||
This workflow deviates from the one defined in the Community's [GitHub
|
||||
Workflow](https://github.com/kubernetes/community/blob/master/contributors/guide/github-workflow.md).
|
||||
In this workflow, you do not need to merge your local copy of `master` with `upstream/master` before
|
||||
pushing the updates to your fork. That step is not required in
|
||||
`kubernetes/website` because you are basing your branch on the upstream repository.
|
||||
|
||||
2. Create a local working branch based on the most appropriate upstream branch:
|
||||
`upstream/dev-1.xx` for feature developers or `upstream/master` for all other
|
||||
contributors. This example assumes you are basing your work on
|
||||
`upstream/master`. Because you didn't update your local `master` to match
|
||||
`upstream/master` in the previous step, you need to explicitly create your
|
||||
branch off of `upstream/master`.
|
||||
|
||||
```bash
|
||||
git checkout -b <my_new_branch> upstream/master
|
||||
```
|
||||
|
||||
3. With your new branch checked out, make your changes using a text editor.
|
||||
At any time, use the `git status` command to see what you've changed.
|
||||
|
||||
4. When you are ready to submit a pull request, commit your changes. First
|
||||
use `git status` to see what changes need to be added to the changeset.
|
||||
There are two important sections: `Changes staged for commit` and
|
||||
`Changes not staged for commit`. Any files that show up in the latter
|
||||
section under `modified` or `untracked` need to be added if you want them to
|
||||
be part of this commit. For each file that needs to be added, use `git add`.
|
||||
|
||||
```bash
|
||||
git add example-file.md
|
||||
```
|
||||
|
||||
When all your intended changes are included, create a commit using the
|
||||
`git commit` command:
|
||||
|
||||
```bash
|
||||
git commit -m "Your commit message"
|
||||
```
|
||||
|
||||
{{< note >}}
|
||||
Do not reference a GitHub issue or pull request by ID or URL in the
|
||||
commit message. If you do, it will cause that issue or pull request to get
|
||||
a notification every time the commit shows up in a new Git branch. You can
|
||||
link issues and pull requests together later in the GitHub UI.
|
||||
{{< /note >}}
|
||||
|
||||
5. Optionally, you can test your change by staging the site locally using the
|
||||
`hugo` command. See [View your changes locally](#view-your-changes-locally).
|
||||
You'll be able to view your changes after you submit the pull request, as
|
||||
well.
|
||||
|
||||
6. Before you can create a pull request which includes your local commit, you
|
||||
need to push the branch to your fork, which is the endpoint for the `origin`
|
||||
remote.
|
||||
|
||||
```bash
|
||||
git push origin <my_new_branch>
|
||||
```
|
||||
|
||||
Technically, you can omit the branch name from the `push` command, but
|
||||
the behavior in that case depends upon the version of Git you are using.
|
||||
The results are more repeatable if you include the branch name.
|
||||
|
||||
7. Go to https://github.com/kubernetes/website in your web browser. GitHub
|
||||
detects that you pushed a new branch to your fork and offers to create a pull
|
||||
request. Fill in the pull request template.
|
||||
|
||||
- The title should be no more than 50 characters and summarize the intent
|
||||
of the change.
|
||||
- The long-form description should contain more information about the fix,
|
||||
including a line like `Fixes #12345` if the pull request fixes a GitHub
|
||||
issue. This will cause the issue to be closed automatically when the
|
||||
pull request is merged.
|
||||
- You can add labels or other metadata and assign reviewers. See
|
||||
[Triage and categorize issues](#triage-and-categorize-issues) for the
|
||||
syntax.
|
||||
|
||||
Click **Create pull request**.
|
||||
|
||||
8. Several automated tests will run against the state of the website with your
|
||||
changes applied. If any of the tests fail, click the **Details** link for
|
||||
more information. If the Netlify test completes successfully, its
|
||||
**Details** link goes to a staged version of the Kubernetes website with
|
||||
your changes applied. This is how reviewers will check your changes.
|
||||
|
||||
9. When you need to make more changes, address the feedback locally and amend
|
||||
your original commit.
|
||||
|
||||
```bash
|
||||
git commit -a --amend
|
||||
```
|
||||
|
||||
- `-a`: commit all changes
|
||||
- `--amend`: amend the previous commit, rather than creating a new one
|
||||
|
||||
An editor will open so you can update your commit message if necessary.
|
||||
|
||||
If you use `git commit -m` as in Step 4, you will create a new commit rather
|
||||
than amending changes to your original commit. Creating a new commit means
|
||||
you must squash your commits before your pull request can be merged.
|
||||
|
||||
Follow the instructions in Step 6 to push your commit. The commit is added
|
||||
to your pull request and the tests run again, including re-staging the
|
||||
Netlify staged site.
|
||||
|
||||
10. If a reviewer adds changes to your pull request, you need to fetch those
|
||||
changes from your fork before you can add more changes. Use the following
|
||||
commands to do this, assuming that your branch is currently checked out.
|
||||
|
||||
```bash
|
||||
git fetch origin
|
||||
git rebase origin/<your-branch-name>
|
||||
```
|
||||
|
||||
After rebasing, you need to add the `--force-with-lease` flag to
|
||||
force push the branch's new changes to your fork.
|
||||
|
||||
```bash
|
||||
git push --force-with-lease origin <your-branch-name>
|
||||
```
|
||||
|
||||
11. If someone else's change is merged into the branch your work is based on,
|
||||
and you have made changes to the same parts of the same files, a conflict
|
||||
might occur. If the pull request shows that there are conflicts to resolve,
|
||||
you can resolve them using the GitHub UI or you can resolve them locally.
|
||||
|
||||
First, do step 10 to be sure that your fork and your local branch are in
|
||||
the same state.
|
||||
|
||||
Next, fetch `upstream` and rebase your branch on the branch it was
|
||||
originally based on, like `upstream/master`.
|
||||
|
||||
```bash
|
||||
git fetch upstream
|
||||
git rebase upstream/master
|
||||
```
|
||||
|
||||
If there are conflicts Git can't automatically resolve, you can see the
|
||||
conflicted files using the `git status` command. For each conflicted file,
|
||||
edit it and look for the conflict markers `>>>`, `<<<`, and `===`. Resolve
|
||||
the conflict and remove the conflict markers. Then add the changes to the
|
||||
changeset using `git add <filename>` and continue the rebase using
|
||||
`git rebase --continue`. When all commits have been applied and there are
|
||||
no more conflicts, `git status` will show that you are not in a rebase and
|
||||
there are no changes that need to be committed. At that point, force-push
|
||||
the branch to your fork, and the pull request should no longer show any
|
||||
conflicts.
|
||||
|
||||
12. If your PR still has multiple commits after amending previous commits, you
|
||||
must squash multiple commits into a single commit before your PR can be merged.
|
||||
You can check the number of commits on your PR's `Commits` tab or by running
|
||||
`git log` locally. Squashing commits is a form of rebasing.
|
||||
|
||||
```bash
|
||||
git rebase -i HEAD~<number_of_commits>
|
||||
```
|
||||
|
||||
The `-i` switch tells git you want to rebase interactively. This enables
|
||||
you to tell git which commits to squash into the first one. For
|
||||
example, you have 3 commits on your branch:
|
||||
|
||||
```
|
||||
12345 commit 4 (2 minutes ago)
|
||||
6789d commit 3 (30 minutes ago)
|
||||
456df commit 2 (1 day ago)
|
||||
```
|
||||
|
||||
You must squash your last three commits into the first one.
|
||||
|
||||
```
|
||||
git rebase -i HEAD~3
|
||||
```
|
||||
|
||||
That command opens an editor with the following:
|
||||
|
||||
```
|
||||
pick 456df commit 2
|
||||
pick 6789d commit 3
|
||||
pick 12345 commit 4
|
||||
```
|
||||
|
||||
Change `pick` to `squash` on the commits you want to squash, and make sure
|
||||
the one `pick` commit is at the top of the editor.
|
||||
|
||||
```
|
||||
pick 456df commit 2
|
||||
squash 6789d commit 3
|
||||
squash 12345 commit 4
|
||||
```
|
||||
|
||||
Save and close your editor. Then push your squashed
|
||||
commit with `git push --force-with-lease origin <branch_name>`.
|
||||
|
||||
|
||||
If you're having trouble resolving conflicts or you get stuck with
|
||||
anything else related to your pull request, ask for help on the `#sig-docs`
|
||||
Slack channel or the
|
||||
[kubernetes-sig-docs mailing list](https://groups.google.com/forum/#!forum/kubernetes-sig-docs).
|
||||
|
||||
### View your changes locally
|
||||
|
||||
{{< tabs name="tab_with_hugo" >}}
|
||||
{{% tab name="Hugo in a container" %}}
|
||||
|
||||
If you aren't ready to create a pull request but you want to see what your
|
||||
changes look like, you can build and run a docker image to generate all the documentation and
|
||||
serve it locally.
|
||||
|
||||
1. Build the image locally:
|
||||
|
||||
```bash
|
||||
make docker-image
|
||||
```
|
||||
|
||||
2. Once the `kubernetes-hugo` image has been built locally, you can build and serve the site:
|
||||
|
||||
```bash
|
||||
make docker-serve
|
||||
```
|
||||
|
||||
3. In your browser's address bar, enter `localhost:1313`. Hugo will watch the
|
||||
filesystem for changes and rebuild the site as needed.
|
||||
|
||||
4. To stop the local Hugo instance, go back to the terminal and type `Ctrl+C`
|
||||
or just close the terminal window.
|
||||
{{% /tab %}}
|
||||
{{% tab name="Hugo locally" %}}
|
||||
|
||||
Alternatively, you can install and use the `hugo` command on your development machine:
|
||||
|
||||
1. Install the [Hugo](https://gohugo.io/getting-started/installing/) version specified in [`website/netlify.toml`](https://raw.githubusercontent.com/kubernetes/website/master/netlify.toml).
|
||||
|
||||
2. In a terminal, go to the root directory of your clone of the Kubernetes
|
||||
docs, and enter this command:
|
||||
|
||||
```bash
|
||||
hugo server
|
||||
```
|
||||
|
||||
3. In your browser’s address bar, enter `localhost:1313`.
|
||||
|
||||
4. To stop the local Hugo instance, go back to the terminal and type `Ctrl+C`
|
||||
or just close the terminal window.
|
||||
{{% /tab %}}
|
||||
{{< /tabs >}}
|
||||
|
||||
## Triage and categorize issues
|
||||
|
||||
People in SIG Docs are responsible only for triaging and categorizing
|
||||
documentation issues. General website issues are also filed in the
|
||||
`kubernetes/website` repository.
|
||||
|
||||
When you triage an issue, you:
|
||||
|
||||
- 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.
|
||||
- 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)
|
||||
- `priority/critical-urgent` - do this right now
|
||||
- `priority/important-soon` - do this within 3 months
|
||||
- `priority/important-longterm` - do this within 6 months
|
||||
- `priority/backlog` - this can be deferred indefinitely; lowest priority;
|
||||
do this when resources are available
|
||||
- `priority/awaiting-more-evidence` - placeholder for a potentially good issue
|
||||
so it doesn't get lost
|
||||
- Optionally, add a `help` or `good first issue` label if the issue is suitable
|
||||
for someone with very little Kubernetes or SIG Docs experience. Consult
|
||||
[Help Wanted and Good First Issue Labels](https://github.com/kubernetes/community/blob/master/contributors/guide/help-wanted.md)
|
||||
for guidance.
|
||||
- At your discretion, take ownership of an issue and submit a PR for it
|
||||
(especially if it is quick or relates to work you were already doing).
|
||||
|
||||
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 all the issues that need to be triaged.
|
||||
|
||||
If you have questions about triaging an issue, ask in `#sig-docs` on Slack or
|
||||
the [kubernetes-sig-docs mailing list](https://groups.google.com/forum/#!forum/kubernetes-sig-docs).
|
||||
|
||||
### Add and remove labels
|
||||
|
||||
To add a label, leave a comment like `/<label-to-add>` or `/<label-category> <label-to-add>`. The label must
|
||||
already exist. If you try to add a label that does not exist, the command is
|
||||
silently ignored.
|
||||
|
||||
Examples:
|
||||
|
||||
- `/triage needs-information`
|
||||
- `/priority important-soon`
|
||||
- `/language ja`
|
||||
- `/help`
|
||||
- `/good-first-issue`
|
||||
- `/lifecycle frozen`
|
||||
|
||||
To remove a label, leave a comment like `/remove-<label-to-remove>` or `/remove-<label-category> <label-to-remove>`.
|
||||
|
||||
Examples:
|
||||
|
||||
- `/remove-triage needs-information`
|
||||
- `/remove-priority important-soon`
|
||||
- `/remove-language ja`
|
||||
- `/remove-help`
|
||||
- `/remove-good-first-issue`
|
||||
- `/remove-lifecycle frozen`
|
||||
|
||||
The list of all the labels used across Kubernetes is
|
||||
[here](https://github.com/kubernetes/kubernetes/labels). Not all labels
|
||||
are used by SIG Docs.
|
||||
|
||||
### More about labels
|
||||
|
||||
- An issue can have multiple labels.
|
||||
- Some labels use slash notation for grouping, which can be thought of like
|
||||
"sub-labels". For instance, many `sig/` labels exist, such as `sig/cli` and
|
||||
`sig/api-machinery` ([full list](https://github.com/kubernetes/website/labels?utf8=%E2%9C%93&q=sig%2F)).
|
||||
- Some labels are automatically added based on metadata in the files involved
|
||||
in the issue, slash commands used in the comments of the issue, or
|
||||
information in the issue text.
|
||||
- Additional labels are manually added by the person triaging the issue (or the person
|
||||
reporting the issue)
|
||||
- `kind/bug`, `kind/feature`, and `kind/documentation`: A bug is a problem with existing content or
|
||||
functionality, and a feature is a request for new content or functionality.
|
||||
The `kind/documentation` label is seldom used.
|
||||
- `language/ja`, `language/ko` and similar [language
|
||||
labels](https://github.com/kubernetes/website/labels?utf8=%E2%9C%93&q=language)
|
||||
if the issue is about localized content.
|
||||
|
||||
### Issue lifecycle
|
||||
|
||||
Issues are generally opened and closed within a relatively short time span.
|
||||
However, sometimes an issue may not have associated activity after it is
|
||||
created. Other times, an issue may need to remain open for longer than 90 days.
|
||||
|
||||
`lifecycle/stale`: after 90 days with no activity, an issue is automatically
|
||||
labeled as stale. The issue will be automatically closed if the lifecycle is not
|
||||
manually reverted using the `/remove-lifecycle stale` command.
|
||||
|
||||
`lifecycle/frozen`: an issue with this label will not become stale after 90 days
|
||||
of inactivity. A user manually adds this label to issues that need to remain
|
||||
open for much longer than 90 days, such as those with a
|
||||
`priority/important-longterm` label.
|
||||
|
||||
|
||||
### Handling special issue types
|
||||
|
||||
We encounter the following types of issues often enough to document how
|
||||
to handle them.
|
||||
|
||||
#### Duplicate issues
|
||||
|
||||
If a single problem has one or more issues open for it, the problem should be
|
||||
consolidated into a single issue. You should decide which issue to keep open (or
|
||||
open a new issue), port over all relevant information and link related issues.
|
||||
Finally, label all other issues that describe the same problem with
|
||||
`triage/duplicate` and close them. Only having a single issue to work on will
|
||||
help reduce confusion and avoid duplicating work on the same problem.
|
||||
|
||||
#### Dead link issues
|
||||
|
||||
Depending on where the dead link is reported, different actions are required to
|
||||
resolve the issue. Dead links in the API and Kubectl docs are automation issues
|
||||
and should be assigned `/priority critical-urgent` until the problem can be fully understood. All other
|
||||
dead links are issues that need to be manually fixed and can be assigned `/priority important-longterm`.
|
||||
|
||||
#### Blog issues
|
||||
|
||||
[Kubernetes Blog](https://kubernetes.io/blog/) entries are expected to become
|
||||
outdated over time, so we maintain only blog entries that are less than one year old.
|
||||
If an issue is related to a blog entry that is more than one year old, it should be closed
|
||||
without fixing.
|
||||
|
||||
#### Support requests or code bug reports
|
||||
|
||||
Some issues opened for docs are instead issues with the underlying code, or
|
||||
requests for assistance when something (like a tutorial) didn’t work. For issues
|
||||
unrelated to docs, close the issue with the `triage/support` label and a comment
|
||||
directing the requester to support venues (Slack, Stack Overflow) and, if
|
||||
relevant, where to file an issue for bugs with features (kubernetes/kubernetes
|
||||
is a great place to start).
|
||||
|
||||
Sample response to a request for support:
|
||||
|
||||
```none
|
||||
This issue sounds more like a request for support and less
|
||||
like an issue specifically for docs. I encourage you to bring
|
||||
your question to the `#kubernetes-users` channel in
|
||||
[Kubernetes slack](http://slack.k8s.io/). You can also search
|
||||
resources like
|
||||
[Stack Overflow](http://stackoverflow.com/questions/tagged/kubernetes)
|
||||
for answers to similar questions.
|
||||
|
||||
You can also open issues for Kubernetes functionality in
|
||||
https://github.com/kubernetes/kubernetes.
|
||||
|
||||
If this is a documentation issue, please re-open this issue.
|
||||
```
|
||||
|
||||
Sample code bug report response:
|
||||
|
||||
```none
|
||||
This sounds more like an issue with the code than an issue with
|
||||
the documentation. Please open an issue at
|
||||
https://github.com/kubernetes/kubernetes/issues.
|
||||
|
||||
If this is a documentation issue, please re-open this issue.
|
||||
```
|
||||
|
||||
## Document new features
|
||||
|
||||
Each major Kubernetes release includes new features, and many of them need
|
||||
at least a small amount of documentation to show people how to use them.
|
||||
|
||||
Often, the SIG responsible for a feature submits draft documentation for the
|
||||
feature as a pull request to the appropriate release branch of
|
||||
`kubernetes/website` repository, and someone on the SIG Docs team provides
|
||||
editorial feedback or edits the draft directly.
|
||||
|
||||
### Find out about upcoming features
|
||||
|
||||
To find out about upcoming features, attend the weekly sig-release meeting (see
|
||||
the [community](https://kubernetes.io/community/) page for upcoming meetings)
|
||||
and monitor the release-specific documentation
|
||||
in the [kubernetes/sig-release](https://github.com/kubernetes/sig-release/)
|
||||
repository. Each release has a sub-directory under the [/sig-release/tree/master/releases/](https://github.com/kubernetes/sig-release/tree/master/releases)
|
||||
directory. Each sub-directory contains a release schedule, a draft of the release
|
||||
notes, and a document listing each person on the release team.
|
||||
|
||||
- The release schedule contains links to all other documents, meetings,
|
||||
meeting minutes, and milestones relating to the release. It also contains
|
||||
information about the goals and timeline of the release, and any special
|
||||
processes in place for this release. Near the bottom of the document, several
|
||||
release-related terms are defined.
|
||||
|
||||
This document also contains a link to the **Feature tracking sheet**, which is
|
||||
the official way to find out about all new features scheduled to go into the
|
||||
release.
|
||||
- The release team document lists who is responsible for each release role. If
|
||||
it's not clear who to talk to about a specific feature or question you have,
|
||||
either attend the release meeting to ask your question, or contact the release
|
||||
lead so that they can redirect you.
|
||||
- The release notes draft is a good place to find out a little more about
|
||||
specific features, changes, deprecations, and more about the release. The
|
||||
content is not finalized until late in the release cycle, so use caution.
|
||||
|
||||
#### The feature tracking sheet
|
||||
|
||||
The feature tracking sheet
|
||||
[for a given Kubernetes release](https://github.com/kubernetes/sig-release/tree/master/releases) lists each feature that is planned for a release.
|
||||
Each line item includes the name of the feature, a link to the feature's main
|
||||
GitHub issue, its stability level (Alpha, Beta, or Stable), the SIG and
|
||||
individual responsible for implementing it, whether it
|
||||
needs docs, a draft release note for the feature, and whether it has been
|
||||
merged. Keep the following in mind:
|
||||
|
||||
- Beta and Stable features are generally a higher documentation priority than
|
||||
Alpha features.
|
||||
- It's hard to test (and therefore, document) a feature that hasn't been merged,
|
||||
or is at least considered feature-complete in its PR.
|
||||
- Determining whether a feature needs documentation is a manual process and
|
||||
just because a feature is not marked as needing docs doesn't mean it doesn't
|
||||
need them.
|
||||
|
||||
### Document a feature
|
||||
|
||||
As stated above, draft content for new features is usually submitted by the SIG
|
||||
responsible for implementing the new feature. This means that your role may be
|
||||
more of a shepherding role for a given feature than developing the documentation
|
||||
from scratch.
|
||||
|
||||
After you've chosen a feature to document/shepherd, ask about it in the `#sig-docs`
|
||||
Slack channel, in a weekly sig-docs meeting, or directly on the PR filed by the
|
||||
feature SIG. If you're given the go-ahead, you can edit into the PR using one of
|
||||
the techniques described in
|
||||
[Commit into another person's PR](#commit-into-another-persons-pr).
|
||||
|
||||
If you need to write a new topic, the following links are useful:
|
||||
|
||||
- [Writing a New Topic](/docs/contribute/style/write-new-topic/)
|
||||
- [Using Page Templates](/docs/contribute/style/page-templates/)
|
||||
- [Documentation Style Guide](/docs/contribute/style/style-guide/)
|
||||
- [Documentation Content Guide](/docs/contribute/style/content-guide/)
|
||||
|
||||
### SIG members documenting new features
|
||||
|
||||
If you are a member of a SIG developing a new feature for Kubernetes, you need
|
||||
to work with SIG Docs to be sure your feature is documented in time for the
|
||||
release. Check the
|
||||
[feature tracking spreadsheet](https://github.com/kubernetes/sig-release/tree/master/releases)
|
||||
or check in the #sig-release Slack channel to verify scheduling details and
|
||||
deadlines. Some deadlines related to documentation are:
|
||||
|
||||
- **Docs deadline - Open placeholder PRs**: Open a pull request against the
|
||||
`release-X.Y` branch in the `kubernetes/website` repository, with a small
|
||||
commit that you will amend later. Use the Prow command `/milestone X.Y` to
|
||||
assign the PR to the relevant milestone. This alerts the docs person managing
|
||||
this release that the feature docs are coming. If your feature does not need
|
||||
any documentation changes, make sure the sig-release team knows this, by
|
||||
mentioning it in the #sig-release Slack channel. If the feature does need
|
||||
documentation but the PR is not created, the feature may be removed from the
|
||||
milestone.
|
||||
- **Docs deadline - PRs ready for review**: Your PR now needs to contain a first
|
||||
draft of the documentation for your feature. Don't worry about formatting or
|
||||
polishing. Just describe what the feature does and how to use it. The docs
|
||||
person managing the release will work with you to get the content into shape
|
||||
to be published. If your feature needs documentation and the first draft
|
||||
content is not received, the feature may be removed from the milestone.
|
||||
- **Docs complete - All PRs reviewed and ready to merge**: If your PR has not
|
||||
yet been merged into the `release-X.Y` branch by this deadline, work with the
|
||||
docs person managing the release to get it in. If your feature needs
|
||||
documentation and the docs are not ready, the feature may be removed from the
|
||||
milestone.
|
||||
|
||||
If your feature is an Alpha feature and is behind a feature gate, make sure you
|
||||
add it to [Feature gates](/docs/reference/command-line-tools-reference/feature-gates/)
|
||||
as part of your pull request. If your feature is moving to Beta
|
||||
or to General Availability, update the feature gates file.
|
||||
|
||||
## Contribute to other repos
|
||||
|
||||
The [Kubernetes project](https://github.com/kubernetes) contains more than 50
|
||||
individual repositories. Many of these repositories contain code or content that
|
||||
can be considered documentation, such as user-facing help text, error messages,
|
||||
user-facing text in API references, or even code comments.
|
||||
|
||||
If you see text and you aren't sure where it comes from, you can use GitHub's
|
||||
search tool at the level of the Kubernetes organization to search through all
|
||||
repositories for that text. This can help you figure out where to submit your
|
||||
issue or PR.
|
||||
|
||||
Each repository may have its own processes and procedures. Before you file an
|
||||
issue or submit a PR, read that repository's `README.md`, `CONTRIBUTING.md`, and
|
||||
`code-of-conduct.md`, if they exist.
|
||||
|
||||
Most repositories use issue and PR templates. Have a look through some open
|
||||
issues and PRs to get a feel for that team's processes. Make sure to fill out
|
||||
the templates with as much detail as possible when you file issues or PRs.
|
||||
|
||||
## Localize content
|
||||
|
||||
The Kubernetes documentation is written in English first, but we want people to
|
||||
be able to read it in their language of choice. If you are comfortable
|
||||
writing in another language, especially in the software domain, you can help
|
||||
localize the Kubernetes documentation or provide feedback on existing localized
|
||||
content. See [Localization](/docs/contribute/localization/) and ask on the
|
||||
[kubernetes-sig-docs mailing list](https://groups.google.com/forum/#!forum/kubernetes-sig-docs)
|
||||
or in `#sig-docs` on Slack if you are interested in helping out.
|
||||
|
||||
### Working with localized content
|
||||
|
||||
Follow these guidelines for working with localized content:
|
||||
|
||||
- Limit PRs to a single language.
|
||||
|
||||
Each language has its own reviewers and approvers.
|
||||
|
||||
- Reviewers, verify that PRs contain changes to only one language.
|
||||
|
||||
If a PR contains changes to source in more than one language, ask the PR contributor to open separate PRs for each language.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture whatsnext %}}
|
||||
|
||||
When you are comfortable with all of the tasks discussed in this topic and you
|
||||
want to engage with the Kubernetes docs team in even deeper ways, read the
|
||||
[advanced docs contributor](/docs/contribute/advanced/) topic.
|
||||
|
||||
{{% /capture %}}
|
||||
|
|
@ -1,13 +1,14 @@
|
|||
---
|
||||
title: Localizing Kubernetes Documentation
|
||||
title: Localizing Kubernetes documentation
|
||||
content_template: templates/concept
|
||||
approvers:
|
||||
- remyleone
|
||||
- rlenferink
|
||||
- zacharysarah
|
||||
weight: 50
|
||||
card:
|
||||
name: contribute
|
||||
weight: 30
|
||||
weight: 50
|
||||
title: Translating the docs
|
||||
---
|
||||
|
||||
|
|
@ -21,9 +22,9 @@ This page shows you how to [localize](https://blog.mozilla.org/l10n/2011/12/14/i
|
|||
|
||||
## Getting started
|
||||
|
||||
Because contributors can't approve their own pull requests, you need at least two contributors to begin a localization.
|
||||
Because contributors can't approve their own pull requests, you need at least two contributors to begin a localization.
|
||||
|
||||
All localization teams must be self-sustaining with their own resources. We're happy to host your work, but we can't translate it for you.
|
||||
All localization teams must be self-sustaining with their own resources. The Kubernetes website is happy to host your work, but it's up to you to translate it.
|
||||
|
||||
### Find your two-letter language code
|
||||
|
||||
|
|
@ -31,7 +32,7 @@ First, consult the [ISO 639-1 standard](https://www.loc.gov/standards/iso639-2/p
|
|||
|
||||
### Fork and clone the repo
|
||||
|
||||
First, [create your own fork](/docs/contribute/start/#improve-existing-content) of the [kubernetes/website](https://github.com/kubernetes/website) repository.
|
||||
First, [create your own fork](/docs/contribute/new-content/new-content/#fork-the-repo) of the [kubernetes/website](https://github.com/kubernetes/website) repository.
|
||||
|
||||
Then, clone your fork and `cd` into it:
|
||||
|
||||
|
|
@ -42,12 +43,12 @@ cd website
|
|||
|
||||
### Open a pull request
|
||||
|
||||
Next, [open a pull request](/docs/contribute/start/#submit-a-pull-request) (PR) to add a localization to the `kubernetes/website` repository.
|
||||
Next, [open a pull request](/docs/contribute/new-content/open-a-pr/#open-a-pr) (PR) to add a localization to the `kubernetes/website` repository.
|
||||
|
||||
The PR must include all of the [minimum required content](#minimum-required-content) before it can be approved.
|
||||
|
||||
For an example of adding a new localization, see the PR to enable [docs in French](https://github.com/kubernetes/website/pull/12548).
|
||||
|
||||
|
||||
### Join the Kubernetes GitHub organization
|
||||
|
||||
Once you've opened a localization PR, you can become members of the Kubernetes GitHub organization. Each person on the team needs to create their own [Organization Membership Request](https://github.com/kubernetes/org/issues/new/choose) in the `kubernetes/org` repository.
|
||||
|
|
@ -74,7 +75,7 @@ For an example of adding a label, see the PR for adding the [Italian language la
|
|||
|
||||
Let Kubernetes SIG Docs know you're interested in creating a localization! Join the [SIG Docs Slack channel](https://kubernetes.slack.com/messages/C1J0BPD2M/). Other localization teams are happy to help you get started and answer any questions you have.
|
||||
|
||||
You can also create a Slack channel for your localization in the `kubernetes/community` repository. For an example of adding a Slack channel, see the PR for [adding channels for Indonesian and Portuguese](https://github.com/kubernetes/community/pull/3605).
|
||||
You can also create a Slack channel for your localization in the `kubernetes/community` repository. For an example of adding a Slack channel, see the PR for [adding channels for Indonesian and Portuguese](https://github.com/kubernetes/community/pull/3605).
|
||||
|
||||
## Minimum required content
|
||||
|
||||
|
|
@ -105,11 +106,11 @@ Add a language-specific subdirectory to the [`content`](https://github.com/kuber
|
|||
mkdir content/de
|
||||
```
|
||||
|
||||
### Localize the Community Code of Conduct
|
||||
### Localize the community code of conduct
|
||||
|
||||
Open a PR against the [`cncf/foundation`](https://github.com/cncf/foundation/tree/master/code-of-conduct-languages) repository to add the code of conduct in your language.
|
||||
|
||||
### Add a localized README
|
||||
### Add a localized README file
|
||||
|
||||
To guide other localization contributors, add a new [`README-**.md`](https://help.github.com/articles/about-readmes/) to the top level of k/website, where `**` is the two-letter language code. For example, a German README file would be `README-de.md`.
|
||||
|
||||
|
|
@ -192,10 +193,10 @@ mkdir -p content/de/docs/tutorials
|
|||
cp content/en/docs/tutorials/kubernetes-basics.md content/de/docs/tutorials/kubernetes-basics.md
|
||||
```
|
||||
|
||||
Translation tools can speed up the translation process. For example, some editors offers plugins to quickly translate text.
|
||||
Translation tools can speed up the translation process. For example, some editors offers plugins to quickly translate text.
|
||||
|
||||
{{< caution >}}
|
||||
Machine-generated translation alone does not meet the minimum standard of quality and requires extensive human review to meet that standard.
|
||||
Machine-generated translation is insufficient on its own. Localization requires extensive human review to meet minimum standards of quality.
|
||||
{{< /caution >}}
|
||||
|
||||
To ensure accuracy in grammar and meaning, members of your localization team should carefully review all machine-generated translations before publishing.
|
||||
|
|
@ -211,7 +212,7 @@ To find source files for the most recent release:
|
|||
|
||||
The latest version is {{< latest-version >}}, so the most recent release branch is [`{{< release-branch >}}`](https://github.com/kubernetes/website/tree/{{< release-branch >}}).
|
||||
|
||||
### Site strings in i18n/
|
||||
### Site strings in i18n
|
||||
|
||||
Localizations must include the contents of [`i18n/en.toml`](https://github.com/kubernetes/website/blob/master/i18n/en.toml) in a new language-specific file. Using German as an example: `i18n/de.toml`.
|
||||
|
||||
|
|
@ -264,7 +265,7 @@ Teams must merge localized content into the same release branch from which the c
|
|||
|
||||
An approver must maintain a development branch by keeping it current with its source branch and resolving merge conflicts. The longer a development branch stays open, the more maintenance it typically requires. Consider periodically merging development branches and opening new ones, rather than maintaining one extremely long-running development branch.
|
||||
|
||||
At the beginning of every team milestone, it's helpful to open an issue comparing upstream changes between the previous development branch and the current development branch.
|
||||
At the beginning of every team milestone, it's helpful to open an issue [comparing upstream changes](https://github.com/kubernetes/website/blob/master/scripts/upstream_changes.py) between the previous development branch and the current development branch.
|
||||
|
||||
While only approvers can open a new development branch and merge pull requests, anyone can open a pull request for a new development branch. No special permissions are required.
|
||||
|
||||
|
|
@ -272,7 +273,7 @@ For more information about working from forks or directly from the repository, s
|
|||
|
||||
## Upstream contributions
|
||||
|
||||
SIG Docs welcomes [upstream contributions and corrections](/docs/contribute/intermediate#localize-content) to the English source.
|
||||
SIG Docs welcomes upstream contributions and corrections to the English source.
|
||||
|
||||
## Help an existing localization
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
title: Contributing new content
|
||||
weight: 20
|
||||
---
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
---
|
||||
title: Submitting blog posts and case studies
|
||||
linktitle: Blogs and case studies
|
||||
slug: blogs-case-studies
|
||||
content_template: templates/concept
|
||||
weight: 30
|
||||
---
|
||||
|
||||
|
||||
{{% capture overview %}}
|
||||
|
||||
Anyone can write a blog post and submit it for review.
|
||||
Case studies require extensive review before they're approved.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture body %}}
|
||||
|
||||
## Write a blog post
|
||||
|
||||
Blog posts should not be
|
||||
vendor pitches. They must contain content that applies broadly to
|
||||
the Kubernetes community. The SIG Docs [blog subproject](https://github.com/kubernetes/community/tree/master/sig-docs/blog-subproject) manages the review process for blog posts. For more information, see [Submit a post](https://github.com/kubernetes/community/tree/master/sig-docs/blog-subproject#submit-a-post).
|
||||
|
||||
To submit a blog post, you can either:
|
||||
|
||||
- Use the
|
||||
[Kubernetes blog submission form](https://docs.google.com/forms/d/e/1FAIpQLSdMpMoSIrhte5omZbTE7nB84qcGBy8XnnXhDFoW0h7p2zwXrw/viewform)
|
||||
- [Open a pull request](/docs/contribute/new-content/new-content/#fork-the-repo) with a new blog post. Create new blog posts in the [`content/en/blog/_posts`](https://github.com/kubernetes/website/tree/master/content/en/blog/_posts) directory.
|
||||
|
||||
If you open a pull request, ensure that your blog post follows the correct naming conventions and frontmatter information:
|
||||
|
||||
- The markdown file name must follow the format `YYY-MM-DD-Your-Title-Here.md`. For example, `2020-02-07-Deploying-External-OpenStack-Cloud-Provider-With-Kubeadm.md`.
|
||||
- The front matter must include the following:
|
||||
|
||||
```yaml
|
||||
---
|
||||
layout: blog
|
||||
title: "Your Title Here"
|
||||
date: YYYY-MM-DD
|
||||
slug: text-for-URL-link-here-no-spaces
|
||||
---
|
||||
```
|
||||
|
||||
## Submit a case study
|
||||
|
||||
Case studies highlight how organizations are using Kubernetes to solve
|
||||
real-world problems. The Kubernetes marketing team and members of the {{< glossary_tooltip text="CNCF" term_id="cncf" >}} collaborate with you on all case studies.
|
||||
|
||||
Have a look at the source for the
|
||||
[existing case studies](https://github.com/kubernetes/website/tree/master/content/en/case-studies).
|
||||
|
||||
Use the [Kubernetes case study submission form](https://www.cncf.io/people/end-user-community/)
|
||||
to submit your proposal.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture whatsnext %}}
|
||||
|
||||
{{% /capture %}}
|
||||
|
|
@ -0,0 +1,134 @@
|
|||
---
|
||||
title: Documenting a feature for a release
|
||||
linktitle: Documenting for a release
|
||||
content_template: templates/concept
|
||||
main_menu: true
|
||||
weight: 20
|
||||
card:
|
||||
name: contribute
|
||||
weight: 45
|
||||
title: Documenting a feature for a release
|
||||
---
|
||||
{{% capture overview %}}
|
||||
|
||||
Each major Kubernetes release introduces new features that require documentation. New releases also bring updates to existing features and documentation (such as upgrading a feature from alpha to beta).
|
||||
|
||||
Generally, the SIG responsible for a feature submits draft documentation of the
|
||||
feature as a pull request to the appropriate release branch of the
|
||||
`kubernetes/website` repository, and someone on the SIG Docs team provides
|
||||
editorial feedback or edits the draft directly. This section covers the branching
|
||||
conventions and process used during a release by both groups.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture body %}}
|
||||
|
||||
## For documentation contributors
|
||||
|
||||
In general, documentation contributors don't write content from scratch for a release.
|
||||
Instead, they work with the SIG creating a new feature to refine the draft documentation and make it release ready.
|
||||
|
||||
After you've chosen a feature to document or assist, ask about it in the `#sig-docs`
|
||||
Slack channel, in a weekly SIG Docs meeting, or directly on the PR filed by the
|
||||
feature SIG. If you're given the go-ahead, you can edit into the PR using one of
|
||||
the techniques described in
|
||||
[Commit into another person's PR](/docs/contribute/review/for-approvers/#commit-into-another-persons-pr).
|
||||
|
||||
### Find out about upcoming features
|
||||
|
||||
To find out about upcoming features, attend the weekly SIG Release meeting (see
|
||||
the [community](https://kubernetes.io/community/) page for upcoming meetings)
|
||||
and monitor the release-specific documentation
|
||||
in the [kubernetes/sig-release](https://github.com/kubernetes/sig-release/)
|
||||
repository. Each release has a sub-directory in the [/sig-release/tree/master/releases/](https://github.com/kubernetes/sig-release/tree/master/releases)
|
||||
directory. The sub-directory contains a release schedule, a draft of the release
|
||||
notes, and a document listing each person on the release team.
|
||||
|
||||
The release schedule contains links to all other documents, meetings,
|
||||
meeting minutes, and milestones relating to the release. It also contains
|
||||
information about the goals and timeline of the release, and any special
|
||||
processes in place for this release. Near the bottom of the document, several
|
||||
release-related terms are defined.
|
||||
|
||||
This document also contains a link to the **Feature tracking sheet**, which is
|
||||
the official way to find out about all new features scheduled to go into the
|
||||
release.
|
||||
|
||||
The release team document lists who is responsible for each release role. If
|
||||
it's not clear who to talk to about a specific feature or question you have,
|
||||
either attend the release meeting to ask your question, or contact the release
|
||||
lead so that they can redirect you.
|
||||
|
||||
The release notes draft is a good place to find out about
|
||||
specific features, changes, deprecations, and more about the release. The
|
||||
content is not finalized until late in the release cycle, so use caution.
|
||||
|
||||
### Feature tracking sheet
|
||||
|
||||
The feature tracking sheet [for a given Kubernetes release](https://github.com/kubernetes/sig-release/tree/master/releases)
|
||||
lists each feature that is planned for a release.
|
||||
Each line item includes the name of the feature, a link to the feature's main
|
||||
GitHub issue, its stability level (Alpha, Beta, or Stable), the SIG and
|
||||
individual responsible for implementing it, whether it
|
||||
needs docs, a draft release note for the feature, and whether it has been
|
||||
merged. Keep the following in mind:
|
||||
|
||||
- Beta and Stable features are generally a higher documentation priority than
|
||||
Alpha features.
|
||||
- It's hard to test (and therefore to document) a feature that hasn't been merged,
|
||||
or is at least considered feature-complete in its PR.
|
||||
- Determining whether a feature needs documentation is a manual process and
|
||||
just because a feature is not marked as needing docs doesn't mean it doesn't
|
||||
need them.
|
||||
|
||||
## For developers or other SIG members
|
||||
|
||||
This section is information for members of other Kubernetes SIGs documenting new features
|
||||
for a release.
|
||||
|
||||
If you are a member of a SIG developing a new feature for Kubernetes, you need
|
||||
to work with SIG Docs to be sure your feature is documented in time for the
|
||||
release. Check the
|
||||
[feature tracking spreadsheet](https://github.com/kubernetes/sig-release/tree/master/releases)
|
||||
or check in the `#sig-release` Kubernetes Slack channel to verify scheduling details and
|
||||
deadlines.
|
||||
|
||||
### Open a placeholder PR
|
||||
|
||||
1. Open a pull request against the
|
||||
`release-X.Y` branch in the `kubernetes/website` repository, with a small
|
||||
commit that you will amend later.
|
||||
2. Use the Prow command `/milestone X.Y` to
|
||||
assign the PR to the relevant milestone. This alerts the docs person managing
|
||||
this release that the feature docs are coming.
|
||||
|
||||
If your feature does not need
|
||||
any documentation changes, make sure the sig-release team knows this, by
|
||||
mentioning it in the `#sig-release` Slack channel. If the feature does need
|
||||
documentation but the PR is not created, the feature may be removed from the
|
||||
milestone.
|
||||
|
||||
### PR ready for review
|
||||
|
||||
When ready, populate your placeholder PR with feature documentation.
|
||||
|
||||
Do your best to describe your feature and how to use it. If you need help structuring your documentation, ask in the `#sig-docs` slack channel.
|
||||
|
||||
When you complete your content, the documentation person assigned to your feature reviews it. Use their suggestions to get the content to a release ready state.
|
||||
|
||||
If your feature needs documentation and the first draft
|
||||
content is not received, the feature may be removed from the milestone.
|
||||
|
||||
### All PRs reviewed and ready to merge
|
||||
|
||||
If your PR has not yet been merged into the `release-X.Y` branch by the release deadline, work with the
|
||||
docs person managing the release to get it in by the deadline. If your feature needs
|
||||
documentation and the docs are not ready, the feature may be removed from the
|
||||
milestone.
|
||||
|
||||
If your feature is an Alpha feature and is behind a feature gate, make sure you
|
||||
add it to [Alpha/Beta Feature gates](/docs/reference/command-line-tools-reference/feature-gates/#feature-gates-for-alpha-or-beta-features) table
|
||||
as part of your pull request. If your feature is moving out of Alpha, make sure to
|
||||
remove it from that table.
|
||||
|
||||
{{% /capture %}}
|
||||
|
|
@ -0,0 +1,484 @@
|
|||
---
|
||||
title: Opening a pull request
|
||||
slug: new-content
|
||||
content_template: templates/concept
|
||||
weight: 10
|
||||
card:
|
||||
name: contribute
|
||||
weight: 40
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
|
||||
{{< note >}}
|
||||
**Code developers**: If you are documenting a new feature for an
|
||||
upcoming Kubernetes release, see
|
||||
[Document a new feature](/docs/contribute/new-content/new-features/).
|
||||
{{< /note >}}
|
||||
|
||||
To contribute new content pages or improve existing content pages, open a pull request (PR). Make sure you follow all the requirements in the [Before you begin](#before-you-begin) section.
|
||||
|
||||
If your change is small, or you're unfamiliar with git, read [Changes using GitHub](#changes-using-github) to learn how to edit a page.
|
||||
|
||||
If your changes are large, read [Work from a local fork](#fork-the-repo) to learn how to make changes locally on your computer.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture body %}}
|
||||
|
||||
## Changes using GitHub
|
||||
|
||||
If you're less experienced with git workflows, here's an easier method of
|
||||
opening a pull request.
|
||||
|
||||
1. On the page where you see the issue, select the pencil icon at the top right.
|
||||
You can also scroll to the bottom of the page and select **Edit this page**.
|
||||
|
||||
2. Make your changes in the GitHub markdown editor.
|
||||
|
||||
3. Below the editor, fill in the **Propose file change**
|
||||
form. In the first field, give your commit message a title. In
|
||||
the second field, provide a description.
|
||||
|
||||
{{< note >}}
|
||||
Do not use any [GitHub Keywords](https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) in your commit message. You can add those to the pull request
|
||||
description later.
|
||||
{{< /note >}}
|
||||
|
||||
4. Select **Propose file change**.
|
||||
|
||||
5. Select **Create pull request**.
|
||||
|
||||
6. The **Open a pull request** screen appears. Fill in the form:
|
||||
|
||||
- The **Subject** field of the pull request defaults to the commit summary.
|
||||
You can change it if needed.
|
||||
- The **Body** contains your extended commit message, if you have one,
|
||||
and some template text. Add the
|
||||
details the template text asks for, then delete the extra template text.
|
||||
- Leave the **Allow edits from maintainers** checkbox selected.
|
||||
|
||||
{{< note >}}
|
||||
PR descriptions are a great way to help reviewers understand your change. For more information, see [Opening a PR](#open-a-pr).
|
||||
{{</ note >}}
|
||||
|
||||
7. Select **Create pull request**.
|
||||
|
||||
### Addressing feedback in GitHub
|
||||
|
||||
Before merging a pull request, Kubernetes community members review and
|
||||
approve it. The `k8s-ci-robot` suggests reviewers based on the nearest
|
||||
owner mentioned in the pages. If you have someone specific in mind,
|
||||
leave a comment with their GitHub username in it.
|
||||
|
||||
If a reviewer asks you to make changes:
|
||||
|
||||
1. Go to the **Files changed** tab.
|
||||
2. Select the pencil (edit) icon on any files changed by the
|
||||
pull request.
|
||||
3. Make the changes requested.
|
||||
4. Commit the changes.
|
||||
|
||||
If you are waiting on a reviewer, reach out once every 7 days. You can also post a message in the `#sig-docs` Slack channel.
|
||||
|
||||
When your review is complete, a reviewer merges your PR and your changes go live a few minutes later.
|
||||
|
||||
## Work from a local fork {#fork-the-repo}
|
||||
|
||||
If you're more experienced with git, or if your changes are larger than a few lines,
|
||||
work from a local fork.
|
||||
|
||||
Make sure you have [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) installed on your computer. You can also use a git UI application.
|
||||
|
||||
### Fork the kubernetes/website repository
|
||||
|
||||
1. Navigate to the [`kubernetes/website`](https://github.com/kubernetes/website/) repository.
|
||||
2. Select **Fork**.
|
||||
|
||||
### Create a local clone and set the upstream
|
||||
|
||||
3. In a terminal window, clone your fork:
|
||||
|
||||
```bash
|
||||
git clone git@github.com/<github_username>/website
|
||||
```
|
||||
|
||||
4. Navigate to the new `website` directory. Set the `kubernetes/website` repository as the `upstream` remote:
|
||||
|
||||
```bash
|
||||
cd website
|
||||
|
||||
git remote add upstream https://github.com/kubernetes/website.git
|
||||
```
|
||||
|
||||
5. Confirm your `origin` and `upstream` repositories:
|
||||
|
||||
```bash
|
||||
git remote -v
|
||||
```
|
||||
|
||||
Output is similar to:
|
||||
|
||||
```bash
|
||||
origin git@github.com:<github_username>/website.git (fetch)
|
||||
origin git@github.com:<github_username>/website.git (push)
|
||||
upstream https://github.com/kubernetes/website (fetch)
|
||||
upstream https://github.com/kubernetes/website (push)
|
||||
```
|
||||
|
||||
6. Fetch commits from your fork's `origin/master` and `kubernetes/website`'s `upstream/master`:
|
||||
|
||||
```bash
|
||||
git fetch origin
|
||||
git fetch upstream
|
||||
```
|
||||
|
||||
This makes sure your local repository is up to date before you start making changes.
|
||||
|
||||
{{< note >}}
|
||||
This workflow is different than the [Kubernetes Community GitHub Workflow](https://github.com/kubernetes/community/blob/master/contributors/guide/github-workflow.md). You do not need to merge your local copy of `master` with `upstream/master` before pushing updates to your fork.
|
||||
{{< /note >}}
|
||||
|
||||
### Create a branch
|
||||
|
||||
1. Decide which branch base to your work on:
|
||||
|
||||
- For improvements to existing content, use `upstream/master`.
|
||||
- For new content about existing features, use `upstream/master`.
|
||||
- For localized content, use the localization's conventions. For more information, see [localizing Kubernetes documentation](/docs/contribute/localization/).
|
||||
- For new features in an upcoming Kubernetes release, use the feature branch. For more information, see [documenting for a release](/docs/contribute/new-content/new-features/).
|
||||
- For long-running efforts that multiple SIG Docs contributors collaborate on,
|
||||
like content reorganization, use a specific feature branch created for that
|
||||
effort.
|
||||
|
||||
If you need help choosing a branch, ask in the `#sig-docs` Slack channel.
|
||||
|
||||
2. Create a new branch based on the branch identified in step 1. This example assumes the base branch is `upstream/master`:
|
||||
|
||||
```bash
|
||||
git checkout -b <my_new_branch> upstream/master
|
||||
```
|
||||
|
||||
3. Make your changes using a text editor.
|
||||
|
||||
At any time, use the `git status` command to see what files you've changed.
|
||||
|
||||
### Commit your changes
|
||||
|
||||
When you are ready to submit a pull request, commit your changes.
|
||||
|
||||
1. In your local repository, check which files you need to commit:
|
||||
|
||||
```bash
|
||||
git status
|
||||
```
|
||||
|
||||
Output is similar to:
|
||||
|
||||
```bash
|
||||
On branch <my_new_branch>
|
||||
Your branch is up to date with 'origin/<my_new_branch>'.
|
||||
|
||||
Changes not staged for commit:
|
||||
(use "git add <file>..." to update what will be committed)
|
||||
(use "git checkout -- <file>..." to discard changes in working directory)
|
||||
|
||||
modified: content/en/docs/contribute/new-content/contributing-content.md
|
||||
|
||||
no changes added to commit (use "git add" and/or "git commit -a")
|
||||
```
|
||||
|
||||
2. Add the files listed under **Changes not staged for commit** to the commit:
|
||||
|
||||
```bash
|
||||
git add <your_file_name>
|
||||
```
|
||||
|
||||
Repeat this for each file.
|
||||
|
||||
3. After adding all the files, create a commit:
|
||||
|
||||
```bash
|
||||
git commit -m "Your commit message"
|
||||
```
|
||||
|
||||
{{< note >}}
|
||||
Do not use any [GitHub Keywords](https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) in your commit message. You can add those to the pull request
|
||||
description later.
|
||||
{{< /note >}}
|
||||
|
||||
4. Push your local branch and its new commit to your remote fork:
|
||||
|
||||
```bash
|
||||
git push origin <my_new_branch>
|
||||
```
|
||||
|
||||
### Preview your changes locally {#preview-locally}
|
||||
|
||||
It's a good idea to preview your changes locally before pushing them or opening a pull request. A preview lets you catch build errors or markdown formatting problems.
|
||||
|
||||
You can either build the website's docker image or run Hugo locally. Building the docker image is slower but displays [Hugo shortcodes](/docs/contribute/style/hugo-shortcodes/), which can be useful for debugging.
|
||||
|
||||
{{< tabs name="tab_with_hugo" >}}
|
||||
{{% tab name="Hugo in a container" %}}
|
||||
|
||||
1. Build the image locally:
|
||||
|
||||
```bash
|
||||
make docker-image
|
||||
```
|
||||
|
||||
2. After building the `kubernetes-hugo` image locally, build and serve the site:
|
||||
|
||||
```bash
|
||||
make docker-serve
|
||||
```
|
||||
|
||||
3. In a web browser, navigate to `https://localhost:1313`. Hugo watches the
|
||||
changes and rebuilds the site as needed.
|
||||
|
||||
4. To stop the local Hugo instance, go back to the terminal and type `Ctrl+C`,
|
||||
or close the terminal window.
|
||||
|
||||
{{% /tab %}}
|
||||
{{% tab name="Hugo on the command line" %}}
|
||||
|
||||
Alternately, install and use the `hugo` command on your computer:
|
||||
|
||||
5. Install the [Hugo](https://gohugo.io/getting-started/installing/) version specified in [`website/netlify.toml`](https://raw.githubusercontent.com/kubernetes/website/master/netlify.toml).
|
||||
|
||||
6. In a terminal, go to your Kubernetes website repository and start the Hugo server:
|
||||
|
||||
```bash
|
||||
cd <path_to_your_repo>/website
|
||||
hugo server
|
||||
```
|
||||
|
||||
7. In your browser’s address bar, enter `https://localhost:1313`.
|
||||
|
||||
8. To stop the local Hugo instance, go back to the terminal and type `Ctrl+C`,
|
||||
or close the terminal window.
|
||||
|
||||
{{% /tab %}}
|
||||
{{< /tabs >}}
|
||||
|
||||
### Open a pull request from your fork to kubernetes/website {#open-a-pr}
|
||||
|
||||
1. In a web browser, go to the [`kubernetes/website`](https://github.com/kubernetes/website/) repository.
|
||||
2. Select **New Pull Request**.
|
||||
3. Select **compare across forks**.
|
||||
4. From the **head repository** drop-down menu, select your fork.
|
||||
5. From the **compare** drop-down menu, select your branch.
|
||||
6. Select **Create Pull Request**.
|
||||
7. Add a description for your pull request:
|
||||
- **Title** (50 characters or less): Summarize the intent of the change.
|
||||
- **Description**: Describe the change in more detail.
|
||||
- If there is a related GitHub issue, include `Fixes #12345` or `Closes #12345` in the description. GitHub's automation closes the mentioned issue after merging the PR if used. If there are other related PRs, link those as well.
|
||||
- If you want advice on something specific, include any questions you'd like reviewers to think about in your description.
|
||||
|
||||
8. Select the **Create pull request** button.
|
||||
|
||||
Congratulations! Your pull request is available in [Pull requests](https://github.com/kubernetes/website/pulls).
|
||||
|
||||
|
||||
After opening a PR, GitHub runs automated tests and tries to deploy a preview using [Netlify](https://www.netlify.com/).
|
||||
|
||||
- If the Netlify build fails, select **Details** for more information.
|
||||
- If the Netlify build succeeds, select **Details** opens a staged version of the Kubernetes website with your changes applied. This is how reviewers check your changes.
|
||||
|
||||
GitHub also automatically assigns labels to a PR, to help reviewers. You can add them too, if needed. For more information, see [Adding and removing issue labels](/docs/contribute/review/for-approvers/#adding-and-removing-issue-labels).
|
||||
|
||||
### Addressing feedback locally
|
||||
|
||||
1. After making your changes, amend your previous commit:
|
||||
|
||||
```bash
|
||||
git commit -a --amend
|
||||
```
|
||||
|
||||
- `-a`: commits all changes
|
||||
- `--amend`: amends the previous commit, rather than creating a new one
|
||||
|
||||
2. Update your commit message if needed.
|
||||
|
||||
3. Use `git push origin <my_new_branch>` to push your changes and re-run the Netlify tests.
|
||||
|
||||
{{< note >}}
|
||||
If you use `git commit -m` instead of amending, you must [squash your commits](#squashing-commits) before merging.
|
||||
{{< /note >}}
|
||||
|
||||
#### Changes from reviewers
|
||||
|
||||
Sometimes reviewers commit to your pull request. Before making any other changes, fetch those commits.
|
||||
|
||||
1. Fetch commits from your remote fork and rebase your working branch:
|
||||
|
||||
```bash
|
||||
git fetch origin
|
||||
git rebase origin/<your-branch-name>
|
||||
```
|
||||
|
||||
2. After rebasing, force-push new changes to your fork:
|
||||
|
||||
```bash
|
||||
git push --force-with-lease origin <your-branch-name>
|
||||
```
|
||||
|
||||
#### Merge conflicts and rebasing
|
||||
|
||||
{{< note >}}
|
||||
For more information, see [Git Branching - Basic Branching and Merging](https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging#_basic_merge_conflicts), [Advanced Merging](https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging), or ask in the `#sig-docs` Slack channel for help.
|
||||
{{< /note >}}
|
||||
|
||||
If another contributor commits changes to the same file in another PR, it can create a merge conflict. You must resolve all merge conflicts in your PR.
|
||||
|
||||
1. Update your fork and rebase your local branch:
|
||||
|
||||
```bash
|
||||
git fetch origin
|
||||
git rebase origin/<your-branch-name>
|
||||
```
|
||||
|
||||
Then force-push the changes to your fork:
|
||||
|
||||
```bash
|
||||
git push --force-with-lease origin <your-branch-name>
|
||||
```
|
||||
|
||||
2. Fetch changes from `kubernetes/website`'s `upstream/master` and rebase your branch:
|
||||
|
||||
```bash
|
||||
git fetch upstream
|
||||
git rebase upstream/master
|
||||
```
|
||||
|
||||
3. Inspect the results of the rebase:
|
||||
|
||||
```bash
|
||||
git status
|
||||
```
|
||||
|
||||
This results in a number of files marked as conflicted.
|
||||
|
||||
4. Open each conflicted file and look for the conflict markers: `>>>`, `<<<`, and `===`. Resolve the conflict and delete the conflict marker.
|
||||
|
||||
{{< note >}}
|
||||
For more information, see [How conflicts are presented](https://git-scm.com/docs/git-merge#_how_conflicts_are_presented).
|
||||
{{< /note >}}
|
||||
|
||||
5. Add the files to the changeset:
|
||||
|
||||
```bash
|
||||
git add <filename>
|
||||
```
|
||||
6. Continue the rebase:
|
||||
|
||||
```bash
|
||||
git rebase --continue
|
||||
```
|
||||
|
||||
7. Repeat steps 2 to 5 as needed.
|
||||
|
||||
After applying all commits, the `git status` command shows that the rebase is complete.
|
||||
|
||||
8. Force-push the branch to your fork:
|
||||
|
||||
```bash
|
||||
git push --force-with-lease origin <your-branch-name>
|
||||
```
|
||||
|
||||
The pull request no longer shows any conflicts.
|
||||
|
||||
|
||||
### Squashing commits
|
||||
|
||||
{{< note >}}
|
||||
For more information, see [Git Tools - Rewriting History](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History), or ask in the `#sig-docs` Slack channel for help.
|
||||
{{< /note >}}
|
||||
|
||||
If your PR has multiple commits, you must squash them into a single commit before merging your PR. You can check the number of commits on your PR's **Commits** tab or by running the `git log` command locally.
|
||||
|
||||
{{< note >}}
|
||||
This topic assumes `vim` as the command line text editor.
|
||||
{{< /note >}}
|
||||
|
||||
1. Start an interactive rebase:
|
||||
|
||||
```bash
|
||||
git rebase -i HEAD~<number_of_commits_in_branch>
|
||||
```
|
||||
|
||||
Squashing commits is a form of rebasing. The `-i` switch tells git you want to rebase interactively. `HEAD~<number_of_commits_in_branch` indicates how many commits to look at for the rebase.
|
||||
|
||||
Output is similar to:
|
||||
|
||||
```bash
|
||||
pick d875112ca Original commit
|
||||
pick 4fa167b80 Address feedback 1
|
||||
pick 7d54e15ee Address feedback 2
|
||||
|
||||
# Rebase 3d18sf680..7d54e15ee onto 3d183f680 (3 commands)
|
||||
|
||||
...
|
||||
|
||||
# These lines can be re-ordered; they are executed from top to bottom.
|
||||
```
|
||||
|
||||
The first section of the output lists the commits in the rebase. The second section lists the options for each commit. Changing the word `pick` changes the status of the commit once the rebase is complete.
|
||||
|
||||
For the purposes of rebasing, focus on `squash` and `pick`.
|
||||
|
||||
{{< note >}}
|
||||
For more information, see [Interactive Mode](https://git-scm.com/docs/git-rebase#_interactive_mode).
|
||||
{{< /note >}}
|
||||
|
||||
2. Start editing the file.
|
||||
|
||||
Change the original text:
|
||||
|
||||
```bash
|
||||
pick d875112ca Original commit
|
||||
pick 4fa167b80 Address feedback 1
|
||||
pick 7d54e15ee Address feedback 2
|
||||
```
|
||||
|
||||
To:
|
||||
|
||||
```bash
|
||||
pick d875112ca Original commit
|
||||
squash 4fa167b80 Address feedback 1
|
||||
squash 7d54e15ee Address feedback 2
|
||||
```
|
||||
|
||||
This squashes commits `4fa167b80 Address feedback 1` and `7d54e15ee Address feedback 2` into `d875112ca Original commit`, leaving only `d875112ca Original commit` as a part of the timeline.
|
||||
|
||||
3. Save and exit your file.
|
||||
|
||||
4. Push your squashed commit:
|
||||
|
||||
```bash
|
||||
git push --force-with-lease origin <branch_name>
|
||||
```
|
||||
|
||||
## Contribute to other repos
|
||||
|
||||
The [Kubernetes project](https://github.com/kubernetes) contains 50+ repositories. Many of these repositories contain documentation: user-facing help text, error messages, API references or code comments.
|
||||
|
||||
If you see text you'd like to improve, use GitHub to search all repositories in the Kubernetes organization.
|
||||
This can help you figure out where to submit your issue or PR.
|
||||
|
||||
Each repository has its own processes and procedures. Before you file an
|
||||
issue or submit a PR, read that repository's `README.md`, `CONTRIBUTING.md`, and
|
||||
`code-of-conduct.md`, if they exist.
|
||||
|
||||
Most repositories use issue and PR templates. Have a look through some open
|
||||
issues and PRs to get a feel for that team's processes. Make sure to fill out
|
||||
the templates with as much detail as possible when you file issues or PRs.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture whatsnext %}}
|
||||
|
||||
- Read [Reviewing](/docs/contribute/reviewing/revewing-prs) to learn more about the review process.
|
||||
|
||||
{{% /capture %}}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
---
|
||||
title: Contributing new content overview
|
||||
linktitle: Overview
|
||||
content_template: templates/concept
|
||||
main_menu: true
|
||||
weight: 5
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
|
||||
This section contains information you should know before contributing new content.
|
||||
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture body %}}
|
||||
|
||||
## Contributing basics
|
||||
|
||||
- Write Kubernetes documentation in Markdown and build the Kubernetes site using [Hugo](https://gohugo.io/).
|
||||
- The source is in [GitHub](https://github.com/kubernetes/website). You can find Kubernetes documentation at `/content/en/docs/`. Some of the reference documentation is automatically generated from scripts in the `update-imported-docs/` directory.
|
||||
- [Page templates](/docs/contribute/style/page-templates/) control the presentation of documentation content in Hugo.
|
||||
- In addition to the standard Hugo shortcodes, we use a number of [custom Hugo shortcodes](/docs/contribute/style/hugo-shortcodes/) in our documentation to control the presentation of content.
|
||||
- Documentation source is available in multiple languages in `/content/`. Each language has its own folder with a two-letter code determined by the [ISO 639-1 standard](https://www.loc.gov/standards/iso639-2/php/code_list.php). For example, English documentation source is stored in `/content/en/docs/`.
|
||||
- For more information about contributing to documentation in multiple languages or starting a new translation, see [localization](/docs/contribute/localization).
|
||||
|
||||
## Before you begin {#before-you-begin}
|
||||
|
||||
### Sign the CNCF CLA {#sign-the-cla}
|
||||
|
||||
All Kubernetes contributors **must** read the [Contributor guide](https://github.com/kubernetes/community/blob/master/contributors/guide/README.md) and [sign the Contributor License Agreement (CLA)](https://github.com/kubernetes/community/blob/master/CLA.md).
|
||||
|
||||
Pull requests from contributors who haven't signed the CLA fail the automated tests.
|
||||
|
||||
### Configure commit signoffs
|
||||
|
||||
All commits to Kubernetes repositories must be _signed off_ using the Git `--signoff` or `-s` flag.
|
||||
The signoff acknowledges that you have the rights to submit contributions under the same
|
||||
license and [Developer Certificate of Origin](https://developercertificate.org/).
|
||||
|
||||
If you're using a Git UI app, you can use the app's commit template functionality if it
|
||||
exists, or add the following to your commit message body:
|
||||
|
||||
```
|
||||
Signed-off-by: Your Name <youremail@domain.com>
|
||||
```
|
||||
|
||||
In both cases, the name and email you provide must match those found in your `git config`, and your git name and email must match those used for the CNCF CLA.
|
||||
|
||||
### Choose which Git branch to use
|
||||
|
||||
When opening a pull request, you need to know in advance which branch to base your work on.
|
||||
|
||||
Scenario | Branch
|
||||
:---------|:------------
|
||||
Existing or new English language content for the current release | `master`
|
||||
Content for a feature change release | The branch which corresponds to the major and minor version the feature change is in, using the pattern `dev-release-<version>`. For example, if a feature changes in the `{{< latest-version >}}` release, then add documentation changes to the ``dev-{{< release-branch >}}`` branch.
|
||||
Content in other languages (localizations) | Use the localization's convention. See the [Localization branching strategy](/docs/contribute/localization/#branching-strategy) for more information.
|
||||
|
||||
|
||||
If you're still not sure which branch to choose, ask in `#sig-docs` on Slack.
|
||||
|
||||
{{< note >}}
|
||||
If you already submitted your pull request and you know that the base branch
|
||||
was wrong, you (and only you, the submitter) can change it.
|
||||
{{< /note >}}
|
||||
|
||||
### Languages per PR
|
||||
|
||||
Limit pull requests to one language per PR. If you need to make an identical change to the same code sample in multiple languages, open a separate PR for each language.
|
||||
|
||||
|
||||
{{% /capture %}}
|
||||
|
|
@ -1,9 +1,10 @@
|
|||
---
|
||||
title: Participating in SIG Docs
|
||||
content_template: templates/concept
|
||||
weight: 60
|
||||
card:
|
||||
name: contribute
|
||||
weight: 40
|
||||
weight: 60
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
|
|
@ -35,7 +36,7 @@ aspects of Kubernetes -- the Kubernetes website and documentation.
|
|||
|
||||
## Roles and responsibilities
|
||||
|
||||
- **Anyone** can contribute to Kubernetes documentation. To contribute, you must [sign the CLA](/docs/contribute/start#sign-the-cla) and have a GitHub account.
|
||||
- **Anyone** can contribute to Kubernetes documentation. To contribute, you must [sign the CLA](/docs/contribute/new-content/overview/#sign-the-cla) and have a GitHub account.
|
||||
- **Members** of the Kubernetes organization are contributors who have spent time and effort on the Kubernetes project, usually by opening pull requests with accepted changes. See [Community membership](https://github.com/kubernetes/community/blob/master/community-membership.md) for membership criteria.
|
||||
- A SIG Docs **Reviewer** is a member of the Kubernetes organization who has
|
||||
expressed interest in reviewing documentation pull requests, and has been
|
||||
|
|
@ -61,7 +62,7 @@ Anyone can do the following:
|
|||
If you are not a member of the Kubernetes organization, using `/lgtm` has no effect on automated systems.
|
||||
{{< /note >}}
|
||||
|
||||
After [signing the CLA](/docs/contribute/start#sign-the-cla), anyone can also:
|
||||
After [signing the CLA](/docs/contribute/new-content/overview/#sign-the-cla), anyone can also:
|
||||
- Open a pull request to improve existing content, add new content, or write a blog post or case study.
|
||||
|
||||
## Members
|
||||
|
|
@ -307,7 +308,8 @@ SIG Docs approvers. Here's how it works.
|
|||
|
||||
For more information about contributing to the Kubernetes documentation, see:
|
||||
|
||||
- [Start contributing](/docs/contribute/start/)
|
||||
- [Documentation style](/docs/contribute/style/)
|
||||
- [Contributing new content](/docs/contribute/overview/)
|
||||
- [Reviewing content](/docs/contribute/review/reviewing-prs)
|
||||
- [Documentation style guide](/docs/contribute/style/)
|
||||
|
||||
{{% /capture %}}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
title: Reviewing changes
|
||||
weight: 30
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
|
||||
This section describes how to review content.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture body %}}
|
||||
|
||||
{{% /capture %}}
|
||||
|
|
@ -0,0 +1,228 @@
|
|||
---
|
||||
title: Reviewing for approvers and reviewers
|
||||
linktitle: For approvers and reviewers
|
||||
slug: for-approvers
|
||||
content_template: templates/concept
|
||||
weight: 20
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
|
||||
SIG Docs [Reviewers](/docs/contribute/participating/#reviewers) and [Approvers](/docs/contribute/participating/#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.
|
||||
|
||||
In addition to the rotation, a bot assigns reviewers and approvers
|
||||
for the PR based on the owners for the affected files.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
||||
{{% capture body %}}
|
||||
|
||||
## 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).
|
||||
|
||||
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.
|
||||
|
||||
{{< 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.
|
||||
- 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.
|
||||
|
||||
## Commit into another person's PR
|
||||
|
||||
Leaving PR comments is helpful, but there might be times when you need to commit
|
||||
into another person's PR instead.
|
||||
|
||||
Do not "take over" for another person unless they explicitly ask
|
||||
you to, or you want to resurrect a long-abandoned PR. While it may be faster
|
||||
in the short term, it deprives the person of the chance to contribute.
|
||||
|
||||
The process you use depends on whether you need to edit a file that is already
|
||||
in the scope of the PR, or a file that the PR has not yet touched.
|
||||
|
||||
You can't commit into someone else's PR if either of the following things is
|
||||
true:
|
||||
|
||||
- If the PR author pushed their branch directly to the
|
||||
[https://github.com/kubernetes/website/](https://github.com/kubernetes/website/)
|
||||
repository. Only a reviewer with push access can commit to another user's PR.
|
||||
|
||||
{{< note >}}
|
||||
Encourage the author to push their branch to their fork before
|
||||
opening the PR next time.
|
||||
{{< /note >}}
|
||||
|
||||
- The PR author explicitly disallows edits from approvers.
|
||||
|
||||
## Prow commands for reviewing
|
||||
|
||||
[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](#add-and-remove-labels), closing issues, and assigning an approver. Enter Prow commands as GitHub comments using the `/<command-name>` format.
|
||||
|
||||
The most common prow commands reviewers and approvers use are:
|
||||
|
||||
{{< table caption="Prow commands for reviewing" >}}
|
||||
Prow Command | Role Restrictions | Description
|
||||
:------------|:------------------|:-----------
|
||||
`/lgtm` | Anyone, but triggers automation if a Reviewer or Approver uses it | Signals that you've finished reviewing a PR and are satisfied with the changes.
|
||||
`/approve` | Approvers | Approves a PR for merging.
|
||||
`/assign` | Reviewers or Approvers | Assigns a person to review or approve a PR
|
||||
`/close` | Reviewers or Approvers | Closes an issue or PR.
|
||||
`/hold` | Anyone | Adds the `do-not-merge/hold` label, indicating the PR cannot be automatically merged.
|
||||
`/hold cancel` | Anyone | Removes the `do-not-merge/hold` label.
|
||||
{{< /table >}}
|
||||
|
||||
See [the Prow command reference](https://prow.k8s.io/command-help) to see the full list
|
||||
of commands you can use in a PR.
|
||||
|
||||
## 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.
|
||||
|
||||
|
||||
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.
|
||||
|
||||
### 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.
|
||||
|
||||
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)
|
||||
|
||||
{{< table caption="Issue labels" >}}
|
||||
Label | Description
|
||||
:------------|:------------------
|
||||
`priority/critical-urgent` | Do this right now.
|
||||
`priority/important-soon` | Do this within 3 months.
|
||||
`priority/important-longterm` | Do this within 6 months.
|
||||
`priority/backlog` | Deferrable indefinitely. Do when resources are available.
|
||||
`priority/awaiting-more-evidence` | Placeholder for a potentially good issue so it doesn't get lost.
|
||||
`help` or `good first issue` | Suitable for someone with very little Kubernetes or SIG Docs experience. See [Help Wanted and Good First Issue Labels](https://github.com/kubernetes/community/blob/master/contributors/guide/help-wanted.md) for more information.
|
||||
|
||||
{{< /table >}}
|
||||
|
||||
At your discretion, take ownership of an issue and submit a PR for it
|
||||
(especially if it's quick or relates to work you're already doing).
|
||||
|
||||
If you have questions about triaging an issue, ask in `#sig-docs` on Slack or
|
||||
the [kubernetes-sig-docs mailing list](https://groups.google.com/forum/#!forum/kubernetes-sig-docs).
|
||||
|
||||
## Adding and removing issue labels
|
||||
|
||||
To add a label, leave a comment in one of the following formats:
|
||||
|
||||
- `/<label-to-add>` (for example, `/good-first-issue`)
|
||||
- `/<label-category> <label-to-add>` (for example, `/triage needs-information` or `/language ja`)
|
||||
|
||||
To remove a label, leave a comment in one of the following formats:
|
||||
|
||||
- `/remove-<label-to-remove>` (for example, `/remove-help`)
|
||||
- `/remove-<label-category> <label-to-remove>` (for example, `/remove-triage needs-information`)`
|
||||
|
||||
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.
|
||||
|
||||
### Issue lifecycle labels
|
||||
|
||||
Issues are generally opened and closed quickly.
|
||||
However, sometimes an issue is inactive after its opened.
|
||||
Other times, an issue may need to remain open for longer than 90 days.
|
||||
|
||||
{{< table caption="Issue lifecycle labels" >}}
|
||||
Label | Description
|
||||
:------------|:------------------
|
||||
`lifecycle/stale` | After 90 days with no activity, an issue is automatically labeled as stale. The issue will be automatically closed if the lifecycle is not manually reverted using the `/remove-lifecycle stale` command.
|
||||
`lifecycle/frozen` | An issue with this label will not become stale after 90 days of inactivity. A user manually adds this label to issues that need to remain open for much longer than 90 days, such as those with a `priority/important-longterm` label.
|
||||
{{< /table >}}
|
||||
|
||||
## Handling special issue types
|
||||
|
||||
SIG Docs encounters the following types of issues often enough to document how
|
||||
to handle them.
|
||||
|
||||
### Duplicate issues
|
||||
|
||||
If a single problem has one or more issues open for it, combine them into a single issue.
|
||||
You should decide which issue to keep open (or
|
||||
open a new issue), then move over all relevant information and link related issues.
|
||||
Finally, label all other issues that describe the same problem with
|
||||
`triage/duplicate` and close them. Only having a single issue to work on reduces confusion
|
||||
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.
|
||||
|
||||
### Blog issues
|
||||
|
||||
We expect [Kubernetes Blog](https://kubernetes.io/blog/) entries to become
|
||||
outdated over time. Therefore, we only maintain blog entries less than a year old.
|
||||
If an issue is related to a blog entry that is more than one year old,
|
||||
close the issue without fixing.
|
||||
|
||||
### Support requests or code bug reports
|
||||
|
||||
Some docs issues are actually issues with the underlying code, or requests for
|
||||
assistance when something, for example a tutorial, doesn't work.
|
||||
For issues unrelated to docs, close the issue with the `triage/support` label and a comment
|
||||
directing the requester to support venues (Slack, Stack Overflow) and, if
|
||||
relevant, the repository to file an issue for bugs with features (`kubernetes/kubernetes`
|
||||
is a great place to start).
|
||||
|
||||
Sample response to a request for support:
|
||||
|
||||
```none
|
||||
This issue sounds more like a request for support and less
|
||||
like an issue specifically for docs. I encourage you to bring
|
||||
your question to the `#kubernetes-users` channel in
|
||||
[Kubernetes slack](http://slack.k8s.io/). You can also search
|
||||
resources like
|
||||
[Stack Overflow](http://stackoverflow.com/questions/tagged/kubernetes)
|
||||
for answers to similar questions.
|
||||
|
||||
You can also open issues for Kubernetes functionality in
|
||||
https://github.com/kubernetes/kubernetes.
|
||||
|
||||
If this is a documentation issue, please re-open this issue.
|
||||
```
|
||||
|
||||
Sample code bug report response:
|
||||
|
||||
```none
|
||||
This sounds more like an issue with the code than an issue with
|
||||
the documentation. Please open an issue at
|
||||
https://github.com/kubernetes/kubernetes/issues.
|
||||
|
||||
If this is a documentation issue, please re-open this issue.
|
||||
```
|
||||
|
||||
|
||||
{{% /capture %}}
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
---
|
||||
title: Reviewing pull requests
|
||||
content_template: templates/concept
|
||||
main_menu: true
|
||||
weight: 10
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
|
||||
Anyone can review a documentation pull request. Visit the [pull requests](https://github.com/kubernetes/website/pulls) section in the Kubernetes website repository to see open pull requests.
|
||||
|
||||
Reviewing documentation pull requests is a
|
||||
great way to introduce yourself to the Kubernetes community.
|
||||
It helps you learn the code base and build trust with other contributors.
|
||||
|
||||
Before reviewing, it's a good idea to:
|
||||
|
||||
- Read the [content guide](/docs/contribute/style/content-guide/) and
|
||||
[style guide](/docs/contribute/style/style-guide/) so you can leave informed comments.
|
||||
- Understand the different [roles and responsibilities](/docs/contribute/participating/#roles-and-responsibilities) in the Kubernetes documentation community.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture body %}}
|
||||
|
||||
## Before you begin
|
||||
|
||||
Before you start a review:
|
||||
|
||||
- Read the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md) and ensure that you abide by it at all times.
|
||||
- Be polite, considerate, and helpful.
|
||||
- Comment on positive aspects of PRs as well as changes.
|
||||
- Be empathetic and mindful of how your review may be received.
|
||||
- Assume good intent and ask clarifying questions.
|
||||
- Experienced contributors, consider pairing with new contributors whose work requires extensive changes.
|
||||
|
||||
## Review process
|
||||
|
||||
In general, review pull requests for content and style in English.
|
||||
|
||||
1. Go to
|
||||
[https://github.com/kubernetes/website/pulls](https://github.com/kubernetes/website/pulls).
|
||||
You see a list of every open pull request against the Kubernetes website and
|
||||
docs.
|
||||
|
||||
2. Filter the open PRs using one or all of the following labels:
|
||||
- `cncf-cla: yes` (Recommended): PRs submitted by contributors who have not signed the CLA cannot be merged. See [Sign the CLA](/docs/contribute/new-content/overview/#sign-the-cla) for more information.
|
||||
- `language/en` (Recommended): Filters for english language PRs only.
|
||||
- `size/<size>`: filters for PRs of a certain size. If you're new, start with smaller PRs.
|
||||
|
||||
Additionally, ensure the PR isn't marked as a work in progress. PRs using the `work in progress` label are not ready for review yet.
|
||||
|
||||
3. Once you've selected a PR to review, understand the change by:
|
||||
- Reading the PR description to understand the changes made, and read any linked issues
|
||||
- Reading any comments by other reviewers
|
||||
- Clicking the **Files changed** tab to see the files and lines changed
|
||||
- Previewing the changes in the Netlify preview build by scrolling to the PR's build check section at the bottom of the **Conversation** tab and clicking the **deploy/netlify** line's **Details** link.
|
||||
|
||||
4. Go to the **Files changed** tab to start your review.
|
||||
1. Click on the `+` symbol beside the line you want to comment on.
|
||||
2. Fill in any comments you have about the line and click either **Add single comment** (if you have only one comment to make) or **Start a review** (if you have multiple comments to make).
|
||||
3. When finished, click **Review changes** at the top of the page. Here, you can add
|
||||
add a summary of your review (and leave some positive comments for the contributor!),
|
||||
approve the PR, comment or request changes as needed. New contributors should always
|
||||
choose **Comment**.
|
||||
|
||||
## Reviewing checklist
|
||||
|
||||
When reviewing, use the following as a starting point.
|
||||
|
||||
### Language and grammar
|
||||
|
||||
- Are there any obvious errors in language or grammar? Is there a better way to phrase something?
|
||||
- Are there any complicated or archaic words which could be replaced with a simpler word?
|
||||
- Are there any words, terms or phrases in use which could be replaced with a non-discriminatory alternative?
|
||||
- Does the word choice and its capitalization follow the [style guide](/docs/contribute/style/style-guide/)?
|
||||
- Are there long sentences which could be shorter or less complex?
|
||||
- Are there any long paragraphs which might work better as a list or table?
|
||||
|
||||
### Content
|
||||
|
||||
- Does similar content exist elsewhere on the Kubernetes site?
|
||||
- Does the content excessively link to off-site, individual vendor or non-open source documentation?
|
||||
|
||||
### Website
|
||||
|
||||
- Did this PR change or remove a page title, slug/alias or anchor link? If so, are there broken links as a result of this PR? Is there another option, like changing the page title without changing the slug?
|
||||
- Does the PR introduce a new page? If so:
|
||||
- Is the page using the right [page template](/docs/contribute/style/page-templates/) and associated Hugo shortcodes?
|
||||
- Does the page appear correctly in the section's side navigation (or at all)?
|
||||
- Should the page appear on the [Docs Home](/docs/home/) listing?
|
||||
- Do the changes show up in the Netlify preview? Be particularly vigilant about lists, code blocks, tables, notes and images.
|
||||
|
||||
### Other
|
||||
|
||||
For small issues with a PR, like typos or whitespace, prefix your comments with `nit:`. This lets the author know the issue is non-critical.
|
||||
|
||||
{{% /capture %}}
|
||||
|
|
@ -1,421 +0,0 @@
|
|||
---
|
||||
title: Start contributing
|
||||
slug: start
|
||||
content_template: templates/concept
|
||||
weight: 10
|
||||
card:
|
||||
name: contribute
|
||||
weight: 10
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
|
||||
If you want to get started contributing to the Kubernetes documentation, this
|
||||
page and its linked topics can help you get started. You don't need to be a
|
||||
developer or a technical writer to make a big impact on the Kubernetes
|
||||
documentation and user experience! All you need for the topics on this page is
|
||||
a [GitHub account](https://github.com/join) and a web browser.
|
||||
|
||||
If you're looking for information on how to start contributing to Kubernetes
|
||||
code repositories, refer to
|
||||
[the Kubernetes community guidelines](https://github.com/kubernetes/community/blob/master/governance.md).
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
||||
{{% capture body %}}
|
||||
|
||||
## The basics about our docs
|
||||
|
||||
The Kubernetes documentation is written in Markdown and processed and deployed using Hugo. The source is in GitHub at [https://github.com/kubernetes/website](https://github.com/kubernetes/website). Most of the documentation source is stored in `/content/en/docs/`. Some of the reference documentation is automatically generated from scripts in the `update-imported-docs/` directory.
|
||||
|
||||
You can file issues, edit content, and review changes from others, all from the
|
||||
GitHub website. You can also use GitHub's embedded history and search tools.
|
||||
|
||||
Not all tasks can be done in the GitHub UI, but these are discussed in the
|
||||
[intermediate](/docs/contribute/intermediate/) and
|
||||
[advanced](/docs/contribute/advanced/) docs contribution guides.
|
||||
|
||||
### Participating in SIG Docs
|
||||
|
||||
The Kubernetes documentation is maintained by a
|
||||
{{< glossary_tooltip text="Special Interest Group" term_id="sig" >}} (SIG)
|
||||
called SIG Docs. We [communicate](#participate-in-sig-docs-discussions) using a Slack channel, a mailing list, and
|
||||
weekly video meetings. New participants are welcome. For more information, see
|
||||
[Participating in SIG Docs](/docs/contribute/participating/).
|
||||
|
||||
### Content guidelines
|
||||
|
||||
The SIG Docs community created guidelines about what kind of content is allowed
|
||||
in the Kubernetes documentation. Look over the [Documentation Content
|
||||
Guide](/docs/contribute/style/content-guide/) to determine if the content
|
||||
contribution you want to make is allowed. You can ask questions about allowed
|
||||
content in the [#sig-docs](#participate-in-sig-docs-discussions) Slack
|
||||
channel.
|
||||
|
||||
### Style guidelines
|
||||
|
||||
We maintain a [style guide](/docs/contribute/style/style-guide/) with information
|
||||
about choices the SIG Docs community has made about grammar, syntax, source
|
||||
formatting, and typographic conventions. Look over the style guide before you
|
||||
make your first contribution, and use it when you have questions.
|
||||
|
||||
Changes to the style guide are made by SIG Docs as a group. To propose a change
|
||||
or addition, [add it to the agenda](https://docs.google.com/document/d/1ddHwLK3kUMX1wVFIwlksjTk0MsqitBnWPe1LRa1Rx5A/edit) for an upcoming SIG Docs meeting, and attend the meeting to participate in the
|
||||
discussion. See the [advanced contribution](/docs/contribute/advanced/) topic for more
|
||||
information.
|
||||
|
||||
### Page templates
|
||||
|
||||
We use page templates to control the presentation of our documentation pages.
|
||||
Be sure to understand how these templates work by reviewing
|
||||
[Using page templates](/docs/contribute/style/page-templates/).
|
||||
|
||||
### Hugo shortcodes
|
||||
|
||||
The Kubernetes documentation is transformed from Markdown to HTML using Hugo.
|
||||
We make use of the standard Hugo shortcodes, as well as a few that are custom to
|
||||
the Kubernetes documentation. See [Custom Hugo shortcodes](/docs/contribute/style/hugo-shortcodes/) for
|
||||
information about how to use them.
|
||||
|
||||
### Multiple languages
|
||||
|
||||
Documentation source is available in multiple languages in `/content/`. Each language has its own folder with a two-letter code determined by the [ISO 639-1 standard](https://www.loc.gov/standards/iso639-2/php/code_list.php). For example, English documentation source is stored in `/content/en/docs/`.
|
||||
|
||||
For more information about contributing to documentation in multiple languages, see ["Localize content"](/docs/contribute/intermediate#localize-content) in the intermediate contributing guide.
|
||||
|
||||
If you're interested in starting a new localization, see ["Localization"](/docs/contribute/localization/).
|
||||
|
||||
## File actionable issues
|
||||
|
||||
Anyone with a GitHub account can file an issue (bug report) against the
|
||||
Kubernetes documentation. If you see something wrong, even if you have no idea
|
||||
how to fix it, [file an issue](#how-to-file-an-issue). The exception to this
|
||||
rule is a tiny bug like a typo that you intend to fix yourself. In that case,
|
||||
you can instead [fix it](#improve-existing-content) without filing a bug first.
|
||||
|
||||
### How to file an issue
|
||||
|
||||
- **On an existing page**
|
||||
|
||||
If you see a problem in an existing page in the [Kubernetes docs](/docs/),
|
||||
go to the bottom of the page and click the **Create an Issue** button. If
|
||||
you are not currently logged in to GitHub, log in. A GitHub issue form
|
||||
appears with some pre-populated content.
|
||||
|
||||
Using Markdown, fill in as many details as you can. In places where you see
|
||||
empty square brackets (`[ ]`), put an `x` between the set of brackets that
|
||||
represents the appropriate choice. If you have a proposed solution to fix
|
||||
the issue, add it.
|
||||
|
||||
- **Request a new page**
|
||||
|
||||
If you think content should exist, but you aren't sure where it should go or
|
||||
you don't think it fits within the pages that currently exist, you can
|
||||
still file an issue. You can either choose an existing page near where you think the
|
||||
new content should go and file the issue from that page, or go straight to
|
||||
[https://github.com/kubernetes/website/issues/new/](https://github.com/kubernetes/website/issues/new/)
|
||||
and file the issue from there.
|
||||
|
||||
### How to file great issues
|
||||
|
||||
To ensure that we understand your issue and can act on it, keep these guidelines
|
||||
in mind:
|
||||
|
||||
- Use the issue template, and fill out as many details as you can.
|
||||
- Clearly explain the specific impact the issue has on users.
|
||||
- Limit the scope of a given issue to a reasonable unit of work. For problems
|
||||
with a large scope, break them down into smaller issues.
|
||||
|
||||
For instance, "Fix the security docs" is not an actionable issue, but "Add
|
||||
details to the 'Restricting network access' topic" might be.
|
||||
- If the issue relates to another issue or pull request, you can refer to it
|
||||
either by its full URL or by the issue or pull request number prefixed
|
||||
with a `#` character. For instance, `Introduced by #987654`.
|
||||
- Be respectful and avoid venting. For instance, "The docs about X suck" is not
|
||||
helpful or actionable feedback. The
|
||||
[Code of Conduct](/community/code-of-conduct/) also applies to interactions on
|
||||
Kubernetes GitHub repositories.
|
||||
|
||||
## Participate in SIG Docs discussions
|
||||
|
||||
The SIG Docs team communicates using the following mechanisms:
|
||||
|
||||
- [Join the Kubernetes Slack instance](http://slack.k8s.io/), then join the
|
||||
`#sig-docs` channel, where we discuss docs issues in real-time. Be sure to
|
||||
introduce yourself!
|
||||
- [Join the `kubernetes-sig-docs` mailing list](https://groups.google.com/forum/#!forum/kubernetes-sig-docs),
|
||||
where broader discussions take place and official decisions are recorded.
|
||||
- Participate in the [weekly SIG Docs](https://github.com/kubernetes/community/tree/master/sig-docs) video meeting, which is announced on the Slack channel and the mailing list. Currently, these meetings take place on Zoom, so you'll need to download the [Zoom client](https://zoom.us/download) or dial in using a phone.
|
||||
|
||||
{{< note >}}
|
||||
You can also check the SIG Docs weekly meeting on the [Kubernetes community meetings calendar](https://calendar.google.com/calendar/embed?src=cgnt364vd8s86hr2phapfjc6uk%40group.calendar.google.com&ctz=America/Los_Angeles).
|
||||
{{< /note >}}
|
||||
|
||||
## Improve existing content
|
||||
|
||||
To improve existing content, you file a _pull request (PR)_ after creating a
|
||||
_fork_. Those two terms are [specific to GitHub](https://help.github.com/categories/collaborating-with-issues-and-pull-requests/).
|
||||
For the purposes of this topic, you don't need to know everything about them,
|
||||
because you can do everything using your web browser. When you continue to the
|
||||
[intermediate docs contributor guide](/docs/contribute/intermediate/), you will
|
||||
need more background in Git terminology.
|
||||
|
||||
{{< note >}}
|
||||
**Kubernetes code developers**: If you are documenting a new feature for an
|
||||
upcoming Kubernetes release, your process is a bit different. See
|
||||
[Document a feature](/docs/contribute/intermediate/#sig-members-documenting-new-features) for
|
||||
process guidelines and information about deadlines.
|
||||
{{< /note >}}
|
||||
|
||||
### Sign the CNCF CLA {#sign-the-cla}
|
||||
|
||||
Before you can contribute code or documentation to Kubernetes, you **must** read
|
||||
the [Contributor guide](https://github.com/kubernetes/community/blob/master/contributors/guide/README.md) and
|
||||
[sign the Contributor License Agreement (CLA)](https://github.com/kubernetes/community/blob/master/CLA.md).
|
||||
Don't worry -- this doesn't take long!
|
||||
|
||||
### Find something to work on
|
||||
|
||||
If you see something you want to fix right away, just follow the instructions
|
||||
below. You don't need to [file an issue](#file-actionable-issues) (although you
|
||||
certainly can).
|
||||
|
||||
If you want to start by finding an existing issue to work on, go to
|
||||
[https://github.com/kubernetes/website/issues](https://github.com/kubernetes/website/issues)
|
||||
and look for issues with the label `good first issue` (you can use
|
||||
[this](https://github.com/kubernetes/website/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) shortcut). Read through the comments and make sure there is not an open pull
|
||||
request against the issue and that nobody has left a comment saying they are
|
||||
working on the issue recently (3 days is a good rule). Leave a comment saying
|
||||
that you would like to work on the issue.
|
||||
|
||||
### Choose which Git branch to use
|
||||
|
||||
The most important aspect of submitting pull requests is choosing which branch
|
||||
to base your work on. Use these guidelines to make the decision:
|
||||
|
||||
- Use `master` for fixing problems in content that is already published, or
|
||||
making improvements to content that already exists.
|
||||
- Use `master` to document something that is already part of the current
|
||||
Kubernetes release, but isn't yet documented. You should write this content
|
||||
in English first, and then localization teams will pick that change up as a
|
||||
localization task.
|
||||
- If you're working on a localization, you should follow the convention for
|
||||
that particular localization. To find this out, you can look at other
|
||||
pull requests (tip: search for `is:pr is:merged label:language/xx`)
|
||||
{{< comment >}}Localization note: when localizing that tip, replace `xx`
|
||||
with the actual ISO3166 two-letter code for your target locale.{{< /comment >}}
|
||||
- Some localization teams work with PRs that target `master`
|
||||
- Some localization teams work with a series of long-lived branches, and
|
||||
periodically merge these to `master`. This kind of branch has a name like
|
||||
dev-\<version>-\<language code>.\<team milestone>; for example:
|
||||
`dev-{{< latest-semver >}}-ja.1`
|
||||
- If you're writing or updating documentation for a feature change release,
|
||||
then you need to know the major and minor version of Kubernetes that
|
||||
the change will first appear in.
|
||||
- For example, if the feature gate JustAnExample is going to move from alpha
|
||||
to beta in the next minor version, you need to know what the next minor
|
||||
version number is.
|
||||
- Find the release branch named for that version. For example, features that
|
||||
changed in the {{< latest-version >}} release got documented in the branch
|
||||
named `dev-{{< latest-semver >}}`.
|
||||
|
||||
If you're still not sure which branch to choose, ask in `#sig-docs` on Slack or
|
||||
attend a weekly SIG Docs meeting to get clarity.
|
||||
|
||||
{{< note >}}
|
||||
If you already submitted your pull request and you know that the Base Branch
|
||||
was wrong, you (and only you, the submitter) can change it.
|
||||
{{< /note >}}
|
||||
|
||||
### Submit a pull request
|
||||
|
||||
Follow these steps to submit a pull request to improve the Kubernetes
|
||||
documentation.
|
||||
|
||||
1. On the page where you see the issue, click the pencil icon at the top right.
|
||||
A new GitHub page appears, with some help text.
|
||||
2. If you have never created a fork of the Kubernetes documentation
|
||||
repository, you are prompted to do so. Create the fork under your GitHub
|
||||
username, rather than another organization you may be a member of. The
|
||||
fork usually has a URL such as `https://github.com/<username>/website`,
|
||||
unless you already have a repository with a conflicting name.
|
||||
|
||||
The reason you are prompted to create a fork is that you do not have
|
||||
access to push a branch directly to the definitive Kubernetes repository.
|
||||
|
||||
3. The GitHub Markdown editor appears with the source Markdown file loaded.
|
||||
Make your changes. Below the editor, fill in the **Propose file change**
|
||||
form. The first field is the summary of your commit message and should be
|
||||
no more than 50 characters long. The second field is optional, but can
|
||||
include more detail if appropriate.
|
||||
|
||||
{{< note >}}
|
||||
Do not include references to other GitHub issues or pull
|
||||
requests in your commit message. You can add those to the pull request
|
||||
description later.
|
||||
{{< /note >}}
|
||||
|
||||
Click **Propose file change**. The change is saved as a commit in a
|
||||
new branch in your fork, which is automatically named something like
|
||||
`patch-1`.
|
||||
|
||||
4. The next screen summarizes the changes you made, by comparing your new
|
||||
branch (the **head fork** and **compare** selection boxes) to the current
|
||||
state of the **base fork** and **base** branch (`master` on the
|
||||
`kubernetes/website` repository by default). You can change any of the
|
||||
selection boxes, but don't do that now. Have a look at the difference
|
||||
viewer on the bottom of the screen, and if everything looks right, click
|
||||
**Create pull request**.
|
||||
|
||||
{{< note >}}
|
||||
If you don't want to create the pull request now, you can do it
|
||||
later, by browsing to the main URL of the Kubernetes website repository or
|
||||
your fork's repository. The GitHub website will prompt you to create the
|
||||
pull request if it detects that you pushed a new branch to your fork.
|
||||
{{< /note >}}
|
||||
|
||||
5. The **Open a pull request** screen appears. The subject of the pull request
|
||||
is the same as the commit summary, but you can change it if needed. The
|
||||
body is populated by your extended commit message (if present) and some
|
||||
template text. Read the template text and fill out the details it asks for,
|
||||
then delete the extra template text. If you add to the description `fixes #<000000>`
|
||||
or `closes #<000000>`, where `#<000000>` is the number of an associated issue,
|
||||
GitHub will automatically close the issue when the PR merges.
|
||||
Leave the **Allow edits from maintainers** checkbox selected. Click
|
||||
**Create pull request**.
|
||||
|
||||
Congratulations! Your pull request is available in
|
||||
[Pull requests](https://github.com/kubernetes/website/pulls).
|
||||
|
||||
After a few minutes, you can preview the website with your PR's changes
|
||||
applied. Go to the **Conversation** tab of your PR and click the **Details**
|
||||
link for the `deploy/netlify` test, near the bottom of the page. It opens in
|
||||
the same browser window by default.
|
||||
|
||||
{{< note >}}
|
||||
Please limit pull requests to one language per PR. For example, if you need to make an identical change to the same code sample in multiple languages, open a separate PR for each language.
|
||||
{{< /note >}}
|
||||
|
||||
6. Wait for review. Generally, reviewers are suggested by the `k8s-ci-robot`.
|
||||
If a reviewer asks you to make changes, you can go to the **Files changed**
|
||||
tab and click the pencil icon on any files that have been changed by the
|
||||
pull request. When you save the changed file, a new commit is created in
|
||||
the branch being monitored by the pull request. If you are waiting on a
|
||||
reviewer to review the changes, proactively reach out to the reviewer
|
||||
once every 7 days. You can also drop into #sig-docs Slack channel,
|
||||
which is a good place to ask for help regarding PR reviews.
|
||||
|
||||
7. If your change is accepted, a reviewer merges your pull request, and the
|
||||
change is live on the Kubernetes website a few minutes later.
|
||||
|
||||
This is only one way to submit a pull request. If you are already a Git and
|
||||
GitHub advanced user, you can use a local GUI or command-line Git client
|
||||
instead of using the GitHub UI. Some basics about using the command-line Git
|
||||
client are discussed in the [intermediate](/docs/contribute/intermediate/) docs
|
||||
contribution guide.
|
||||
|
||||
## Review docs pull requests
|
||||
|
||||
People who are new to documentation can still review pull requests. You can
|
||||
learn the code base and build trust with your fellow contributors. English docs
|
||||
are the authoritative source for content. We communicate in English during
|
||||
weekly meetings and in community announcements. Contributors' English skills
|
||||
vary, so use simple and direct language in your reviews. Effective reviews focus
|
||||
on both small details and a change's potential impact.
|
||||
|
||||
The reviews are not considered "binding", which means that your review alone
|
||||
won't cause a pull request to be merged. However, it can still be helpful. Even
|
||||
if you don't leave any review comments, you can get a sense of pull request
|
||||
conventions and etiquette and get used to the workflow. Familiarize yourself with the
|
||||
[content guide](/docs/contribute/style/content-guide/) and
|
||||
[style guide](/docs/contribute/style/style-guide/) before reviewing so you
|
||||
get an idea of what the content should contain and how it should look.
|
||||
|
||||
### Best practices
|
||||
|
||||
- Be polite, considerate, and helpful
|
||||
- Comment on positive aspects of PRs as well
|
||||
- Be empathetic and mindful of how your review may be received
|
||||
- Assume good intent and ask clarifying questions
|
||||
- Experienced contributors, consider pairing with new contributors whose work requires extensive changes
|
||||
|
||||
### How to find and review a pull request
|
||||
|
||||
1. Go to
|
||||
[https://github.com/kubernetes/website/pulls](https://github.com/kubernetes/website/pulls).
|
||||
You see a list of every open pull request against the Kubernetes website and
|
||||
docs.
|
||||
|
||||
2. By default, the only filter that is applied is `open`, so you don't see
|
||||
pull requests that have already been closed or merged. It's a good idea to
|
||||
apply the `cncf-cla: yes` filter, and for your first review, it's a good
|
||||
idea to add `size/S` or `size/XS`. The `size` label is applied automatically
|
||||
based on how many lines of code the PR modifies. You can apply filters using
|
||||
the selection boxes at the top of the page, or use
|
||||
[this shortcut](https://github.com/kubernetes/website/pulls?q=is%3Aopen+is%3Apr+label%3A%22cncf-cla%3A+yes%22+label%3Asize%2FS) for only small PRs. All filters are `AND`ed together, so
|
||||
you can't search for both `size/XS` and `size/S` in the same query.
|
||||
|
||||
3. Go to the **Files changed** tab. Look through the changes introduced in the
|
||||
PR, and if applicable, also look at any linked issues. If you see a problem
|
||||
or room for improvement, hover over the line and click the `+` symbol that
|
||||
appears.
|
||||
|
||||
You can type a comment, and either choose **Add single comment** or **Start
|
||||
a review**. Typically, starting a review is better because it allows you to
|
||||
leave multiple comments and notifies the PR owner only when you have
|
||||
completed the review, rather than a separate notification for each comment.
|
||||
|
||||
4. When finished, click **Review changes** at the top of the page. You can
|
||||
summarize your review, and you can choose to comment, approve, or request
|
||||
changes. New contributors should always choose **Comment**.
|
||||
|
||||
Thanks for reviewing a pull request! When you are new to the project, it's a
|
||||
good idea to ask for feedback on your pull request reviews. The `#sig-docs`
|
||||
Slack channel is a great place to do this.
|
||||
|
||||
## Write a blog post
|
||||
|
||||
Anyone can write a blog post and submit it for review. Blog posts should not be
|
||||
commercial in nature and should consist of content that will apply broadly to
|
||||
the Kubernetes community.
|
||||
|
||||
To submit a blog post, you can either submit it using the
|
||||
[Kubernetes blog submission form](https://docs.google.com/forms/d/e/1FAIpQLSdMpMoSIrhte5omZbTE7nB84qcGBy8XnnXhDFoW0h7p2zwXrw/viewform),
|
||||
or follow the steps below.
|
||||
|
||||
1. [Sign the CLA](#sign-the-cla) if you have not yet done so.
|
||||
2. Have a look at the Markdown format for existing blog posts in the
|
||||
[website repository](https://github.com/kubernetes/website/tree/master/content/en/blog/_posts).
|
||||
3. Write out your blog post in a text editor of your choice.
|
||||
4. On the same link from step 2, click the **Create new file** button. Paste
|
||||
your content into the editor. Name the file to match the proposed title of
|
||||
the blog post, but don't put the date in the file name. The blog reviewers
|
||||
will work with you on the final file name and the date the blog will be
|
||||
published.
|
||||
5. When you save the file, GitHub will walk you through the pull request
|
||||
process.
|
||||
6. A blog post reviewer will review your submission and work with you on
|
||||
feedback and final details. When the blog post is approved, the blog will be
|
||||
scheduled for publication.
|
||||
|
||||
## Submit a case study
|
||||
|
||||
Case studies highlight how organizations are using Kubernetes to solve
|
||||
real-world problems. They are written in collaboration with the Kubernetes
|
||||
marketing team, which is handled by the {{< glossary_tooltip text="CNCF" term_id="cncf" >}}.
|
||||
|
||||
Have a look at the source for the
|
||||
[existing case studies](https://github.com/kubernetes/website/tree/master/content/en/case-studies).
|
||||
Use the [Kubernetes case study submission form](https://www.cncf.io/people/end-user-community/)
|
||||
to submit your proposal.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture whatsnext %}}
|
||||
|
||||
When you are comfortable with all of the tasks discussed in this topic and you
|
||||
want to engage with the Kubernetes docs team in deeper ways, read the
|
||||
[intermediate docs contribution guide](/docs/contribute/intermediate/).
|
||||
|
||||
{{% /capture %}}
|
||||
|
|
@ -3,10 +3,6 @@ title: Documentation Content Guide
|
|||
linktitle: Content guide
|
||||
content_template: templates/concept
|
||||
weight: 10
|
||||
card:
|
||||
name: contribute
|
||||
weight: 20
|
||||
title: Documentation Content Guide
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
|
|
|
|||
|
|
@ -243,4 +243,4 @@ Renders to:
|
|||
* Learn about [using page templates](/docs/home/contribute/page-templates/).
|
||||
* Learn about [staging your changes](/docs/home/contribute/stage-documentation-changes/)
|
||||
* Learn about [creating a pull request](/docs/home/contribute/create-pull-request/).
|
||||
{{% /capture %}}
|
||||
{{% /capture %}}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,6 @@ title: Documentation Style Guide
|
|||
linktitle: Style guide
|
||||
content_template: templates/concept
|
||||
weight: 10
|
||||
card:
|
||||
name: contribute
|
||||
weight: 20
|
||||
title: Documentation Style Guide
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
|
|
@ -15,10 +11,12 @@ These are guidelines, not rules. Use your best judgment, and feel free to
|
|||
propose changes to this document in a pull request.
|
||||
|
||||
For additional information on creating new content for the Kubernetes
|
||||
documentation, read the [Documentation Content
|
||||
Guide](/docs/contribute/style/content-guide/) and follow the instructions on
|
||||
[using page templates](/docs/contribute/style/page-templates/) and [creating a
|
||||
documentation pull request](/docs/contribute/start/#improve-existing-content).
|
||||
documentation, read the [Documentation Content Guide](/docs/contribute/style/content-guide/) and follow the instructions on
|
||||
[using page templates](/docs/contribute/style/page-templates/) and [creating a documentation pull request](/docs/contribute/new-content/open-a-pr).
|
||||
|
||||
Changes to the style guide are made by SIG Docs as a group. To propose a change
|
||||
or addition, [add it to the agenda](https://docs.google.com/document/d/1ddHwLK3kUMX1wVFIwlksjTk0MsqitBnWPe1LRa1Rx5A/edit) for an upcoming SIG Docs meeting, and attend the meeting to participate in the
|
||||
discussion.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ This page shows how to create a new topic for the Kubernetes docs.
|
|||
|
||||
{{% capture prerequisites %}}
|
||||
Create a fork of the Kubernetes documentation repository as described in
|
||||
[Start contributing](/docs/contribute/start/).
|
||||
[Open a PR](/docs/new-content/open-a-pr/).
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture steps %}}
|
||||
|
|
@ -24,8 +24,8 @@ Type | Description
|
|||
:--- | :----------
|
||||
Concept | A concept page explains some aspect of Kubernetes. For example, a concept page might describe the Kubernetes Deployment object and explain the role it plays as an application while it is deployed, scaled, and updated. Typically, concept pages don't include sequences of steps, but instead provide links to tasks or tutorials. For an example of a concept topic, see <a href="/docs/concepts/architecture/nodes/">Nodes</a>.
|
||||
Task | A task page shows how to do a single thing. The idea is to give readers a sequence of steps that they can actually do as they read the page. A task page can be short or long, provided it stays focused on one area. In a task page, it is OK to blend brief explanations with the steps to be performed, but if you need to provide a lengthy explanation, you should do that in a concept topic. Related task and concept topics should link to each other. For an example of a short task page, see <a href="/docs/tasks/configure-pod-container/configure-volume-storage/">Configure a Pod to Use a Volume for Storage</a>. For an example of a longer task page, see <a href="/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/">Configure Liveness and Readiness Probes</a>
|
||||
Tutorial | A tutorial page shows how to accomplish a goal that ties together several Kubernetes features. A tutorial might provide several sequences of steps that readers can actually do as they read the page. Or it might provide explanations of related pieces of code. For example, a tutorial could provide a walkthrough of a code sample. A tutorial can include brief explanations of the Kubernetes features that are being tied together, but should link to related concept topics for deep explanations of individual features.
|
||||
{{< /table >}}
|
||||
Tutorial | A tutorial page shows how to accomplish a goal that ties together several Kubernetes features. A tutorial might provide several sequences of steps that readers can actually do as they read the page. Or it might provide explanations of related pieces of code. For example, a tutorial could provide a walkthrough of a code sample. A tutorial can include brief explanations of the Kubernetes features that are being tied together, but should link to related concept topics for deep explanations of individual features.
|
||||
{{< /table >}}
|
||||
|
||||
Use a template for each new page. Each page type has a
|
||||
[template](/docs/contribute/style/page-templates/)
|
||||
|
|
@ -162,7 +162,6 @@ image format is SVG.
|
|||
{{% /capture %}}
|
||||
|
||||
{{% capture whatsnext %}}
|
||||
* Learn about [using page templates](/docs/home/contribute/page-templates/).
|
||||
* Learn about [staging your changes](/docs/home/contribute/stage-documentation-changes/).
|
||||
* Learn about [creating a pull request](/docs/home/contribute/create-pull-request/).
|
||||
* Learn about [using page templates](/docs/contribute/page-templates/).
|
||||
* Learn about [creating a pull request](/docs/contribute/new-content/open-a-pr/).
|
||||
{{% /capture %}}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,65 @@
|
|||
---
|
||||
title: Suggesting content improvements
|
||||
slug: suggest-improvements
|
||||
content_template: templates/concept
|
||||
weight: 10
|
||||
card:
|
||||
name: contribute
|
||||
weight: 20
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
|
||||
If you notice an issue with Kubernetes documentation, or have an idea for new content, then open an issue. All you need is a [GitHub account](https://github.com/join) and a web browser.
|
||||
|
||||
In most cases, new work on Kubernetes documentation begins with an issue in GitHub. Kubernetes contributors
|
||||
then review, categorize and tag issues as needed. Next, you or another member
|
||||
of the Kubernetes community open a pull request with changes to resolve the issue.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture body %}}
|
||||
|
||||
## Opening an issue
|
||||
|
||||
If you want to suggest improvements to existing content, or notice an error, then open an issue.
|
||||
|
||||
1. Go to the bottom of the page and click the **Create an Issue** button. This redirects you
|
||||
to a GitHub issue page pre-populated with some headers.
|
||||
2. Describe the issue or suggestion for improvement. Provide as many details as you can.
|
||||
3. Click **Submit new issue**.
|
||||
|
||||
After submitting, check in on your issue occasionally or turn on GitHub notifications.
|
||||
Reviewers and other community members might ask questions before
|
||||
they can take action on your issue.
|
||||
|
||||
## Suggesting new content
|
||||
|
||||
If you have an idea for new content, but you aren't sure where it should go, you can
|
||||
still file an issue. Either:
|
||||
|
||||
- Choose an existing page in the section you think the content belongs in and click **Create an issue**.
|
||||
- Go to [GitHub](https://github.com/kubernetes/website/issues/new/) and file the issue directly.
|
||||
|
||||
## How to file great issues
|
||||
|
||||
|
||||
Keep the following in mind when filing an issue:
|
||||
|
||||
- Provide a clear issue description. Describe what specifically is missing, out of date,
|
||||
wrong, or needs improvement.
|
||||
- Explain the specific impact the issue has on users.
|
||||
- Limit the scope of a given issue to a reasonable unit of work. For problems
|
||||
with a large scope, break them down into smaller issues. For example, "Fix the security docs"
|
||||
is too broad, but "Add details to the 'Restricting network access' topic" is specific enough
|
||||
to be actionable.
|
||||
- Search the existing issues to see if there's anything related or similar to the
|
||||
new issue.
|
||||
- If the new issue relates to another issue or pull request, refer to it
|
||||
either by its full URL or by the issue or pull request number prefixed
|
||||
with a `#` character. For example, `Introduced by #987654`.
|
||||
- Follow the [Code of Conduct](/community/code-of-conduct/). Respect your
|
||||
fellow contributors. For example, "The docs are terrible" is not
|
||||
helpful or polite feedback.
|
||||
|
||||
{{% /capture %}}
|
||||
|
|
@ -1182,7 +1182,7 @@ allowed by *either* the RBAC or ABAC policies is allowed.
|
|||
|
||||
When the kube-apiserver is run with a log level of 5 or higher for the RBAC component
|
||||
(`--vmodule=rbac*=5` or `--v=5`), you can see RBAC denials in the API server log
|
||||
(prefixed with `RBAC DENY:`).
|
||||
(prefixed with `RBAC`).
|
||||
You can use that information to determine which roles need to be granted to which users, groups, or service accounts.
|
||||
|
||||
Once you have [granted roles to service accounts](#service-account-permissions) and workloads
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ id: cloud-controller-manager
|
|||
date: 2018-04-12
|
||||
full_link: /docs/tasks/administer-cluster/running-cloud-controller/
|
||||
short_description: >
|
||||
Cloud Controller Manager is an alpha feature in 1.8. In upcoming releases it will be the preferred way to integrate Kubernetes with any cloud.
|
||||
Cloud Controller Manager is a Kubernetes component that embeds cloud-specific control logic.
|
||||
|
||||
aka:
|
||||
tags:
|
||||
|
|
@ -12,8 +12,8 @@ tags:
|
|||
- architecture
|
||||
- operation
|
||||
---
|
||||
Cloud Controller Manager is an alpha feature in 1.8. In upcoming releases it will be the preferred way to integrate Kubernetes with any cloud.
|
||||
Cloud Controller Manager is a Kubernetes component that embeds cloud-specific control logic.
|
||||
|
||||
<!--more-->
|
||||
|
||||
Kubernetes v1.6 contains a new binary called cloud-controller-manager. cloud-controller-manager is a daemon that embeds cloud-specific control loops. These cloud-specific control loops were originally in the kube-controller-manager. Since cloud providers develop and release at a different pace compared to the Kubernetes project, abstracting the provider-specific code to the cloud-controller-manager binary allows cloud vendors to evolve independently from the core Kubernetes code.
|
||||
Originally part of the kube-controller-manager, the cloud-controller-manager is responsible to decoupling the interoperability logic between Kubernetes and the underlying cloud infrastructure, enabling cloud providers to release features at a different pace compared to the main project.
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
title: Container Runtime
|
||||
id: container-runtime
|
||||
date: 2019-06-05
|
||||
full_link: /docs/reference/generated/container-runtime
|
||||
full_link: /docs/setup/production-environment/container-runtimes
|
||||
short_description: >
|
||||
The container runtime is the software that is responsible for running containers.
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
title: HostAliases
|
||||
id: HostAliases
|
||||
date: 2019-01-31
|
||||
full_link: /docs/reference/generated/kubernetes-api/v1.13/#hostalias-v1-core
|
||||
full_link: /docs/reference/generated/kubernetes-api/{{< param "version" >}}/#hostalias-v1-core
|
||||
short_description: >
|
||||
A HostAliases is a mapping between the IP address and hostname to be injected into a Pod's hosts file.
|
||||
|
||||
|
|
@ -14,4 +14,4 @@ tags:
|
|||
|
||||
<!--more-->
|
||||
|
||||
[HostAliases](/docs/reference/generated/kubernetes-api/v1.13/#hostalias-v1-corev) is an optional list of hostnames and IP addresses that will be injected into the Pod's hosts file if specified. This is only valid for non-hostNetwork Pods.
|
||||
[HostAliases](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#hostalias-v1-core) is an optional list of hostnames and IP addresses that will be injected into the Pod's hosts file if specified. This is only valid for non-hostNetwork Pods.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
title: Service Account
|
||||
title: ServiceAccount
|
||||
id: service-account
|
||||
date: 2018-04-12
|
||||
full_link: /docs/tasks/configure-pod-container/configure-service-account/
|
||||
|
|
@ -16,4 +16,3 @@ tags:
|
|||
<!--more-->
|
||||
|
||||
When processes inside Pods access the cluster, they are authenticated by the API server as a particular service account, for example, `default`. When you create a Pod, if you do not specify a service account, it is automatically assigned the default service account in the same {{< glossary_tooltip text="Namespace" term_id="namespace" >}}.
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ A given Kubernetes server will only preserve a historical list of changes for a
|
|||
|
||||
### Watch bookmarks
|
||||
|
||||
To mitigate the impact of short history window, we introduced a concept of `bookmark` watch event. It is a special kind of event to pass an information that all changes up to a given `resourceVersion` client is requesting has already been sent. Object returned in that event is of the type requested by the request, but only `resourceVersion` field is set, e.g.:
|
||||
To mitigate the impact of short history window, we introduced a concept of `bookmark` watch event. It is a special kind of event to mark that all changes up to a given `resourceVersion` the client is requesting have already been sent. Object returned in that event is of the type requested by the request, but only `resourceVersion` field is set, e.g.:
|
||||
|
||||
GET /api/v1/namespaces/test/pods?watch=1&resourceVersion=10245&allowWatchBookmarks=true
|
||||
---
|
||||
|
|
@ -334,6 +334,17 @@ are not vulnerable to ordering changes in the list.
|
|||
Once the last finalizer is removed, the resource is actually removed from etcd.
|
||||
|
||||
|
||||
## Single resource API
|
||||
|
||||
API verbs GET, CREATE, UPDATE, PATCH, DELETE and PROXY support single resources only.
|
||||
These verbs with single resource support have no support for submitting
|
||||
multiple resources together in an ordered or unordered list or transaction.
|
||||
Clients including kubectl will parse a list of resources and make
|
||||
single-resource API requests.
|
||||
|
||||
API verbs LIST and WATCH support getting multiple resources, and
|
||||
DELETECOLLECTION supports deleting multiple resources.
|
||||
|
||||
## Dry-run
|
||||
|
||||
{{< feature-state for_k8s_version="v1.18" state="stable" >}}
|
||||
|
|
|
|||
|
|
@ -40,19 +40,15 @@ If you're learning Kubernetes, use the Docker-based solutions: tools supported b
|
|||
|
||||
|Community |Ecosystem |
|
||||
| ------------ | -------- |
|
||||
| [Minikube](/docs/setup/learning-environment/minikube/) | [CDK on LXD](https://www.ubuntu.com/kubernetes/docs/install-local) |
|
||||
| [kind (Kubernetes IN Docker)](/docs/setup/learning-environment/kind/) | [Docker Desktop](https://www.docker.com/products/docker-desktop)|
|
||||
| | [Minishift](https://docs.okd.io/latest/minishift/)|
|
||||
| [Minikube](/docs/setup/learning-environment/minikube/) | [Docker Desktop](https://www.docker.com/products/docker-desktop)|
|
||||
| [kind (Kubernetes IN Docker)](/docs/setup/learning-environment/kind/) | [Minishift](https://docs.okd.io/latest/minishift/)|
|
||||
| | [MicroK8s](https://microk8s.io/)|
|
||||
| | [IBM Cloud Private-CE (Community Edition)](https://github.com/IBM/deploy-ibm-cloud-private) |
|
||||
| | [IBM Cloud Private-CE (Community Edition) on Linux Containers](https://github.com/HSBawa/icp-ce-on-linux-containers)|
|
||||
| | [k3s](https://k3s.io)|
|
||||
|
||||
|
||||
## Production environment
|
||||
|
||||
When evaluating a solution for a production environment, consider which aspects of operating a Kubernetes cluster (or _abstractions_) you want to manage yourself or offload to a provider.
|
||||
|
||||
For a list of [Certified Kubernetes](https://github.com/cncf/k8s-conformance/#certified-kubernetes) providers, see "[Partners](https://kubernetes.io/partners/#conformance)".
|
||||
[Kubernetes Partners](https://kubernetes.io/partners/#conformance) includes a list of [Certified Kubernetes](https://github.com/cncf/k8s-conformance/#certified-kubernetes) providers.
|
||||
|
||||
{{% /capture %}}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ weight: 40
|
|||
|
||||
{{% capture overview %}}
|
||||
|
||||
{{< feature-state for_k8s_version="1.12" state="stable" >}}
|
||||
{{< feature-state for_k8s_version="v1.12" state="stable" >}}
|
||||
|
||||
The kubeadm `ClusterConfiguration` object exposes the field `extraArgs` that can override the default flags passed to control plane
|
||||
components such as the APIServer, ControllerManager and Scheduler. The components are defined using the following fields:
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ weight: 80
|
|||
|
||||
{{% capture overview %}}
|
||||
|
||||
{{< feature-state for_k8s_version="1.11" state="stable" >}}
|
||||
{{< feature-state for_k8s_version="v1.11" state="stable" >}}
|
||||
|
||||
The lifecycle of the kubeadm CLI tool is decoupled from the
|
||||
[kubelet](/docs/reference/command-line-tools-reference/kubelet), which is a daemon that runs
|
||||
|
|
|
|||
|
|
@ -149,12 +149,12 @@ users:
|
|||
username: exp
|
||||
```
|
||||
|
||||
The `fake-ca-file`, `fake-cert-file` and `fake-key-file` above is the placeholders
|
||||
for the real path of the certification files. You need change these to the real path
|
||||
of certification files in your environment.
|
||||
The `fake-ca-file`, `fake-cert-file` and `fake-key-file` above are the placeholders
|
||||
for the pathnames of the certificate files. You need change these to the actual pathnames
|
||||
of certificate files in your environment.
|
||||
|
||||
Some times you may want to use base64 encoded data here instead of the path of the
|
||||
certification files, then you need add the suffix `-data` to the keys. For example,
|
||||
Sometimes you may want to use Base64-encoded data embedded here instead of separate
|
||||
certificate files; in that case you need add the suffix `-data` to the keys, for example,
|
||||
`certificate-authority-data`, `client-certificate-data`, `client-key-data`.
|
||||
|
||||
Each context is a triple (cluster, user, namespace). For example, the
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ the version.
|
|||
|
||||
## Webhook conversion
|
||||
|
||||
{{< feature-state state="stable" for_kubernetes_version="1.16" >}}
|
||||
{{< feature-state state="stable" for_k8s_version="v1.16" >}}
|
||||
|
||||
{{< note >}}
|
||||
Webhook conversion is available as beta since 1.15, and as alpha since Kubernetes 1.13. The
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ If you later recreate the same CustomResourceDefinition, it will start out empty
|
|||
|
||||
## Specifying a structural schema
|
||||
|
||||
{{< feature-state state="stable" for_kubernetes_version="1.16" >}}
|
||||
{{< feature-state state="stable" for_k8s_version="v1.16" >}}
|
||||
|
||||
CustomResources traditionally store arbitrary JSON (next to `apiVersion`, `kind` and `metadata`, which is validated by the API server implicitly). With [OpenAPI v3.0 validation](/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions/#validation) a schema can be specified, which is validated during creation and updates, compare below for details and limits of such a schema.
|
||||
|
||||
|
|
@ -364,7 +364,7 @@ Structural schemas are a requirement for `apiextensions.k8s.io/v1`, and disables
|
|||
|
||||
### Pruning versus preserving unknown fields
|
||||
|
||||
{{< feature-state state="stable" for_kubernetes_version="1.16" >}}
|
||||
{{< feature-state state="stable" for_k8s_version="v1.16" >}}
|
||||
|
||||
CustomResourceDefinitions traditionally store any (possibly validated) JSON as is in etcd. This means that unspecified fields (if there is a [OpenAPI v3.0 validation schema](/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions/#validation) at all) are persisted. This is in contrast to native Kubernetes resources such as a pod where unknown fields are dropped before being persisted to etcd. We call this "pruning" of unknown fields.
|
||||
|
||||
|
|
@ -604,7 +604,7 @@ meaning all finalizers have been executed.
|
|||
|
||||
### Validation
|
||||
|
||||
{{< feature-state state="stable" for_kubernetes_version="1.16" >}}
|
||||
{{< feature-state state="stable" for_k8s_version="v1.16" >}}
|
||||
|
||||
Validation of custom objects is possible via
|
||||
[OpenAPI v3 schemas](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#schemaObject) or [validatingadmissionwebhook](/docs/reference/access-authn-authz/admission-controllers/#validatingadmissionwebhook). In `apiextensions.k8s.io/v1` schemas are required, in `apiextensions.k8s.io/v1beta1` they are optional.
|
||||
|
|
@ -781,7 +781,7 @@ crontab "my-new-cron-object" created
|
|||
|
||||
### Defaulting
|
||||
|
||||
{{< feature-state state="stable" for_kubernetes_version="1.17" >}}
|
||||
{{< feature-state state="stable" for_k8s_version="v1.17" >}}
|
||||
|
||||
{{< note >}}
|
||||
To use defaulting, your CustomResourceDefinition must use API version `apiextensions.k8s.io/v1`.
|
||||
|
|
@ -866,7 +866,7 @@ Default values for `metadata` fields of `x-kubernetes-embedded-resources: true`
|
|||
|
||||
### Publish Validation Schema in OpenAPI v2
|
||||
|
||||
{{< feature-state state="stable" for_kubernetes_version="1.16" >}}
|
||||
{{< feature-state state="stable" for_k8s_version="v1.16" >}}
|
||||
|
||||
{{< note >}}
|
||||
OpenAPI v2 Publishing is available as beta since 1.15, and as alpha since 1.14. The
|
||||
|
|
@ -1051,7 +1051,7 @@ The column's `format` controls the style used when `kubectl` prints the value.
|
|||
|
||||
### Subresources
|
||||
|
||||
{{< feature-state state="stable" for_kubernetes_version="1.16" >}}
|
||||
{{< feature-state state="stable" for_k8s_version="v1.16" >}}
|
||||
|
||||
Custom resources support `/status` and `/scale` subresources.
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ In upcoming releases, Cloud Controller Manager will
|
|||
be the preferred way to integrate Kubernetes with any cloud. This will ensure cloud providers
|
||||
can develop their features independently from the core Kubernetes release cycles.
|
||||
|
||||
{{< feature-state for_k8s_version="1.8" state="alpha" >}}
|
||||
{{< feature-state for_k8s_version="v1.8" state="alpha" >}}
|
||||
|
||||
Before going into how to build your own cloud controller manager, some background on how it works under the hood is helpful. The cloud controller manager is code from `kube-controller-manager` utilizing Go interfaces to allow implementations from any cloud to be plugged in. Most of the scaffolding and generic controller implementations will be in core, but it will always exec out to the cloud interfaces it is provided, so long as the [cloud provider interface](https://github.com/kubernetes/cloud-provider/blob/master/cloud.go#L42-L62) is satisfied.
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ content_template: templates/task
|
|||
|
||||
{{% capture overview %}}
|
||||
|
||||
{{< feature-state for_k8s_version="1.5" state="alpha" >}}
|
||||
{{< feature-state for_k8s_version="v1.5" state="alpha" >}}
|
||||
|
||||
You can replicate Kubernetes masters in `kube-up` or `kube-down` scripts for Google Compute Engine.
|
||||
This document describes how to use kube-up/down scripts to manage highly available (HA) masters and how HA masters are implemented for use with GCE.
|
||||
|
|
|
|||
|
|
@ -50,18 +50,18 @@ The upgrade workflow at high level is the following:
|
|||
|
||||
## Determine which version to upgrade to
|
||||
|
||||
1. Find the latest stable 1.17 version:
|
||||
1. Find the latest stable 1.18 version:
|
||||
|
||||
{{< tabs name="k8s_install_versions" >}}
|
||||
{{% tab name="Ubuntu, Debian or HypriotOS" %}}
|
||||
apt update
|
||||
apt-cache madison kubeadm
|
||||
# find the latest 1.17 version in the list
|
||||
# find the latest 1.18 version in the list
|
||||
# it should look like 1.18.x-00, where x is the latest patch
|
||||
{{% /tab %}}
|
||||
{{% tab name="CentOS, RHEL or Fedora" %}}
|
||||
yum list --showduplicates kubeadm --disableexcludes=kubernetes
|
||||
# find the latest 1.17 version in the list
|
||||
# find the latest 1.18 version in the list
|
||||
# it should look like 1.18.x-0, where x is the latest patch
|
||||
{{% /tab %}}
|
||||
{{< /tabs >}}
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ If you attempt to use `kubectl exec` to create a shell you will see an error
|
|||
because there is no shell in this container image.
|
||||
|
||||
```shell
|
||||
kubectl exec -it pause -- sh
|
||||
kubectl exec -it ephemeral-demo -- sh
|
||||
```
|
||||
|
||||
```
|
||||
|
|
|
|||
|
|
@ -43,21 +43,39 @@ To enable the rolling update feature of a DaemonSet, you must set its
|
|||
You may want to set [`.spec.updateStrategy.rollingUpdate.maxUnavailable`](/docs/concepts/workloads/controllers/deployment/#max-unavailable) (default
|
||||
to 1) and [`.spec.minReadySeconds`](/docs/concepts/workloads/controllers/deployment/#min-ready-seconds) (default to 0) as well.
|
||||
|
||||
### Creating a DaemonSet with `RollingUpdate` update strategy
|
||||
|
||||
### Step 1: Checking DaemonSet `RollingUpdate` update strategy
|
||||
This YAML file specifies a DaemonSet with an update strategy as 'RollingUpdate'
|
||||
|
||||
First, check the update strategy of your DaemonSet, and make sure it's set to
|
||||
{{< codenew file="controllers/fluentd-daemonset.yaml" >}}
|
||||
|
||||
After verifying the update strategy of the DaemonSet manifest, create the DaemonSet:
|
||||
|
||||
```shell
|
||||
kubectl create -f https://k8s.io/examples/controllers/fluentd-daemonset.yaml
|
||||
```
|
||||
|
||||
Alternatively, use `kubectl apply` to create the same DaemonSet if you plan to
|
||||
update the DaemonSet with `kubectl apply`.
|
||||
|
||||
```shell
|
||||
kubectl apply -f https://k8s.io/examples/controllers/fluentd-daemonset.yaml
|
||||
```
|
||||
|
||||
### Checking DaemonSet `RollingUpdate` update strategy
|
||||
|
||||
Check the update strategy of your DaemonSet, and make sure it's set to
|
||||
`RollingUpdate`:
|
||||
|
||||
```shell
|
||||
kubectl get ds/<daemonset-name> -o go-template='{{.spec.updateStrategy.type}}{{"\n"}}'
|
||||
kubectl get ds/fluentd-elasticsearch -o go-template='{{.spec.updateStrategy.type}}{{"\n"}}' -n kube-system
|
||||
```
|
||||
|
||||
If you haven't created the DaemonSet in the system, check your DaemonSet
|
||||
manifest with the following command instead:
|
||||
|
||||
```shell
|
||||
kubectl apply -f ds.yaml --dry-run=client -o go-template='{{.spec.updateStrategy.type}}{{"\n"}}'
|
||||
kubectl apply -f https://k8s.io/examples/controllers/fluentd-daemonset.yaml --dry-run=client -o go-template='{{.spec.updateStrategy.type}}{{"\n"}}'
|
||||
```
|
||||
|
||||
The output from both commands should be:
|
||||
|
|
@ -69,28 +87,13 @@ RollingUpdate
|
|||
If the output isn't `RollingUpdate`, go back and modify the DaemonSet object or
|
||||
manifest accordingly.
|
||||
|
||||
### Step 2: Creating a DaemonSet with `RollingUpdate` update strategy
|
||||
|
||||
If you have already created the DaemonSet, you may skip this step and jump to
|
||||
step 3.
|
||||
|
||||
After verifying the update strategy of the DaemonSet manifest, create the DaemonSet:
|
||||
|
||||
```shell
|
||||
kubectl create -f ds.yaml
|
||||
```
|
||||
|
||||
Alternatively, use `kubectl apply` to create the same DaemonSet if you plan to
|
||||
update the DaemonSet with `kubectl apply`.
|
||||
|
||||
```shell
|
||||
kubectl apply -f ds.yaml
|
||||
```
|
||||
|
||||
### Step 3: Updating a DaemonSet template
|
||||
### Updating a DaemonSet template
|
||||
|
||||
Any updates to a `RollingUpdate` DaemonSet `.spec.template` will trigger a rolling
|
||||
update. This can be done with several different `kubectl` commands.
|
||||
update. Let's update the DaemonSet by applying a new YAML file. This can be done with several different `kubectl` commands.
|
||||
|
||||
{{< codenew file="controllers/fluentd-daemonset-update.yaml" >}}
|
||||
|
||||
#### Declarative commands
|
||||
|
||||
|
|
@ -99,21 +102,17 @@ If you update DaemonSets using
|
|||
use `kubectl apply`:
|
||||
|
||||
```shell
|
||||
kubectl apply -f ds-v2.yaml
|
||||
kubectl apply -f https://k8s.io/examples/application/fluentd-daemonset-update.yaml
|
||||
```
|
||||
|
||||
#### Imperative commands
|
||||
|
||||
If you update DaemonSets using
|
||||
[imperative commands](/docs/tasks/manage-kubernetes-objects/imperative-command/),
|
||||
use `kubectl edit` or `kubectl patch`:
|
||||
use `kubectl edit` :
|
||||
|
||||
```shell
|
||||
kubectl edit ds/<daemonset-name>
|
||||
```
|
||||
|
||||
```shell
|
||||
kubectl patch ds/<daemonset-name> -p=<strategic-merge-patch>
|
||||
kubectl edit ds/fluentd-elasticsearch -n kube-system
|
||||
```
|
||||
|
||||
##### Updating only the container image
|
||||
|
|
@ -122,21 +121,21 @@ If you just need to update the container image in the DaemonSet template, i.e.
|
|||
`.spec.template.spec.containers[*].image`, use `kubectl set image`:
|
||||
|
||||
```shell
|
||||
kubectl set image ds/<daemonset-name> <container-name>=<container-new-image>
|
||||
kubectl set image ds/fluentd-elasticsearch fluentd-elasticsearch=quay.io/fluentd_elasticsearch/fluentd:v2.6.0 -n kube-system
|
||||
```
|
||||
|
||||
### Step 4: Watching the rolling update status
|
||||
### Watching the rolling update status
|
||||
|
||||
Finally, watch the rollout status of the latest DaemonSet rolling update:
|
||||
|
||||
```shell
|
||||
kubectl rollout status ds/<daemonset-name>
|
||||
kubectl rollout status ds/fluentd-elasticsearch -n kube-system
|
||||
```
|
||||
|
||||
When the rollout is complete, the output is similar to this:
|
||||
|
||||
```shell
|
||||
daemonset "<daemonset-name>" successfully rolled out
|
||||
daemonset "fluentd-elasticsearch" successfully rolled out
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
|
@ -156,7 +155,7 @@ When this happens, find the nodes that don't have the DaemonSet pods scheduled o
|
|||
by comparing the output of `kubectl get nodes` and the output of:
|
||||
|
||||
```shell
|
||||
kubectl get pods -l <daemonset-selector-key>=<daemonset-selector-value> -o wide
|
||||
kubectl get pods -l name=fluentd-elasticsearch -o wide -n kube-system
|
||||
```
|
||||
|
||||
Once you've found those nodes, delete some non-DaemonSet pods from the node to
|
||||
|
|
@ -183,6 +182,13 @@ If `.spec.minReadySeconds` is specified in the DaemonSet, clock skew between
|
|||
master and nodes will make DaemonSet unable to detect the right rollout
|
||||
progress.
|
||||
|
||||
## Clean up
|
||||
|
||||
Delete DaemonSet from a namespace :
|
||||
|
||||
```shell
|
||||
kubectl delete ds fluentd-elasticsearch -n kube-system
|
||||
```
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ title: Schedule GPUs
|
|||
|
||||
{{% capture overview %}}
|
||||
|
||||
{{< feature-state state="beta" for_k8s_version="1.10" >}}
|
||||
{{< feature-state state="beta" for_k8s_version="v1.10" >}}
|
||||
|
||||
Kubernetes includes **experimental** support for managing AMD and NVIDIA GPUs
|
||||
(graphical processing units) across several nodes.
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ metrics-server, which needs to be launched separately. See
|
|||
for instructions. The HorizontalPodAutoscaler can also fetch metrics directly from Heapster.
|
||||
|
||||
{{< note >}}
|
||||
{{< feature-state state="deprecated" for_k8s_version="1.11" >}}
|
||||
{{< feature-state state="deprecated" for_k8s_version="v1.11" >}}
|
||||
Fetching metrics from Heapster is deprecated as of Kubernetes 1.11.
|
||||
{{< /note >}}
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ a Deployment that runs the nginx:1.14.2 Docker image:
|
|||
## Updating the deployment
|
||||
|
||||
You can update the deployment by applying a new YAML file. This YAML file
|
||||
specifies that the deployment should be updated to use nginx 1.8.
|
||||
specifies that the deployment should be updated to use nginx 1.16.1.
|
||||
|
||||
{{< codenew file="application/deployment-update.yaml" >}}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: "Setup Konnectivity Service"
|
||||
weight: 20
|
||||
---
|
||||
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
---
|
||||
title: Set up Konnectivity service
|
||||
content_template: templates/task
|
||||
weight: 70
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
|
||||
The Konnectivity service provides TCP level proxy for the Master → Cluster
|
||||
communication.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture prerequisites %}}
|
||||
|
||||
{{< include "task-tutorial-prereqs.md" >}}
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture steps %}}
|
||||
|
||||
## Configure the Konnectivity service
|
||||
|
||||
First, you need to configure the API Server to use the Konnectivity service
|
||||
to direct its network traffic to cluster nodes:
|
||||
|
||||
1. Set the `--egress-selector-config-file` flag of the API Server, it is the
|
||||
path to the API Server egress configuration file.
|
||||
1. At the path, create a configuration file. For example,
|
||||
|
||||
{{< codenew file="admin/konnectivity/egress-selector-configuration.yaml" >}}
|
||||
|
||||
Next, you need to deploy the Konnectivity server and agents.
|
||||
[kubernetes-sigs/apiserver-network-proxy](https://github.com/kubernetes-sigs/apiserver-network-proxy)
|
||||
is a reference implementation.
|
||||
|
||||
Deploy the Konnectivity server on your master node. The provided yaml assumes
|
||||
that the Kubernetes components are deployed as a {{< glossary_tooltip text="static Pod"
|
||||
term_id="static-pod" >}} in your cluster. If not, you can deploy the Konnectivity
|
||||
server as a DaemonSet.
|
||||
|
||||
{{< codenew file="admin/konnectivity/konnectivity-server.yaml" >}}
|
||||
|
||||
Then deploy the Konnectivity agents in your cluster:
|
||||
|
||||
{{< codenew file="admin/konnectivity/konnectivity-agent.yaml" >}}
|
||||
|
||||
Last, if RBAC is enabled in your cluster, create the relevant RBAC rules:
|
||||
|
||||
{{< codenew file="admin/konnectivity/konnectivity-rbac.yaml" >}}
|
||||
|
||||
{{% /capture %}}
|
||||
|
|
@ -59,7 +59,7 @@ You must use a kubectl version that is within one minor version difference of yo
|
|||
|
||||
{{< tabs name="kubectl_install" >}}
|
||||
{{< tab name="Ubuntu, Debian or HypriotOS" codelang="bash" >}}
|
||||
sudo apt-get update && sudo apt-get install -y apt-transport-https
|
||||
sudo apt-get update && sudo apt-get install -y apt-transport-https gnupg2
|
||||
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
|
||||
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list
|
||||
sudo apt-get update
|
||||
|
|
@ -419,7 +419,7 @@ You can test if you have bash-completion v2 already installed with `type _init_c
|
|||
brew install bash-completion@2
|
||||
```
|
||||
|
||||
As stated in the output of this command, add the following to your `~/.bashrc` file:
|
||||
As stated in the output of this command, add the following to your `~/.bash_profile` file:
|
||||
|
||||
```shell
|
||||
export BASH_COMPLETION_COMPAT_DIR="/usr/local/etc/bash_completion.d"
|
||||
|
|
@ -432,10 +432,10 @@ Reload your shell and verify that bash-completion v2 is correctly installed with
|
|||
|
||||
You now have to ensure that the kubectl completion script gets sourced in all your shell sessions. There are multiple ways to achieve this:
|
||||
|
||||
- Source the completion script in your `~/.bashrc` file:
|
||||
- Source the completion script in your `~/.bash_profile` file:
|
||||
|
||||
```shell
|
||||
echo 'source <(kubectl completion bash)' >>~/.bashrc
|
||||
echo 'source <(kubectl completion bash)' >>~/.bash_profile
|
||||
|
||||
```
|
||||
|
||||
|
|
@ -448,8 +448,8 @@ You now have to ensure that the kubectl completion script gets sourced in all yo
|
|||
- If you have an alias for kubectl, you can extend shell completion to work with that alias:
|
||||
|
||||
```shell
|
||||
echo 'alias k=kubectl' >>~/.bashrc
|
||||
echo 'complete -F __start_kubectl k' >>~/.bashrc
|
||||
echo 'alias k=kubectl' >>~/.bash_profile
|
||||
echo 'complete -F __start_kubectl k' >>~/.bash_profile
|
||||
```
|
||||
|
||||
- If you installed kubectl with Homebrew (as explained [above](#install-with-homebrew-on-macos)), then the kubectl completion script should already be in `/usr/local/etc/bash_completion.d/kubectl`. In that case, you don't need to do anything.
|
||||
|
|
|
|||
|
|
@ -31,7 +31,8 @@ weight: 10
|
|||
Once you have a running Kubernetes cluster, you can deploy your containerized applications on top of it.
|
||||
To do so, you create a Kubernetes <b>Deployment</b> configuration. The Deployment instructs Kubernetes
|
||||
how to create and update instances of your application. Once you've created a Deployment, the Kubernetes
|
||||
master schedules mentioned application instances onto individual Nodes in the cluster.
|
||||
master schedules the application instances included in that Deployment to run on individual Nodes in the
|
||||
cluster.
|
||||
</p>
|
||||
|
||||
<p>Once the application instances are created, a Kubernetes Deployment Controller continuously monitors those instances. If the Node hosting an instance goes down or is deleted, the Deployment controller replaces the instance with an instance on another Node in the cluster. <b>This provides a self-healing mechanism to address machine failure or maintenance.</b></p>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
title: "Example: Deploying Cassandra with Stateful Sets"
|
||||
title: "Example: Deploying Cassandra with a StatefulSet"
|
||||
reviewers:
|
||||
- ahmetb
|
||||
content_template: templates/tutorial
|
||||
|
|
@ -7,79 +7,66 @@ weight: 30
|
|||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
This tutorial shows you how to develop a native cloud [Cassandra](http://cassandra.apache.org/) deployment on Kubernetes. In this example, a custom Cassandra *SeedProvider* enables Cassandra to discover new Cassandra nodes as they join the cluster.
|
||||
This tutorial shows you how to run [Apache Cassandra](http://cassandra.apache.org/) on Kubernetes. Cassandra, a database, needs persistent storage to provide data durability (application _state_). In this example, a custom Cassandra seed provider lets the database discover new Cassandra instances as they join the Cassandra cluster.
|
||||
|
||||
*StatefulSets* make it easier to deploy stateful applications within a clustered environment. For more information on the features used in this tutorial, see the [*StatefulSet*](/docs/concepts/workloads/controllers/statefulset/) documentation.
|
||||
*StatefulSets* make it easier to deploy stateful applications into your Kubernetes cluster. For more information on the features used in this tutorial, see [StatefulSet](/docs/concepts/workloads/controllers/statefulset/).
|
||||
|
||||
**Cassandra on Docker**
|
||||
|
||||
The *Pods* in this tutorial use the [`gcr.io/google-samples/cassandra:v13`](https://github.com/kubernetes/examples/blob/master/cassandra/image/Dockerfile)
|
||||
image from Google's [container registry](https://cloud.google.com/container-registry/docs/).
|
||||
The Docker image above is based on [debian-base](https://github.com/kubernetes/kubernetes/tree/master/build/debian-base)
|
||||
and includes OpenJDK 8.
|
||||
|
||||
This image includes a standard Cassandra installation from the Apache Debian repo.
|
||||
By using environment variables you can change values that are inserted into `cassandra.yaml`.
|
||||
|
||||
| ENV VAR | DEFAULT VALUE |
|
||||
| ------------- |:-------------: |
|
||||
| `CASSANDRA_CLUSTER_NAME` | `'Test Cluster'` |
|
||||
| `CASSANDRA_NUM_TOKENS` | `32` |
|
||||
| `CASSANDRA_RPC_ADDRESS` | `0.0.0.0` |
|
||||
{{< note >}}
|
||||
Cassandra and Kubernetes both use the term _node_ to mean a member of a cluster. In this
|
||||
tutorial, the Pods that belong to the StatefulSet are Cassandra nodes and are members
|
||||
of the Cassandra cluster (called a _ring_). When those Pods run in your Kubernetes cluster,
|
||||
the Kubernetes control plane schedules those Pods onto Kubernetes
|
||||
{{< glossary_tooltip text="Nodes" term_id="node" >}}.
|
||||
|
||||
When a Cassandra node starts, it uses a _seed list_ to bootstrap discovery of other
|
||||
nodes in the ring.
|
||||
This tutorial deploys a custom Cassandra seed provider that lets the database discover
|
||||
new Cassandra Pods as they appear inside your Kubernetes cluster.
|
||||
{{< /note >}}
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture objectives %}}
|
||||
* Create and validate a Cassandra headless [*Service*](/docs/concepts/services-networking/service/).
|
||||
* Use a [StatefulSet](/docs/concepts/workloads/controllers/statefulset/) to create a Cassandra ring.
|
||||
* Validate the [StatefulSet](/docs/concepts/workloads/controllers/statefulset/).
|
||||
* Modify the [StatefulSet](/docs/concepts/workloads/controllers/statefulset/).
|
||||
* Delete the [StatefulSet](/docs/concepts/workloads/controllers/statefulset/) and its [Pods](/docs/concepts/workloads/pods/pod/).
|
||||
* Create and validate a Cassandra headless {{< glossary_tooltip text="Service" term_id="service" >}}.
|
||||
* Use a {{< glossary_tooltip term_id="StatefulSet" >}} to create a Cassandra ring.
|
||||
* Validate the StatefulSet.
|
||||
* Modify the StatefulSet.
|
||||
* Delete the StatefulSet and its {{< glossary_tooltip text="Pods" term_id="pod" >}}.
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture prerequisites %}}
|
||||
To complete this tutorial, you should already have a basic familiarity with [Pods](/docs/concepts/workloads/pods/pod/), [Services](/docs/concepts/services-networking/service/), and [StatefulSets](/docs/concepts/workloads/controllers/statefulset/). In addition, you should:
|
||||
{{< include "task-tutorial-prereqs.md" >}}
|
||||
|
||||
* [Install and Configure](/docs/tasks/tools/install-kubectl/) the *kubectl* command-line tool
|
||||
To complete this tutorial, you should already have a basic familiarity with {{< glossary_tooltip text="Pods" term_id="pod" >}}, {{< glossary_tooltip text="Services" term_id="service" >}}, and {{< glossary_tooltip text="StatefulSets" term_id="StatefulSet" >}}.
|
||||
|
||||
* Download [`cassandra-service.yaml`](/examples/application/cassandra/cassandra-service.yaml)
|
||||
and [`cassandra-statefulset.yaml`](/examples/application/cassandra/cassandra-statefulset.yaml)
|
||||
|
||||
* Have a supported Kubernetes cluster running
|
||||
|
||||
{{< note >}}
|
||||
Please read the [setup](/docs/setup/) if you do not already have a cluster.
|
||||
{{< /note >}}
|
||||
|
||||
### Additional Minikube Setup Instructions
|
||||
### Additional Minikube setup instructions
|
||||
|
||||
{{< caution >}}
|
||||
[Minikube](/docs/getting-started-guides/minikube/) defaults to 1024MB of memory and 1 CPU. Running Minikube with the default resource configuration results in insufficient resource errors during this tutorial. To avoid these errors, start Minikube with the following settings:
|
||||
[Minikube](/docs/getting-started-guides/minikube/) defaults to 1024MiB of memory and 1 CPU. Running Minikube with the default resource configuration results in insufficient resource errors during this tutorial. To avoid these errors, start Minikube with the following settings:
|
||||
|
||||
```shell
|
||||
minikube start --memory 5120 --cpus=4
|
||||
```
|
||||
{{< /caution >}}
|
||||
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture lessoncontent %}}
|
||||
## Creating a Cassandra Headless Service
|
||||
## Creating a headless Service for Cassandra {#creating-a-cassandra-headless-service}
|
||||
|
||||
A Kubernetes [Service](/docs/concepts/services-networking/service/) describes a set of [Pods](/docs/concepts/workloads/pods/pod/) that perform the same task.
|
||||
In Kubernetes, a {{< glossary_tooltip text="Service" term_id="service" >}} describes a set of {{< glossary_tooltip text="Pods" term_id="pod" >}} that perform the same task.
|
||||
|
||||
The following `Service` is used for DNS lookups between Cassandra Pods and clients within the Kubernetes cluster.
|
||||
The following Service is used for DNS lookups between Cassandra Pods and clients within your cluster:
|
||||
|
||||
{{< codenew file="application/cassandra/cassandra-service.yaml" >}}
|
||||
|
||||
1. Launch a terminal window in the directory you downloaded the manifest files.
|
||||
1. Create a Service to track all Cassandra StatefulSet nodes from the `cassandra-service.yaml` file:
|
||||
Create a Service to track all Cassandra StatefulSet members from the `cassandra-service.yaml` file:
|
||||
|
||||
```shell
|
||||
kubectl apply -f https://k8s.io/examples/application/cassandra/cassandra-service.yaml
|
||||
```
|
||||
```shell
|
||||
kubectl apply -f https://k8s.io/examples/application/cassandra/cassandra-service.yaml
|
||||
```
|
||||
|
||||
### Validating (optional)
|
||||
|
||||
### Validating (optional) {#validating}
|
||||
|
||||
Get the Cassandra Service.
|
||||
|
||||
|
|
@ -94,9 +81,9 @@ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
|||
cassandra ClusterIP None <none> 9042/TCP 45s
|
||||
```
|
||||
|
||||
Service creation failed if anything else is returned. Read [Debug Services](/docs/tasks/debug-application-cluster/debug-service/) for common issues.
|
||||
If you don't see a Service named `cassandra`, that means creation failed. Read [Debug Services](/docs/tasks/debug-application-cluster/debug-service/) for help troubleshooting common issues.
|
||||
|
||||
## Using a StatefulSet to Create a Cassandra Ring
|
||||
## Using a StatefulSet to create a Cassandra ring
|
||||
|
||||
The StatefulSet manifest, included below, creates a Cassandra ring that consists of three Pods.
|
||||
|
||||
|
|
@ -106,14 +93,23 @@ This example uses the default provisioner for Minikube. Please update the follow
|
|||
|
||||
{{< codenew file="application/cassandra/cassandra-statefulset.yaml" >}}
|
||||
|
||||
1. Update the StatefulSet if necessary.
|
||||
1. Create the Cassandra StatefulSet from the `cassandra-statefulset.yaml` file:
|
||||
Create the Cassandra StatefulSet from the `cassandra-statefulset.yaml` file:
|
||||
|
||||
```shell
|
||||
kubectl apply -f https://k8s.io/examples/application/cassandra/cassandra-statefulset.yaml
|
||||
```
|
||||
```shell
|
||||
# Use this if you are able to apply cassandra-statefulset.yaml unmodified
|
||||
kubectl apply -f https://k8s.io/examples/application/cassandra/cassandra-statefulset.yaml
|
||||
```
|
||||
|
||||
## Validating The Cassandra StatefulSet
|
||||
If you need to modify `cassandra-statefulset.yaml` to suit your cluster, download
|
||||
https://k8s.io/examples/application/cassandra/cassandra-statefulset.yaml and then apply
|
||||
that manifest, from the folder you saved the modified version into:
|
||||
```shell
|
||||
# Use this if you needed to modify cassandra-statefulset.yaml locally
|
||||
kubectl apply -f cassandra-statefulset.yaml
|
||||
```
|
||||
|
||||
|
||||
## Validating the Cassandra StatefulSet
|
||||
|
||||
1. Get the Cassandra StatefulSet:
|
||||
|
||||
|
|
@ -121,31 +117,32 @@ This example uses the default provisioner for Minikube. Please update the follow
|
|||
kubectl get statefulset cassandra
|
||||
```
|
||||
|
||||
The response should be:
|
||||
The response should be similar to:
|
||||
|
||||
```
|
||||
NAME DESIRED CURRENT AGE
|
||||
cassandra 3 0 13s
|
||||
```
|
||||
|
||||
The `StatefulSet` resource deploys Pods sequentially.
|
||||
The `StatefulSet` resource deploys Pods sequentially.
|
||||
|
||||
1. Get the Pods to see the ordered creation status:
|
||||
|
||||
```shell
|
||||
kubectl get pods -l="app=cassandra"
|
||||
```
|
||||
|
||||
The response should be:
|
||||
|
||||
|
||||
The response should be similar to:
|
||||
|
||||
```shell
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
cassandra-0 1/1 Running 0 1m
|
||||
cassandra-1 0/1 ContainerCreating 0 8s
|
||||
```
|
||||
|
||||
It can take several minutes for all three Pods to deploy. Once they are deployed, the same command returns:
|
||||
|
||||
|
||||
It can take several minutes for all three Pods to deploy. Once they are deployed, the same command
|
||||
returns output similar to:
|
||||
|
||||
```
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
cassandra-0 1/1 Running 0 10m
|
||||
|
|
@ -153,13 +150,14 @@ This example uses the default provisioner for Minikube. Please update the follow
|
|||
cassandra-2 1/1 Running 0 8m
|
||||
```
|
||||
|
||||
3. Run the Cassandra [nodetool](https://wiki.apache.org/cassandra/NodeTool) to display the status of the ring.
|
||||
3. Run the Cassandra [nodetool](https://cwiki.apache.org/confluence/display/CASSANDRA2/NodeTool) inside the first Pod, to
|
||||
display the status of the ring.
|
||||
|
||||
```shell
|
||||
kubectl exec -it cassandra-0 -- nodetool status
|
||||
```
|
||||
|
||||
The response should look something like this:
|
||||
The response should look something like:
|
||||
|
||||
```
|
||||
Datacenter: DC1-K8Demo
|
||||
|
|
@ -174,7 +172,7 @@ This example uses the default provisioner for Minikube. Please update the follow
|
|||
|
||||
## Modifying the Cassandra StatefulSet
|
||||
|
||||
Use `kubectl edit` to modify the size of a Cassandra StatefulSet.
|
||||
Use `kubectl edit` to modify the size of a Cassandra StatefulSet.
|
||||
|
||||
1. Run the following command:
|
||||
|
||||
|
|
@ -182,14 +180,14 @@ Use `kubectl edit` to modify the size of a Cassandra StatefulSet.
|
|||
kubectl edit statefulset cassandra
|
||||
```
|
||||
|
||||
This command opens an editor in your terminal. The line you need to change is the `replicas` field. The following sample is an excerpt of the `StatefulSet` file:
|
||||
This command opens an editor in your terminal. The line you need to change is the `replicas` field. The following sample is an excerpt of the StatefulSet file:
|
||||
|
||||
```yaml
|
||||
# Please edit the object below. Lines beginning with a '#' will be ignored,
|
||||
# and an empty file will abort the edit. If an error occurs while saving this file will be
|
||||
# reopened with the relevant failures.
|
||||
#
|
||||
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
creationTimestamp: 2016-08-13T18:40:58Z
|
||||
|
|
@ -204,50 +202,66 @@ Use `kubectl edit` to modify the size of a Cassandra StatefulSet.
|
|||
replicas: 3
|
||||
```
|
||||
|
||||
1. Change the number of replicas to 4, and then save the manifest.
|
||||
1. Change the number of replicas to 4, and then save the manifest.
|
||||
|
||||
The `StatefulSet` now contains 4 Pods.
|
||||
The StatefulSet now scales to run with 4 Pods.
|
||||
|
||||
1. Get the Cassandra StatefulSet to verify:
|
||||
1. Get the Cassandra StatefulSet to verify your change:
|
||||
|
||||
```shell
|
||||
kubectl get statefulset cassandra
|
||||
```
|
||||
|
||||
The response should be
|
||||
The response should be similar to:
|
||||
|
||||
```
|
||||
NAME DESIRED CURRENT AGE
|
||||
cassandra 4 4 36m
|
||||
```
|
||||
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture cleanup %}}
|
||||
Deleting or scaling a StatefulSet down does not delete the volumes associated with the StatefulSet. This setting is for your safety because your data is more valuable than automatically purging all related StatefulSet resources.
|
||||
Deleting or scaling a StatefulSet down does not delete the volumes associated with the StatefulSet. This setting is for your safety because your data is more valuable than automatically purging all related StatefulSet resources.
|
||||
|
||||
{{< warning >}}
|
||||
Depending on the storage class and reclaim policy, deleting the *PersistentVolumeClaims* may cause the associated volumes to also be deleted. Never assume you’ll be able to access data if its volume claims are deleted.
|
||||
{{< /warning >}}
|
||||
|
||||
1. Run the following commands (chained together into a single command) to delete everything in the Cassandra `StatefulSet`:
|
||||
1. Run the following commands (chained together into a single command) to delete everything in the Cassandra StatefulSet:
|
||||
|
||||
```shell
|
||||
grace=$(kubectl get po cassandra-0 -o=jsonpath='{.spec.terminationGracePeriodSeconds}') \
|
||||
grace=$(kubectl get pod cassandra-0 -o=jsonpath='{.spec.terminationGracePeriodSeconds}') \
|
||||
&& kubectl delete statefulset -l app=cassandra \
|
||||
&& echo "Sleeping $grace" \
|
||||
&& echo "Sleeping ${grace} seconds" 1>&2 \
|
||||
&& sleep $grace \
|
||||
&& kubectl delete pvc -l app=cassandra
|
||||
&& kubectl delete persistentvolumeclaim -l app=cassandra
|
||||
```
|
||||
|
||||
1. Run the following command to delete the Cassandra Service.
|
||||
1. Run the following command to delete the Service you set up for Cassandra:
|
||||
|
||||
```shell
|
||||
kubectl delete service -l app=cassandra
|
||||
```
|
||||
|
||||
{{% /capture %}}
|
||||
## Cassandra container environment variables
|
||||
|
||||
The Pods in this tutorial use the [`gcr.io/google-samples/cassandra:v13`](https://github.com/kubernetes/examples/blob/master/cassandra/image/Dockerfile)
|
||||
image from Google's [container registry](https://cloud.google.com/container-registry/docs/).
|
||||
The Docker image above is based on [debian-base](https://github.com/kubernetes/kubernetes/tree/master/build/debian-base)
|
||||
and includes OpenJDK 8.
|
||||
|
||||
This image includes a standard Cassandra installation from the Apache Debian repo.
|
||||
By using environment variables you can change values that are inserted into `cassandra.yaml`.
|
||||
|
||||
| Environment variable | Default value |
|
||||
| ------------------------ |:---------------: |
|
||||
| `CASSANDRA_CLUSTER_NAME` | `'Test Cluster'` |
|
||||
| `CASSANDRA_NUM_TOKENS` | `32` |
|
||||
| `CASSANDRA_RPC_ADDRESS` | `0.0.0.0` |
|
||||
|
||||
|
||||
{{% /capture %}}
|
||||
{{% capture whatsnext %}}
|
||||
|
||||
* Learn how to [Scale a StatefulSet](/docs/tasks/run-application/scale-stateful-set/).
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
apiVersion: apiserver.k8s.io/v1beta1
|
||||
kind: EgressSelectorConfiguration
|
||||
egressSelections:
|
||||
# Since we want to control the egress traffic to the cluster, we use the
|
||||
# "cluster" as the name. Other supported values are "etcd", and "master".
|
||||
- name: cluster
|
||||
connection:
|
||||
# This controls the protocol between the API Server and the Konnectivity
|
||||
# server. Supported values are "GRPC" and "HTTPConnect". There is no
|
||||
# end user visible difference between the two modes. You need to set the
|
||||
# Konnectivity server to work in the same mode.
|
||||
proxyProtocol: GRPC
|
||||
transport:
|
||||
# This controls what transport the API Server uses to communicate with the
|
||||
# Konnectivity server. UDS is recommended if the Konnectivity server
|
||||
# locates on the same machine as the API Server. You need to configure the
|
||||
# Konnectivity server to listen on the same UDS socket.
|
||||
# The other supported transport is "tcp". You will need to set up TLS
|
||||
# config to secure the TCP transport.
|
||||
uds:
|
||||
udsName: /etc/srv/kubernetes/konnectivity-server/konnectivity-server.socket
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
apiVersion: apps/v1
|
||||
# Alternatively, you can deploy the agents as Deployments. It is not necessary
|
||||
# to have an agent on each node.
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
labels:
|
||||
addonmanager.kubernetes.io/mode: Reconcile
|
||||
k8s-app: konnectivity-agent
|
||||
namespace: kube-system
|
||||
name: konnectivity-agent
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
k8s-app: konnectivity-agent
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
k8s-app: konnectivity-agent
|
||||
spec:
|
||||
priorityClassName: system-cluster-critical
|
||||
tolerations:
|
||||
- key: "CriticalAddonsOnly"
|
||||
operator: "Exists"
|
||||
containers:
|
||||
- image: us.gcr.io/k8s-artifacts-prod/kas-network-proxy/proxy-agent:v0.0.8
|
||||
name: konnectivity-agent
|
||||
command: ["/proxy-agent"]
|
||||
args: [
|
||||
"--logtostderr=true",
|
||||
"--ca-cert=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt",
|
||||
# Since the konnectivity server runs with hostNetwork=true,
|
||||
# this is the IP address of the master machine.
|
||||
"--proxy-server-host=35.225.206.7",
|
||||
"--proxy-server-port=8132",
|
||||
"--service-account-token-path=/var/run/secrets/tokens/konnectivity-agent-token"
|
||||
]
|
||||
volumeMounts:
|
||||
- mountPath: /var/run/secrets/tokens
|
||||
name: konnectivity-agent-token
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
port: 8093
|
||||
path: /healthz
|
||||
initialDelaySeconds: 15
|
||||
timeoutSeconds: 15
|
||||
serviceAccountName: konnectivity-agent
|
||||
volumes:
|
||||
- name: konnectivity-agent-token
|
||||
projected:
|
||||
sources:
|
||||
- serviceAccountToken:
|
||||
path: konnectivity-agent-token
|
||||
audience: system:konnectivity-server
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: system:konnectivity-server
|
||||
labels:
|
||||
kubernetes.io/cluster-service: "true"
|
||||
addonmanager.kubernetes.io/mode: Reconcile
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: system:auth-delegator
|
||||
subjects:
|
||||
- apiGroup: rbac.authorization.k8s.io
|
||||
kind: User
|
||||
name: system:konnectivity-server
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: konnectivity-agent
|
||||
namespace: kube-system
|
||||
labels:
|
||||
kubernetes.io/cluster-service: "true"
|
||||
addonmanager.kubernetes.io/mode: Reconcile
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: konnectivity-server
|
||||
namespace: kube-system
|
||||
spec:
|
||||
priorityClassName: system-cluster-critical
|
||||
hostNetwork: true
|
||||
containers:
|
||||
- name: konnectivity-server-container
|
||||
image: us.gcr.io/k8s-artifacts-prod/kas-network-proxy/proxy-server:v0.0.8
|
||||
command: ["/proxy-server"]
|
||||
args: [
|
||||
"--log-file=/var/log/konnectivity-server.log",
|
||||
"--logtostderr=false",
|
||||
"--log-file-max-size=0",
|
||||
# This needs to be consistent with the value set in egressSelectorConfiguration.
|
||||
"--uds-name=/etc/srv/kubernetes/konnectivity-server/konnectivity-server.socket",
|
||||
# The following two lines assume the Konnectivity server is
|
||||
# deployed on the same machine as the apiserver, and the certs and
|
||||
# key of the API Server are at the specified location.
|
||||
"--cluster-cert=/etc/srv/kubernetes/pki/apiserver.crt",
|
||||
"--cluster-key=/etc/srv/kubernetes/pki/apiserver.key",
|
||||
# This needs to be consistent with the value set in egressSelectorConfiguration.
|
||||
"--mode=grpc",
|
||||
"--server-port=0",
|
||||
"--agent-port=8132",
|
||||
"--admin-port=8133",
|
||||
"--agent-namespace=kube-system",
|
||||
"--agent-service-account=konnectivity-agent",
|
||||
"--kubeconfig=/etc/srv/kubernetes/konnectivity-server/kubeconfig",
|
||||
"--authentication-audience=system:konnectivity-server"
|
||||
]
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
scheme: HTTP
|
||||
host: 127.0.0.1
|
||||
port: 8133
|
||||
path: /healthz
|
||||
initialDelaySeconds: 30
|
||||
timeoutSeconds: 60
|
||||
ports:
|
||||
- name: agentport
|
||||
containerPort: 8132
|
||||
hostPort: 8132
|
||||
- name: adminport
|
||||
containerPort: 8133
|
||||
hostPort: 8133
|
||||
volumeMounts:
|
||||
- name: varlogkonnectivityserver
|
||||
mountPath: /var/log/konnectivity-server.log
|
||||
readOnly: false
|
||||
- name: pki
|
||||
mountPath: /etc/srv/kubernetes/pki
|
||||
readOnly: true
|
||||
- name: konnectivity-uds
|
||||
mountPath: /etc/srv/kubernetes/konnectivity-server
|
||||
readOnly: false
|
||||
volumes:
|
||||
- name: varlogkonnectivityserver
|
||||
hostPath:
|
||||
path: /var/log/konnectivity-server.log
|
||||
type: FileOrCreate
|
||||
- name: pki
|
||||
hostPath:
|
||||
path: /etc/srv/kubernetes/pki
|
||||
- name: konnectivity-uds
|
||||
hostPath:
|
||||
path: /etc/srv/kubernetes/konnectivity-server
|
||||
type: DirectoryOrCreate
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: fluentd-elasticsearch
|
||||
namespace: kube-system
|
||||
labels:
|
||||
k8s-app: fluentd-logging
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
name: fluentd-elasticsearch
|
||||
updateStrategy:
|
||||
type: RollingUpdate
|
||||
rollingUpdate:
|
||||
maxUnavailable: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
name: fluentd-elasticsearch
|
||||
spec:
|
||||
tolerations:
|
||||
# this toleration is to have the daemonset runnable on master nodes
|
||||
# remove it if your masters can't run pods
|
||||
- key: node-role.kubernetes.io/master
|
||||
effect: NoSchedule
|
||||
containers:
|
||||
- name: fluentd-elasticsearch
|
||||
image: quay.io/fluentd_elasticsearch/fluentd:v2.5.2
|
||||
resources:
|
||||
limits:
|
||||
memory: 200Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 200Mi
|
||||
volumeMounts:
|
||||
- name: varlog
|
||||
mountPath: /var/log
|
||||
- name: varlibdockercontainers
|
||||
mountPath: /var/lib/docker/containers
|
||||
readOnly: true
|
||||
terminationGracePeriodSeconds: 30
|
||||
volumes:
|
||||
- name: varlog
|
||||
hostPath:
|
||||
path: /var/log
|
||||
- name: varlibdockercontainers
|
||||
hostPath:
|
||||
path: /var/lib/docker/containers
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: fluentd-elasticsearch
|
||||
namespace: kube-system
|
||||
labels:
|
||||
k8s-app: fluentd-logging
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
name: fluentd-elasticsearch
|
||||
updateStrategy:
|
||||
type: RollingUpdate
|
||||
rollingUpdate:
|
||||
maxUnavailable: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
name: fluentd-elasticsearch
|
||||
spec:
|
||||
tolerations:
|
||||
# this toleration is to have the daemonset runnable on master nodes
|
||||
# remove it if your masters can't run pods
|
||||
- key: node-role.kubernetes.io/master
|
||||
effect: NoSchedule
|
||||
containers:
|
||||
- name: fluentd-elasticsearch
|
||||
image: quay.io/fluentd_elasticsearch/fluentd:v2.5.2
|
||||
volumeMounts:
|
||||
- name: varlog
|
||||
mountPath: /var/log
|
||||
- name: varlibdockercontainers
|
||||
mountPath: /var/lib/docker/containers
|
||||
readOnly: true
|
||||
terminationGracePeriodSeconds: 30
|
||||
volumes:
|
||||
- name: varlog
|
||||
hostPath:
|
||||
path: /var/log
|
||||
- name: varlibdockercontainers
|
||||
hostPath:
|
||||
path: /var/lib/docker/containers
|
||||
|
|
@ -0,0 +1,122 @@
|
|||
---
|
||||
reviewers:
|
||||
title: EndpointSlices
|
||||
feature:
|
||||
title: EndpointSlices
|
||||
description: >
|
||||
Suivi évolutif des réseaux Endpoints dans un cluster Kubernetes.
|
||||
|
||||
content_template: templates/concept
|
||||
weight: 10
|
||||
---
|
||||
|
||||
|
||||
{{% capture overview %}}
|
||||
|
||||
{{< feature-state for_k8s_version="v1.17" state="beta" >}}
|
||||
|
||||
_EndpointSlices_ offrent une méthode simple pour suivre les Endpoints d'un réseau au sein d'un cluster de Kubernetes. Ils offrent une alternative plus évolutive et extensible aux Endpoints.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture body %}}
|
||||
|
||||
## Resource pour EndpointSlice {#endpointslice-resource}
|
||||
|
||||
Dans Kubernetes, un EndpointSlice contient des reférences à un ensemble de Endpoints.
|
||||
Le controleur d'EndpointSlice crée automatiquement des EndpointSlices pour un Service quand un {{< glossary_tooltip text="sélecteur" term_id="selector" >}} est spécifié.
|
||||
Ces EnpointSlices vont inclure des références à n'importe quels Pods qui correspond aux selecteur de Service.
|
||||
EndpointSlices groupent ensemble les Endpoints d'un réseau par combinaisons uniques de Services et de Ports.
|
||||
|
||||
Par exemple, voici un échantillon d'une resource EndpointSlice pour le Kubernetes Service `exemple`.
|
||||
|
||||
```yaml
|
||||
apiVersion: discovery.k8s.io/v1beta1
|
||||
kind: EndpointSlice
|
||||
metadata:
|
||||
name: exemple-abc
|
||||
labels:
|
||||
kubernetes.io/service-name: exemple
|
||||
addressType: IPv4
|
||||
ports:
|
||||
- name: http
|
||||
protocol: TCP
|
||||
port: 80
|
||||
endpoints:
|
||||
- addresses:
|
||||
- "10.1.2.3"
|
||||
conditions:
|
||||
ready: true
|
||||
hostname: pod-1
|
||||
topology:
|
||||
kubernetes.io/hostname: node-1
|
||||
topology.kubernetes.io/zone: us-west2-a
|
||||
```
|
||||
|
||||
Les EndpointSlices géré par le contrôleur d'EndpointSlice n'auront, par défaut, pas plus de 100 Endpoints chacun.
|
||||
En dessous de cette échelle, EndpointSlices devrait mapper 1:1 les Endpoints et les Service et devrait avoir une performance similaire.
|
||||
|
||||
EndpointSlices peuvent agir en tant que source de vérité pour kube-proxy quand il s'agit du routage d'un trafic interne.
|
||||
Lorsqu'ils sont activés, ils devraient offrir une amélioration de performance pour les services qui ont une grand quantité d'Endpoints.
|
||||
|
||||
### Types d'addresses
|
||||
|
||||
Les EndpointSlices supportent 3 types d'addresses:
|
||||
|
||||
* IPv4
|
||||
* IPv6
|
||||
* FQDN (Fully Qualified Domain Name) - [serveur entièrement nommé]
|
||||
|
||||
### Topologie
|
||||
|
||||
Chaque Endpoint dans un EnpointSlice peut contenir des informations de topologie pertinentes.
|
||||
Ceci est utilisé pour indiqué où se trouve un Endpoint, qui contient les informations sur le Node, zone et region correspondante. Lorsque les valeurs sont disponibles, les labels de Topologies suivantes seront définies par le contrôleur EndpointSlice:
|
||||
|
||||
* `kubernetes.io/hostname` - Nom du Node sur lequel l'Endpoint se situe.
|
||||
* `topology.kubernetes.io/zone` - Zone dans laquelle l'Endpoint se situe.
|
||||
* `topology.kubernetes.io/region` - Region dans laquelle l'Endpoint se situe.
|
||||
|
||||
Le contrôleur EndpointSlice surveille les Services et les Pods pour assurer que leurs correspondances avec les EndpointSlices sont à jour.
|
||||
Le contrôleur gère les EndpointSlices pour tous les Services qui ont un sélecteur - [référence: {{< glossary_tooltip text="sélecteur" term_id="selector" >}}] - specifié. Celles-ci représenteront les IPs des Pods qui correspond au sélecteur.
|
||||
|
||||
### Capacité d'EndpointSlices
|
||||
|
||||
Les EndpointSlices sont limités a une capacité de 100 Endpoints chacun, par défaut. Vous pouvez configurer ceci avec l'indicateur `--max-endpoints-per-slice` {{< glossary_tooltip text="kube-controller-manager" term_id="kube-controller-manager" >}} jusqu'à un maximum de 1000.
|
||||
|
||||
### Distribution d'EndpointSlices
|
||||
|
||||
Chaque EndpointSlice a un ensemble de ports qui s'applique à tous les Endpoints dans la resource.
|
||||
Lorsque les ports nommés sont utilisés pour un Service, les Pods peuvent se retrouver avec différents port cible pour le même port nommé, nécessitant différents EndpointSlices.
|
||||
|
||||
Le contrôleur essaie de remplir l'EndpointSlice aussi complètement que possible, mais ne les rééquilibre pas activement. La logique du contrôleur est assez simple:
|
||||
|
||||
1. Itérer à travers les EnpointSlices existants, retirer les Endpoints qui ne sont plus voulus et mettre à jour les Endpoints qui ont changés.
|
||||
2. Itérer à travers les EndpointSlices qui ont été modifiés dans la première étape et les remplir avec n'importe quel Endpoint nécéssaire.
|
||||
3. S'il reste encore des Endpoints neufs à ajouter, essayez de les mettre dans une slice qui n'a pas été changé et/ou en crée de nouveaux.
|
||||
|
||||
Par-dessus tout, la troisième étape priorise la limitation de mises à jour d'EnpointSlice sur une distribution complètement pleine d'EndpointSlices. Par exemple, si il y avait 10 nouveaux Endpoints à ajouter et 2 EndpointSlices qui peuvent contenir 5 Endpoints en plus chacun; cette approche créera un nouveau EndpointSlice au lieu de remplir les EndpointSlice existants.
|
||||
C'est à dire, une seule création EndpointSlice est préférable à plusieurs mises à jour d'EndpointSlice.
|
||||
|
||||
Avec kube-proxy exécuté sur chaque Node et surveillant EndpointSlices, chaque changement d'un EndpointSlice devient relativement coûteux puisqu'ils seront transmis à chaque Node du cluster.
|
||||
Cette approche vise à limiter le nombre de modifications qui doivent être envoyées à chaque Node, même si ça peut causer plusieurs EndpointSlices non remplis.
|
||||
|
||||
En pratique, cette distribution bien peu idéale devrait être rare. La plupart des changements traités par le contrôleur EndpointSlice sera suffisamment petite pour tenir dans un EndpointSlice existant, et sinon, un nouveau EndpointSlice aura probablement été bientôt nécessaire de toute façon. Les mises à jour continues des déploiements fournissent également une compaction naturelle des EndpointSlices avec tous leurs pods et les Endpoints correspondants qui se feront remplacer.
|
||||
|
||||
## Motivation
|
||||
|
||||
L'API des Endpoints fournit une méthode simple et facile à suivre pour les Endpoints dans Kubernetes.
|
||||
Malheureusement, comme les clusters Kubernetes et Services sont devenus plus larges, les limitations de cette API sont devenues plus visibles.
|
||||
Plus particulièrement, ceux-ci comprenaient des limitations liés au dimensionnement vers un plus grand nombre d'Endpoint d'un réseau.
|
||||
|
||||
Puisque tous les Endpoints d'un réseau pour un Service ont été stockés dans une seule ressource Endpoints, ces ressources pourraient devenir assez lourdes.
|
||||
Cela a affecté les performances des composants Kubernetes (notamment le plan de contrôle) et a causé une grande quantité de trafic réseau et de traitements lorsque les Endpoints changent.
|
||||
Les EndpointSlices aident à atténuer ces problèmes ainsi qu'à fournir une plate-forme extensible pour des fonctionnalités supplémentaires telles que le routage topologique.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture whatsnext %}}
|
||||
|
||||
* [Activer EndpointSlices](/docs/tasks/administer-cluster/enabling-endpointslices)
|
||||
* Lire [Connecter des applications aux Services](/docs/concepts/services-networking/connect-applications-service/)
|
||||
|
||||
{{% /capture %}}
|
||||
|
|
@ -17,11 +17,11 @@ kamu belajar lebih dalam bagaimana cara kerja Kubernetes.
|
|||
|
||||
## Ikhtisar
|
||||
|
||||
Untuk menggunakan Kubernetes, kamu menggunakan obyek-obyek *Kubernetes API* untuk merepresentasikan
|
||||
Untuk menggunakan Kubernetes, kamu menggunakan objek-objek *Kubernetes API* untuk merepresentasikan
|
||||
*state* yang diinginkan: apa yang aplikasi atau *workload* lain yang ingin kamu
|
||||
jalankan, *image* kontainer yang digunakan, jaringan atau *resource disk* apa yang ingin
|
||||
kamu sediakan, dan lain sebagainya. Kamu membuat *state* yang diinginkan dengan cara membuat
|
||||
obyek dengan menggunakan API Kubernetes, dan biasanya menggunakan `command-line interface`, yaitu `kubectl`.
|
||||
objek dengan menggunakan API Kubernetes, dan biasanya menggunakan `command-line interface`, yaitu `kubectl`.
|
||||
Kamu juga dapat secara langsung berinteraksi dengan klaster untuk membuat atau mengubah
|
||||
*state* yang kamu inginkan.
|
||||
|
||||
|
|
@ -38,16 +38,16 @@ suatu aplikasi, dan lain sebagainya. *Control Plane* Kubernetes terdiri dari sek
|
|||
* **[kubelet](/docs/admin/kubelet/)**, yang menjadi perantara komunikasi dengan *master*.
|
||||
* **[kube-proxy](/docs/admin/kube-proxy/)**, sebuah *proxy* yang merupakan representasi jaringan yang ada pada setiap *node*.
|
||||
|
||||
## Obyek Kubernetes
|
||||
## Objek Kubernetes
|
||||
|
||||
Kubernetes memiliki beberapa abstraksi yang merepresentasikan *state* dari sistem kamu:
|
||||
apa yang aplikasi atau *workload* lain yang ingin kamu jalankan, jaringan atau *resource disk* apa yang ingin
|
||||
kamu sediakan, serta beberapa informasi lain terkait apa yang sedang klaster kamu lakukan.
|
||||
Abstraksi ini direpresentasikan oleh obyek yang tersedia di API Kubernetes;
|
||||
lihat [ikhtisar obyek-obyek Kubernetes](/docs/concepts/abstractions/overview/)
|
||||
Abstraksi ini direpresentasikan oleh objek yang tersedia di API Kubernetes;
|
||||
lihat [ikhtisar objek-objek Kubernetes](/docs/concepts/abstractions/overview/)
|
||||
untuk penjelasan yang lebih mendetail.
|
||||
|
||||
Obyek mendasar Kubernetes termasuk:
|
||||
Objek mendasar Kubernetes termasuk:
|
||||
|
||||
* [Pod](/docs/concepts/workloads/pods/pod-overview/)
|
||||
* [Service](/docs/concepts/services-networking/service/)
|
||||
|
|
@ -55,7 +55,7 @@ Obyek mendasar Kubernetes termasuk:
|
|||
* [Namespace](/docs/concepts/overview/working-with-objects/namespaces/)
|
||||
|
||||
Sebagai tambahan, Kubernetes memiliki beberapa abstraksi yang lebih tinggi yang disebut kontroler.
|
||||
Kontroler merupakan obyek mendasar dengan fungsi tambahan, contoh dari kontroler ini adalah:
|
||||
Kontroler merupakan objek mendasar dengan fungsi tambahan, contoh dari kontroler ini adalah:
|
||||
|
||||
* [ReplicaSet](/docs/concepts/workloads/controllers/replicaset/)
|
||||
* [Deployment](/docs/concepts/workloads/controllers/deployment/)
|
||||
|
|
@ -67,14 +67,14 @@ Kontroler merupakan obyek mendasar dengan fungsi tambahan, contoh dari kontroler
|
|||
|
||||
Berbagai bagian *Control Plane* Kubernetes, seperti *master* dan *process-process* kubelet,
|
||||
mengatur bagaimana Kubernetes berkomunikasi dengan klaster kamu. *Control Plane*
|
||||
menjaga seluruh *record* dari obyek Kubernetes serta terus menjalankan
|
||||
iterasi untuk melakukan manajemen *state* obyek. *Control Plane* akan memberikan respon
|
||||
menjaga seluruh *record* dari objek Kubernetes serta terus menjalankan
|
||||
iterasi untuk melakukan manajemen *state* objek. *Control Plane* akan memberikan respon
|
||||
apabila terdapat perubahan pada klaster kamu dan mengubah *state* saat ini agar sesuai
|
||||
dengan *state* yang diinginkan.
|
||||
|
||||
Contohnya, ketika kamu menggunakan API Kubernetes untuk membuat sebuah *Deployment*,
|
||||
kamu memberikan sebuah *state* baru yang harus dipenuhi oleh sistem. *Control Plane*
|
||||
kemudian akan mencatat obyek apa saja yang dibuat, serta menjalankan instruksi yang kamu berikan
|
||||
kemudian akan mencatat objek apa saja yang dibuat, serta menjalankan instruksi yang kamu berikan
|
||||
dengan cara melakukan `start` aplikasi dan melakukan `scheduling` aplikasi tersebut
|
||||
pada *node*, dengan kata lain mengubah *state* saat ini agar sesuai dengan *state* yang diinginkan.
|
||||
|
||||
|
|
@ -92,7 +92,7 @@ kamu berkomunikasi dengan *master* klaster Kubernetes kamu.
|
|||
menjalankan aplikasi kamu. Master mengontrol setiap node; kamu akan jarang berinteraksi
|
||||
dengan *node* secara langsung.
|
||||
|
||||
#### Metadata obyek
|
||||
#### Metadata objek
|
||||
|
||||
|
||||
* [Anotasi](/docs/concepts/overview/working-with-objects/annotations/)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,178 @@
|
|||
---
|
||||
title: Controller
|
||||
content_template: templates/concept
|
||||
weight: 30
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
|
||||
Dalam bidang robotika dan otomatisasi, _control loop_ atau kontrol tertutup adalah
|
||||
lingkaran tertutup yang mengatur keadaan suatu sistem.
|
||||
|
||||
Berikut adalah salah satu contoh kontrol tertutup: termostat di sebuah ruangan.
|
||||
|
||||
Ketika kamu mengatur suhunya, itu mengisyaratkan ke termostat
|
||||
tentang *keadaan yang kamu inginkan*. Sedangkan suhu kamar yang sebenarnya
|
||||
adalah *keadaan saat ini*. Termostat berfungsi untuk membawa keadaan saat ini
|
||||
mendekati ke keadaan yang diinginkan, dengan menghidupkan atau mematikan
|
||||
perangkat.
|
||||
|
||||
Di Kubernetes, _controller_ adalah kontrol tertutup yang mengawasi keadaan klaster
|
||||
{{< glossary_tooltip term_id="cluster" text="klaster" >}} kamu, lalu membuat atau meminta
|
||||
perubahan jika diperlukan. Setiap _controller_ mencoba untuk memindahkan status
|
||||
klaster saat ini mendekati keadaan yang diinginkan.
|
||||
|
||||
{{< glossary_definition term_id="controller" length="short">}}
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
||||
{{% capture body %}}
|
||||
|
||||
## Pola _controller_
|
||||
|
||||
Sebuah _controller_ melacak sekurang-kurangnya satu jenis sumber daya dari
|
||||
Kubernetes.
|
||||
[objek-objek](/docs/concepts/overview/working-with-objects/kubernetes-objects/) ini
|
||||
memiliki *spec field* yang merepresentasikan keadaan yang diinginkan. Satu atau
|
||||
lebih _controller_ untuk *resource* tersebut bertanggung jawab untuk membuat
|
||||
keadaan sekarang mendekati keadaan yang diinginkan.
|
||||
|
||||
_Controller_ mungkin saja melakukan tindakan itu sendiri; namun secara umum, di
|
||||
Kubernetes, _controller_ akan mengirim pesan ke
|
||||
{{< glossary_tooltip text="API server" term_id="kube-apiserver" >}} yang
|
||||
mempunyai efek samping yang bermanfaat. Kamu bisa melihat contoh-contoh
|
||||
di bawah ini.
|
||||
|
||||
{{< comment >}}
|
||||
Beberapa _controller_ bawaan, seperti _controller namespace_, bekerja pada objek
|
||||
yang tidak memiliki *spec*. Agar lebih sederhana, halaman ini tidak
|
||||
menjelaskannya secara detail.
|
||||
{{< /comment >}}
|
||||
|
||||
### Kontrol melalui server API
|
||||
|
||||
_Controller_ {{< glossary_tooltip term_id="job" >}} adalah contoh dari _controller_
|
||||
bawaan dari Kubernetes. _Controller_ bawaan tersebut mengelola status melalui
|
||||
interaksi dengan server API dari suatu klaster.
|
||||
|
||||
Job adalah sumber daya dalam Kubernetes yang menjalankan a
|
||||
{{< glossary_tooltip term_id="pod" >}}, atau mungkin beberapa Pod sekaligus,
|
||||
untuk melakukan sebuah pekerjaan dan kemudian berhenti.
|
||||
|
||||
(Setelah [dijadwalkan](../../../../en/docs/concepts/scheduling/), objek Pod
|
||||
akan menjadi bagian dari keadaan yang diinginkan oleh kubelet).
|
||||
|
||||
Ketika _controller job_ melihat tugas baru, maka _controller_ itu memastikan bahwa,
|
||||
di suatu tempat pada klaster kamu, kubelet dalam sekumpulan Node menjalankan
|
||||
Pod-Pod dengan jumlah yang benar untuk menyelesaikan pekerjaan. _Controller job_
|
||||
tidak menjalankan sejumlah Pod atau kontainer apa pun untuk dirinya sendiri.
|
||||
Namun, _controller job_ mengisyaratkan kepada server API untuk membuat atau
|
||||
menghapus Pod. Komponen-komponen lain dalam
|
||||
{{< glossary_tooltip text="control plane" term_id="control-plane" >}}
|
||||
bekerja berdasarkan informasi baru (adakah Pod-Pod baru untuk menjadwalkan dan
|
||||
menjalankan pekerjan), dan pada akhirnya pekerjaan itu selesai.
|
||||
|
||||
Setelah kamu membuat Job baru, status yang diharapkan adalah bagaimana
|
||||
pekerjaan itu bisa selesai. _Controller job_ membuat status pekerjaan saat ini
|
||||
agar mendekati dengan keadaan yang kamu inginkan: membuat Pod yang melakukan
|
||||
pekerjaan yang kamu inginkan untuk Job tersebut, sehingga Job hampir
|
||||
terselesaikan.
|
||||
|
||||
_Controller_ juga memperbarui objek yang mengkonfigurasinya. Misalnya: setelah
|
||||
pekerjaan dilakukan untuk Job tersebut, _controller job_ memperbarui objek Job
|
||||
dengan menandainya `Finished`.
|
||||
|
||||
(Ini hampir sama dengan bagaimana beberapa termostat mematikan lampu untuk
|
||||
mengindikasikan bahwa kamar kamu sekarang sudah berada pada suhu yang kamu
|
||||
inginkan).
|
||||
|
||||
### Kontrol Langsung
|
||||
|
||||
Berbeda dengan sebuah Job, beberapa dari _controller_ perlu melakukan perubahan
|
||||
sesuatu di luar dari klaster kamu.
|
||||
|
||||
Sebagai contoh, jika kamu menggunakan kontrol tertutup untuk memastikan apakah
|
||||
cukup {{< glossary_tooltip text="Node" term_id="node" >}}
|
||||
dalam kluster kamu, maka _controller_ memerlukan sesuatu di luar klaster saat ini
|
||||
untuk mengatur Node-Node baru apabila dibutuhkan.
|
||||
|
||||
_controller_ yang berinteraksi dengan keadaan eksternal dapat menemukan keadaan
|
||||
yang diinginkannya melalui server API, dan kemudian berkomunikasi langsung
|
||||
dengan sistem eksternal untuk membawa keadaan saat ini mendekat keadaan yang
|
||||
diinginkan.
|
||||
|
||||
(Sebenarnya ada sebuah _controller_ yang melakukan penskalaan node secara
|
||||
horizontal dalam klaster kamu. Silahkan lihat
|
||||
[_autoscaling_ klaster](/docs/tasks/administer-cluster/cluster-management/#cluster-autoscaling)).
|
||||
|
||||
## Status sekarang berbanding status yang diinginkan {#sekarang-banding-diinginkan}
|
||||
|
||||
Kubernetes mengambil pandangan sistem secara _cloud-native_, dan mampu menangani
|
||||
perubahan yang konstan.
|
||||
|
||||
Klaster kamu dapat mengalami perubahan kapan saja pada saat pekerjaan sedang
|
||||
berlangsung dan kontrol tertutup secara otomatis memperbaiki setiap kegagalan.
|
||||
Hal ini berarti bahwa, secara potensi, klaster kamu tidak akan pernah mencapai
|
||||
kondisi stabil.
|
||||
|
||||
Selama _controller_ dari klaster kamu berjalan dan mampu membuat perubahan yang
|
||||
bermanfaat, tidak masalah apabila keadaan keseluruhan stabil atau tidak.
|
||||
|
||||
## Perancangan
|
||||
|
||||
Sebagai prinsip dasar perancangan, Kubernetes menggunakan banyak _controller_ yang
|
||||
masing-masing mengelola aspek tertentu dari keadaan klaster. Yang paling umum,
|
||||
kontrol tertutup tertentu menggunakan salah satu jenis sumber daya
|
||||
sebagai suatu keadaan yang diinginkan, dan memiliki jenis sumber daya yang
|
||||
berbeda untuk dikelola dalam rangka membuat keadaan yang diinginkan terjadi.
|
||||
|
||||
Sangat penting untuk memiliki beberapa _controller_ sederhana daripada hanya satu
|
||||
_controller_ saja, dimana satu kumpulan monolitik kontrol tertutup saling
|
||||
berkaitan satu sama lain. Karena _controller_ bisa saja gagal, sehingga Kubernetes
|
||||
dirancang untuk memungkinkan hal tersebut.
|
||||
|
||||
Misalnya: _controller_ pekerjaan melacak objek pekerjaan (untuk menemukan
|
||||
adanya pekerjaan baru) dan objek Pod (untuk menjalankan pekerjaan tersebut dan
|
||||
kemudian melihat lagi ketika pekerjaan itu sudah selesai). Dalam hal ini yang
|
||||
lain membuat pekerjaan, sedangkan _controller_ pekerjaan membuat Pod-Pod.
|
||||
|
||||
{{< note >}}
|
||||
Ada kemungkinan beberapa _controller_ membuat atau memperbarui jenis objek yang
|
||||
sama. Namun di belakang layar, _controller_ Kubernetes memastikan bahwa mereka
|
||||
hanya memperhatikan sumbr daya yang terkait dengan sumber daya yang mereka
|
||||
kendalikan.
|
||||
|
||||
Misalnya, kamu dapat memiliki Deployment dan Job; dimana keduanya akan membuat
|
||||
Pod. _Controller Job_ tidak akan menghapus Pod yang dibuat oleh Deployment kamu,
|
||||
karena ada informasi ({{< glossary_tooltip term_id="label" text="labels" >}})
|
||||
yang dapat oleh _controller_ untuk membedakan Pod-Pod tersebut.
|
||||
{{< /note >}}
|
||||
|
||||
## Berbagai cara menjalankan beberapa _controller_ {#menjalankan-_controller_}
|
||||
|
||||
Kubernetes hadir dengan seperangkat _controller_ bawaan yang berjalan di dalam
|
||||
{{< glossary_tooltip term_id="kube-controller-manager" >}}. Beberapa _controller_
|
||||
bawaan memberikan perilaku inti yang sangat penting.
|
||||
|
||||
_Controller Deployment_ dan _controller Job_ adalah contoh dari _controller_ yang
|
||||
hadir sebagai bagian dari Kubernetes itu sendiri (_controller_ "bawaan").
|
||||
Kubernetes memungkinkan kamu menjalankan _control plane_ yang tangguh, sehingga
|
||||
jika ada _controller_ bawaan yang gagal, maka bagian lain dari _control plane_ akan
|
||||
mengambil alih pekerjaan.
|
||||
|
||||
Kamu juga dapat menemukan pengontrol yang berjalan di luar _control plane_, untuk
|
||||
mengembangkan lebih jauh Kubernetes. Atau, jika mau, kamu bisa membuat
|
||||
_controller_ baru sendiri. Kamu dapat menjalankan _controller_ kamu sendiri sebagai
|
||||
satu kumpulan dari beberapa Pod, atau bisa juga sebagai bagian eksternal dari
|
||||
Kubernetes. Manakah yang paling sesuai akan tergantung pada apa yang _controller_
|
||||
khusus itu lakukan.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture whatsnext %}}
|
||||
* Silahkan baca tentang [_control plane_ Kubernetes](/docs/concepts/#kubernetes-control-plane)
|
||||
* Temukan beberapa dasar tentang [objek-objek Kubernetes](/docs/concepts/#kubernetes-objects)
|
||||
* Pelajari lebih lanjut tentang [Kubernetes API](/docs/concepts/overview/kubernetes-api/)
|
||||
* Apabila kamu ingin membuat _controller_ sendiri, silakan lihat [pola perluasan](/docs/concepts/extend-kubernetes/extend-cluster/#extension-patterns) dalam memperluas Kubernetes.
|
||||
{{% /capture %}}
|
||||
|
|
@ -255,7 +255,7 @@ Servis _frontend_ akan meliputi kedua set replika dengan menentukan subset bersa
|
|||
tier: frontend
|
||||
```
|
||||
|
||||
Anda dapat mengatur jumlah replika rilis _stable_ dan _canary_ untuk menentukan rasio dari tiap rilis yang akan menerima _traffic production live_ (dalam kasus ini 3:1).
|
||||
Kamu dapat mengatur jumlah replika rilis _stable_ dan _canary_ untuk menentukan rasio dari tiap rilis yang akan menerima _traffic production live_ (dalam kasus ini 3:1).
|
||||
Ketika telah yakin, kamu dapat memindahkan _track stable_ ke rilis baru dan menghapus _canary_.
|
||||
|
||||
Untuk contoh yang lebih jelas, silahkan cek [tutorial melakukan deploy Ghost](https://github.com/kelseyhightower/talks/tree/master/kubecon-eu-2016/demo#deploy-a-canary).
|
||||
|
|
@ -322,7 +322,7 @@ kubectl scale deployment/my-nginx --replicas=1
|
|||
deployment.extensions/my-nginx scaled
|
||||
```
|
||||
|
||||
Sekarang anda hanya memiliki satu _pod_ yang dikelola oleh deployment.
|
||||
Sekarang kamu hanya memiliki satu _pod_ yang dikelola oleh deployment.
|
||||
|
||||
```shell
|
||||
kubectl get pods -l app=nginx
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
title: Variabel Environment Kontainer
|
||||
title: Kontainer Environment
|
||||
content_template: templates/concept
|
||||
weight: 20
|
||||
---
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
---
|
||||
title: Ikhtisar Kontainer
|
||||
content_template: templates/concept
|
||||
weight: 1
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
|
||||
Kontainer adalah teknologi untuk mengemas kode (yang telah dikompilasi) menjadi
|
||||
suatu aplikasi beserta dengan dependensi-dependensi yang dibutuhkannya pada saat
|
||||
dijalankan. Setiap kontainer yang Anda jalankan dapat diulang; standardisasi
|
||||
dengan menyertakan dependensinya berarti Anda akan mendapatkan perilaku yang
|
||||
sama di mana pun Anda menjalankannya.
|
||||
|
||||
Kontainer memisahkan aplikasi dari infrastruktur host yang ada dibawahnya. Hal
|
||||
ini membuat penyebaran lebih mudah di lingkungan cloud atau OS yang berbeda.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture body %}}
|
||||
|
||||
## Image-Image Kontainer
|
||||
|
||||
[Kontainer image](/docs/concepts/containers/images/) meruapakan paket perangkat lunak
|
||||
yang siap dijalankan, mengandung semua yang diperlukan untuk menjalankan
|
||||
sebuah aplikasi: kode dan setiap *runtime* yang dibutuhkan, *library* dari
|
||||
aplikasi dan sistem, dan nilai *default* untuk penganturan yang penting.
|
||||
|
||||
Secara desain, kontainer tidak bisa berubah: Anda tidak dapat mengubah kode
|
||||
dalam kontainer yang sedang berjalan. Jika Anda memiliki aplikasi yang
|
||||
terkontainerisasi dan ingin melakukan perubahan, maka Anda perlu membuat
|
||||
kontainer baru dengan menyertakan perubahannya, kemudian membuat ulang kontainer
|
||||
dengan memulai dari _image_ yang sudah diubah.
|
||||
|
||||
## Kontainer _runtime_
|
||||
|
||||
Kontainer *runtime* adalah perangkat lunak yang bertanggung jawab untuk
|
||||
menjalankan kontainer. Kubernetes mendukung beberapa kontainer *runtime*:
|
||||
{{< glossary_tooltip term_id="docker" >}},
|
||||
{{< glossary_tooltip term_id="containerd" >}},
|
||||
{{< glossary_tooltip term_id="cri-o" >}}, dan semua implementasi dari
|
||||
[Kubernetes CRI (Container Runtime Interface)](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-node/container-runtime-interface.md).
|
||||
|
||||
## Selanjutnya
|
||||
|
||||
- Baca tentang [image-image kontainer](https://kubernetes.io/docs/concepts/containers/images/)
|
||||
- Baca tentang [Pod](https://kubernetes.io/docs/concepts/workloads/pods/)
|
||||
|
||||
{{% /capture %}}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
---
|
||||
title: Controller
|
||||
id: controller
|
||||
date: 2018-04-12
|
||||
full_link: /docs/concepts/architecture/controller/
|
||||
short_description: >
|
||||
Kontrol tertutup yang mengawasi kondisi bersama dari klaster melalui apiserver dan membuat perubahan yang mencoba untuk membawa kondisi saat ini ke kondisi yang diinginkan.
|
||||
|
||||
aka:
|
||||
tags:
|
||||
- architecture
|
||||
- fundamental
|
||||
---
|
||||
Di Kubernetes, _controller_ adalah kontrol tertutup yang mengawasi kondisi
|
||||
{{< glossary_tooltip term_id="cluster" text="klaster">}} anda, lalu membuat atau
|
||||
meminta perubahan jika diperlukan.
|
||||
Setiap _controller_ mencoba untuk memindahkan status klaster saat ini lebih
|
||||
dekat ke kondisi yang diinginkan.
|
||||
|
||||
<!--more-->
|
||||
|
||||
_Controller_ mengawasi keadaan bersama dari klaster kamu melalui
|
||||
{{< glossary_tooltip text="apiserver" term_id="kube-apiserver" >}} (bagian dari
|
||||
{{< glossary_tooltip term_id="control-plane" >}}).
|
||||
|
||||
Beberapa _controller_ juga berjalan di dalam _control plane_, menyediakan
|
||||
kontrol tertutup yang merupakan inti dari operasi Kubernetes. Sebagai contoh:
|
||||
_controller Deployment_, _controller daemonset_, _controller namespace_, dan
|
||||
_controller volume persisten_ (dan lainnya) semua berjalan di dalam
|
||||
{{< glossary_tooltip term_id="kube-controller-manager" >}}.
|
||||
|
|
@ -4,7 +4,7 @@ title: Kubernetesドキュメント
|
|||
noedit: true
|
||||
cid: docsHome
|
||||
layout: docsportal_home
|
||||
class: gridPage
|
||||
class: gridPage gridPageHome
|
||||
linkTitle: "ホーム"
|
||||
main_menu: true
|
||||
weight: 10
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ kubelet은 `NodeStatus` 와 리스 오브젝트를 생성하고 업데이트 할
|
|||
보다 훨씬 길다).
|
||||
- kubelet은 10초마다 리스 오브젝트를 생성하고 업데이트 한다(기본 업데이트 주기).
|
||||
리스 업데이트는 `NodeStatus` 업데이트와는
|
||||
독립적으로 발생한다.
|
||||
독립적으로 발생한다. 리스 업데이트가 실패하면 kubelet에 의해 재시도하며 7초로 제한된 지수 백오프를 200 밀리초에서 부터 시작한다.
|
||||
|
||||
#### 안정성
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ weight: 10
|
|||
|
||||
* [인증서](/docs/concepts/cluster-administration/certificates/)는 다른 툴 체인을 이용하여 인증서를 생성하는 방법을 설명한다.
|
||||
|
||||
* [쿠버네티스 컨테이너 환경](/ko/docs/concepts/containers/container-environment-variables/)은 쿠버네티스 노드에서 Kubelet에 의해 관리되는 컨테이너 환경에 대해 설명한다.
|
||||
* [쿠버네티스 컨테이너 환경](/ko/docs/concepts/containers/container-environment/)은 쿠버네티스 노드에서 Kubelet에 의해 관리되는 컨테이너 환경에 대해 설명한다.
|
||||
|
||||
* [쿠버네티스 API에 대한 접근 제어](/docs/reference/access-authn-authz/controlling-access/)는 사용자와 서비스 계정에 어떻게 권한 설정을 하는지 설명한다.
|
||||
|
||||
|
|
|
|||
|
|
@ -315,7 +315,7 @@ spec:
|
|||
topologyKey: "kubernetes.io/hostname"
|
||||
containers:
|
||||
- name: web-app
|
||||
image: nginx:1.12-alpine
|
||||
image: nginx:1.16-alpine
|
||||
```
|
||||
|
||||
만약 위의 두 디플로이먼트를 생성하면 세 개의 노드가 있는 클러스터는 다음과 같아야 한다.
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ Events:
|
|||
|
||||
{{% capture whatsnext %}}
|
||||
|
||||
* [컨테이너 환경](/ko/docs/concepts/containers/container-environment-variables/)에 대해 더 배우기.
|
||||
* [컨테이너 환경](/ko/docs/concepts/containers/container-environment/)에 대해 더 배우기.
|
||||
* [컨테이너 라이프사이클 이벤트에 핸들러 부착](/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/)
|
||||
실습 경험하기.
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,43 @@
|
|||
---
|
||||
title: 컨테이너 개요
|
||||
content_template: templates/concept
|
||||
weight: 10
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
|
||||
컨테이너는 런타임에 필요한 종속성과 애플리케이션의
|
||||
컴파일 된 코드를 패키징 하는 기술이다. 실행되는 각각의
|
||||
컨테이너는 반복해서 사용 가능하다. 종속성이 포함된 표준화를
|
||||
통해 컨테이너가 실행되는 환경과 무관하게 항상 동일하게
|
||||
동작한다.
|
||||
|
||||
컨테이너는 기본 호스트 인프라 환경에서 애플리케이션의 실행환경을 분리한다.
|
||||
따라서 다양한 클라우드 환경이나 운영체제에서 쉽게 배포 할 수 있다.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
||||
{{% capture body %}}
|
||||
|
||||
## 컨테이너 이미지
|
||||
[컨테이너 이미지](/ko/docs/concepts/containers/images/) 는 즉시 실행할 수 있는
|
||||
소프트웨어 패키지이며, 애플리케이션을 실행하는데 필요한 모든 것
|
||||
(필요한 코드와 런타임, 애플리케이션 및 시스템 라이브러리 등의 모든 필수 설정에 대한 기본값)
|
||||
을 포함한다.
|
||||
|
||||
원칙적으로, 컨테이너는 변경되지 않는다. 이미 구동 중인 컨테이너의
|
||||
코드를 변경할 수 없다. 컨테이너화 된 애플리케이션이 있고 그
|
||||
애플리케이션을 변경하려는 경우, 변경사항을 포함하여 만든
|
||||
새로운 이미지를 통해 컨테이너를 다시 생성해야 한다.
|
||||
|
||||
|
||||
## 컨테이너 런타임
|
||||
|
||||
{{< glossary_definition term_id="container-runtime" length="all" >}}
|
||||
|
||||
{{% /capture %}}
|
||||
{{% capture whatsnext %}}
|
||||
* [컨테이너 이미지](/ko/docs/concepts/containers/images/)에 대해 읽어보기
|
||||
* [파드](/ko/docs/concepts/workloads/pods/)에 대해 읽어보기
|
||||
{{% /capture %}}
|
||||
|
|
@ -10,22 +10,14 @@ weight: 20
|
|||
|
||||
이 페이지는 런타임 클래스(RuntimeClass) 리소스와 런타임 선택 메커니즘에 대해서 설명한다.
|
||||
|
||||
{{< warning >}}
|
||||
런타임클래스는 v1.14 베타 업그레이드에서 *중대한* 변화를 포함한다.
|
||||
런타임클래스를 v1.14 이전부터 사용하고 있었다면,
|
||||
[런타임 클래스를 알파에서 베타로 업그레이드하기](#upgrading-runtimeclass-from-alpha-to-beta)를 확인한다.
|
||||
{{< /warning >}}
|
||||
런타임클래스는 컨테이너 런타임을 구성을 선택하는 기능이다. 컨테이너 런타임
|
||||
구성은 파드의 컨테이너를 실행하는데 사용된다.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
||||
{{% capture body %}}
|
||||
|
||||
## 런타임 클래스
|
||||
|
||||
런타임 클래스는 컨테이너 런타임 설정을 선택하는 기능이다.
|
||||
이 컨테이너 런타임 설정은 파드의 컨테이너를 실행할 때에 이용한다.
|
||||
|
||||
## 동기
|
||||
|
||||
서로 다른 파드간에 런타임 클래스를 설정하여
|
||||
|
|
@ -38,7 +30,7 @@ weight: 20
|
|||
또한 런타임 클래스를 사용하여 컨테이너 런타임이 같으나 설정이 다른
|
||||
여러 파드를 실행할 수 있다.
|
||||
|
||||
### 셋업
|
||||
## 셋업
|
||||
|
||||
RuntimeClass 특징 게이트가 활성화(기본값)를 확인한다.
|
||||
특징 게이트 활성화에 대한 설명은 [특징 게이트](/docs/reference/command-line-tools-reference/feature-gates/)를
|
||||
|
|
@ -47,7 +39,7 @@ RuntimeClass 특징 게이트가 활성화(기본값)를 확인한다.
|
|||
1. CRI 구현(implementation)을 노드에 설정(런타임에 따라서)
|
||||
2. 상응하는 런타임 클래스 리소스 생성
|
||||
|
||||
#### 1. CRI 구현을 노드에 설정
|
||||
### 1. CRI 구현을 노드에 설정
|
||||
|
||||
런타임 클래스를 통한 가능한 구성은 컨테이너 런타임 인터페이스(CRI) 구현에 의존적이다.
|
||||
사용자의 CRI 구현에 따른 설정 방법은
|
||||
|
|
@ -62,7 +54,7 @@ RuntimeClass 특징 게이트가 활성화(기본값)를 확인한다.
|
|||
해당 설정은 상응하는 `handler` 이름을 가지며, 이는 런타임 클래스에 의해서 참조된다.
|
||||
런타임 핸들러는 유효한 DNS 1123 서브도메인(알파-숫자 + `-`와 `.`문자)을 가져야 한다.
|
||||
|
||||
#### 2. 상응하는 런타임 클래스 리소스 생성
|
||||
### 2. 상응하는 런타임 클래스 리소스 생성
|
||||
|
||||
1단계에서 셋업 한 설정은 연관된 `handler` 이름을 가져야 하며, 이를 통해서 설정을 식별할 수 있다.
|
||||
각 런타임 핸들러(그리고 선택적으로 비어있는 `""` 핸들러)에 대해서, 상응하는 런타임 클래스 오브젝트를 생성한다.
|
||||
|
|
@ -88,7 +80,7 @@ handler: myconfiguration # 상응하는 CRI 설정의 이름임
|
|||
더 자세한 정보는 [권한 개요](/docs/reference/access-authn-authz/authorization/)를 참고한다.
|
||||
{{< /note >}}
|
||||
|
||||
### 사용
|
||||
## 사용
|
||||
|
||||
클러스터를 위해서 런타임 클래스를 설정하고 나면, 그것을 사용하는 것은 매우 간단하다. 파드 스펙에
|
||||
`runtimeClassName`를 명시한다. 예를 들면 다음과 같다.
|
||||
|
|
@ -147,13 +139,13 @@ https://github.com/containerd/cri/blob/master/docs/config.md
|
|||
|
||||
[100]: https://raw.githubusercontent.com/cri-o/cri-o/9f11d1d/docs/crio.conf.5.md
|
||||
|
||||
### 스케줄
|
||||
## 스케줄
|
||||
|
||||
{{< feature-state for_k8s_version="v1.16" state="beta" >}}
|
||||
|
||||
쿠버네티스 v1.16 부터, 런타임 클래스는 `scheduling` 필드를 통해 이종의 클러스터 지원을 포함한다.
|
||||
이 필드를 사용하면, 이 런타임 클래스를 갖는 파드가 이를 지원하는 노드로 스케줄된다는 것을 보장할 수 있다.
|
||||
이 스케줄링 기능을 사용하려면, 런타임 클래스 [어드미션(admission) 컨트롤러][]를 활성화(1.16 부터 기본 값)해야 한다.
|
||||
이 스케줄링 기능을 사용하려면, [런타임 클래스 어드미션(admission) 컨트롤러][]를 활성화(1.16 부터 기본 값)해야 한다.
|
||||
|
||||
파드가 지정된 런타임 클래스를 지원하는 노드에 안착한다는 것을 보장하려면,
|
||||
해당 노드들은 `runtimeClass.scheduling.nodeSelector` 필드에서 선택되는 공통 레이블을 가져야한다.
|
||||
|
|
@ -168,50 +160,24 @@ https://github.com/containerd/cri/blob/master/docs/config.md
|
|||
노드 셀렉터와 톨러레이션 설정에 대해 더 배우려면
|
||||
[노드에 파드 할당](/ko/docs/concepts/configuration/assign-pod-node/)을 참고한다.
|
||||
|
||||
[어드미션 컨트롤러]: /docs/reference/access-authn-authz/admission-controllers/
|
||||
[런타임 클래스 어드미션 컨트롤러]: /docs/reference/access-authn-authz/admission-controllers/#runtimeclass
|
||||
|
||||
### 파드 오버헤드
|
||||
|
||||
{{< feature-state for_k8s_version="v1.16" state="alpha" >}}
|
||||
{{< feature-state for_k8s_version="v1.18" state="beta" >}}
|
||||
|
||||
쿠버네티스 v1.16 부터는, 런타임 클래스에는 구동 중인 파드와 관련된 오버헤드를
|
||||
지정할 수 있는 기능이 [`PodOverhead`](/docs/concepts/configuration/pod-overhead) 기능을 통해 지원된다.
|
||||
`PodOverhead`를 사용하려면, PodOverhead [기능 게이트](/docs/reference/command-line-tools-reference/feature-gates/)를
|
||||
활성화 시켜야 한다. (기본 값으로는 비활성화 되어 있다.)
|
||||
파드 실행과 연관되는 _오버헤드_ 리소스를 지정할 수 있다. 오버헤드를 선언하면
|
||||
클러스터(스케줄러 포함)가 파드와 리소스에 대한 결정을 내릴 때 처리를 할 수 있다.
|
||||
PodOverhead를 사용하려면, PodOverhead [기능 게이트](/docs/reference/command-line-tools-reference/feature-gates/)
|
||||
를 활성화 시켜야 한다. (기본으로 활성화 되어 있다.)
|
||||
|
||||
|
||||
파드 오버헤드는 런타임 클래스에서 `Overhead` 필드를 통해 정의된다. 이 필드를 사용하면,
|
||||
파드 오버헤드는 런타임 클래스에서 `overhead` 필드를 통해 정의된다. 이 필드를 사용하면,
|
||||
해당 런타임 클래스를 사용해서 구동 중인 파드의 오버헤드를 특정할 수 있고 이 오버헤드가
|
||||
쿠버네티스 내에서 처리된다는 것을 보장할 수 있다.
|
||||
|
||||
### 런타임 클래스를 알파에서 베타로 업그레이드 {#upgrading-runtimeclass-from-alpha-to-beta}
|
||||
|
||||
런타임 클래스 베타 기능은 다음의 변화를 포함한다.
|
||||
|
||||
- `node.k8s.io` API 그룹과 `runtimeclasses.node.k8s.io` 리소스는 CustomResourceDefinition에서
|
||||
내장 API로 이전되었다.
|
||||
- 런타임 클래스 정의에서 `spec`을 직접 사용할 수 있다.
|
||||
(즉, 더 이상 RuntimeClassSpec는 없다).
|
||||
- `runtimeHandler` 필드는 `handler`로 이름이 바뀌었다.
|
||||
- `handler` 필드는 이제 모두 API 버전에서 요구된다. 이는 알파 API에서도 `runtimeHandler` 필드가
|
||||
필요하다는 의미이다.
|
||||
- `handler` 필드는 반드시 올바른 DNS 레이블([RFC 1123](https://tools.ietf.org/html/rfc1123))으로,
|
||||
이는 더 이상 `.` 캐릭터(모든 버전에서)를 포함할 수 없다 의미이다. 올바른 핸들러는
|
||||
다음의 정규 표현식을 따른다. `^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`.
|
||||
|
||||
**작업 필요** 다음 작업은 알파 버전의 런타임 기능을
|
||||
베타 버전으로 업그레이드하기 위해 진행되어야 한다.
|
||||
|
||||
- 런타임 클래스 리소스는 v1.14로 업그레이드 *후에* 반드시 재생성되어야 하고,
|
||||
`runtimeclasses.node.k8s.io` CRD는 다음과 같이 수동으로 지워야 한다.
|
||||
```
|
||||
kubectl delete customresourcedefinitions.apiextensions.k8s.io runtimeclasses.node.k8s.io
|
||||
```
|
||||
- 지정되지 않았거나 비어 있는 `runtimeHandler` 이거나 핸들러 내에 `.` 캐릭터를 사용한 알파 런타임 클래스는
|
||||
더 이상 올바르지 않으며, 반드시 올바른 핸들러 구성으로 이전헤야 한다
|
||||
(위를 참조).
|
||||
|
||||
### 더 읽기
|
||||
{{% /capture %}}
|
||||
{{% capture whatsnext %}}
|
||||
|
||||
- [런타임 클래스 설계](https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/runtime-class.md)
|
||||
- [런타임 클래스 스케줄링 설계](https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/runtime-class-scheduling.md)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,254 @@
|
|||
---
|
||||
title: 커스텀 리소스
|
||||
content_template: templates/concept
|
||||
weight: 10
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
|
||||
*커스텀 리소스* 는 쿠버네티스 API의 익스텐션이다. 이 페이지에서는 쿠버네티스 클러스터에
|
||||
커스텀 리소스를 추가할 시기와 독립형 서비스를 사용하는 시기에 대해 설명한다. 커스텀 리소스를
|
||||
추가하는 두 가지 방법과 이들 중에서 선택하는 방법에 대해 설명한다.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture body %}}
|
||||
## 커스텀 리소스
|
||||
|
||||
*리소스* 는 [쿠버네티스 API](/ko/docs/reference/using-api/api-overview/)에서 특정 종류의
|
||||
[API 오브젝트](/ko/docs/concepts/overview/working-with-objects/kubernetes-objects/) 모음을 저장하는 엔드포인트이다. 예를 들어 빌트인 *파드* 리소스에는 파드 오브젝트 모음이 포함되어 있다.
|
||||
|
||||
*커스텀 리소스* 는 쿠버네티스 API의 익스텐션으로, 기본 쿠버네티스 설치에서 반드시
|
||||
사용할 수 있는 것은 아니다. 이는 특정 쿠버네티스 설치에 수정이 가해졌음을 나타낸다. 그러나
|
||||
많은 핵심 쿠버네티스 기능은 이제 커스텀 리소스를 사용하여 구축되어, 쿠버네티스를 더욱 모듈화한다.
|
||||
|
||||
동적 등록을 통해 실행 중인 클러스터에서 커스텀 리소스가 나타나거나 사라질 수 있으며
|
||||
클러스터 관리자는 클러스터 자체와 독립적으로 커스텀 리소스를 업데이트 할 수 있다.
|
||||
커스텀 리소스가 설치되면 사용자는 *파드* 와 같은 빌트인 리소스와 마찬가지로
|
||||
[kubectl](/docs/user-guide/kubectl-overview/)을 사용하여 해당 오브젝트를 생성하고
|
||||
접근할 수 있다.
|
||||
|
||||
## 커스텀 컨트롤러
|
||||
|
||||
자체적으로 커스텀 리소스를 사용하면 구조화된 데이터를 저장하고 검색할 수 있다.
|
||||
커스텀 리소스를 *커스텀 컨트롤러* 와 결합하면, 커스텀 리소스가 진정한
|
||||
_선언적(declarative) API_ 를 제공하게 된다.
|
||||
|
||||
[선언적 API](/ko/docs/concepts/overview/kubernetes-api/)는 리소스의 의도한 상태를
|
||||
_선언_ 하거나 지정할 수 있게 해주며 쿠버네티스 오브젝트의 현재 상태를 의도한 상태와
|
||||
동기화 상태로 유지하려고 한다. 컨트롤러는 구조화된 데이터를 사용자가
|
||||
원하는 상태의 레코드로 해석하고 지속적으로
|
||||
이 상태를 유지한다.
|
||||
|
||||
클러스터 라이프사이클과 관계없이 실행 중인 클러스터에 커스텀 컨트롤러를 배포하고
|
||||
업데이트할 수 있다. 커스텀 컨트롤러는 모든 종류의 리소스와 함께 작동할 수 있지만
|
||||
커스텀 리소스와 결합할 때 특히 효과적이다.
|
||||
[오퍼레이터 패턴](https://coreos.com/blog/introducing-operators.html)은 사용자 정의
|
||||
리소스와 커스텀 컨트롤러를 결합한다. 커스텀 컨트롤러를 사용하여 특정 애플리케이션에 대한 도메인 지식을
|
||||
쿠버네티스 API의 익스텐션으로 인코딩할 수 있다.
|
||||
|
||||
## 쿠버네티스 클러스터에 커스텀 리소스를 추가해야 하나?
|
||||
|
||||
새로운 API를 생성할 때 [쿠버네티스 클러스터 API와 생성한 API를 애그리게이트](/ko/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation/)할 것인지 아니면 생성한 API를 독립적으로 유지할 것인지 고려하자.
|
||||
|
||||
| API 애그리게이트를 고려할 경우 | 독립 API를 고려할 경우 |
|
||||
| ---------------------------- | ---------------------------- |
|
||||
| API가 [선언적](#선언적-api)이다. | API가 [선언적](#선언적-api) 모델에 맞지 않다. |
|
||||
| `kubectl`을 사용하여 새로운 타입을 읽고 쓸 수 있기를 원한다.| `kubectl` 지원이 필요하지 않다. |
|
||||
| 쿠버네티스 UI(예: 대시보드)에서 빌트인 타입과 함께 새로운 타입을 보길 원한다. | 쿠버네티스 UI 지원이 필요하지 않다. |
|
||||
| 새로운 API를 개발 중이다. | 생성한 API를 제공하는 프로그램이 이미 있고 잘 작동하고 있다. |
|
||||
| API 그룹 및 네임스페이스와 같은 REST 리소스 경로에 적용하는 쿠버네티스의 형식 제한을 기꺼이 수용한다. ([API 개요](/ko/docs/concepts/overview/kubernetes-api/)를 참고한다.) | 이미 정의된 REST API와 호환되도록 특정 REST 경로가 있어야 한다. |
|
||||
| 자체 리소스는 자연스럽게 클러스터 또는 클러스터의 네임스페이스로 범위가 지정된다. | 클러스터 또는 네임스페이스 범위의 리소스는 적합하지 않다. 특정 리소스 경로를 제어해야 한다. |
|
||||
| [쿠버네티스 API 지원 기능](#일반적인-기능)을 재사용하려고 한다. | 이러한 기능이 필요하지 않다. |
|
||||
|
||||
### 선언적 API
|
||||
|
||||
선언적 API에서는 다음의 특성이 있다.
|
||||
|
||||
- API는 상대적으로 적은 수의 상대적으로 작은 오브젝트(리소스)로 구성된다.
|
||||
- 오브젝트는 애플리케이션 또는 인프라의 구성을 정의한다.
|
||||
- 오브젝트는 비교적 드물게 업데이트 된다.
|
||||
- 사람이 종종 오브젝트를 읽고 쓸 필요가 있다.
|
||||
- 오브젝트의 주요 작업은 CRUD-y(생성, 읽기, 업데이트 및 삭제)이다.
|
||||
- 오브젝트 간 트랜잭션은 필요하지 않다. API는 정확한(exact) 상태가 아니라 의도한 상태를 나타낸다.
|
||||
|
||||
명령형 API는 선언적이지 않다.
|
||||
자신의 API가 선언적이지 않을 수 있다는 징후는 다음과 같다.
|
||||
|
||||
- 클라이언트는 "이 작업을 수행한다"라고 말하고 완료되면 동기(synchronous) 응답을 받는다.
|
||||
- 클라이언트는 "이 작업을 수행한다"라고 말한 다음 작업 ID를 다시 가져오고 별도의 오퍼레이션(operation) 오브젝트를 확인하여 요청의 완료 여부를 결정해야 한다.
|
||||
- RPC(원격 프로시저 호출)에 대해 얘기한다.
|
||||
- 대량의 데이터를 직접 저장한다(예: > 오브젝트별 몇 kB 또는 >1000개의 오브젝트).
|
||||
- 높은 대역폭 접근(초당 10개의 지속적인 요청)이 필요하다.
|
||||
- 최종 사용자 데이터(예: 이미지, PII 등) 또는 애플리케이션에서 처리한 기타 대규모 데이터를 저장한다.
|
||||
- 오브젝트에 대한 자연스러운 조작은 CRUD-y가 아니다.
|
||||
- API는 오브젝트로 쉽게 모델링되지 않는다.
|
||||
- 작업 ID 또는 작업 오브젝트로 보류 중인 작업을 나타내도록 선택했다.
|
||||
|
||||
## 컨피그맵을 사용해야 하나, 커스텀 리소스를 사용해야 하나?
|
||||
|
||||
다음 중 하나에 해당하면 컨피그맵을 사용하자.
|
||||
|
||||
* `mysql.cnf` 또는 `pom.xml`과 같이 잘 문서화된 기존 구성 파일 형식이 있다.
|
||||
* 전체 구성 파일을 컨피그맵의 하나의 키에 넣고 싶다.
|
||||
* 구성 파일의 주요 용도는 클러스터의 파드에서 실행 중인 프로그램이 파일을 사용하여 자체 구성하는 것이다.
|
||||
* 파일 사용자는 쿠버네티스 API가 아닌 파드의 환경 변수 또는 파드의 파일을 통해 사용하는 것을 선호한다.
|
||||
* 파일이 업데이트될 때 디플로이먼트 등을 통해 롤링 업데이트를 수행하려고 한다.
|
||||
|
||||
{{< note >}}
|
||||
민감한 데이터에는 [시크릿](/docs/concepts/configuration/secret/)을 사용하자. 이는 컨피그맵과 비슷하지만 더 안전한다.
|
||||
{{< /note >}}
|
||||
|
||||
다음 중 대부분이 적용되는 경우 커스텀 리소스(CRD 또는 애그리게이트 API(aggregated API))를 사용하자.
|
||||
|
||||
* 쿠버네티스 클라이언트 라이브러리 및 CLI를 사용하여 새 리소스를 만들고 업데이트하려고 한다.
|
||||
* kubectl의 최상위 지원을 원한다(예: `kubectl get my-object object-name`).
|
||||
* 새 오브젝트에 대한 업데이트를 감시한 다음 다른 오브젝트를 CRUD하거나 그 반대로 하는 새로운 자동화를 구축하려고 한다.
|
||||
* 오브젝트의 업데이트를 처리하는 자동화를 작성하려고 한다.
|
||||
* `.spec`, `.status` 및 `.metadata`와 같은 쿠버네티스 API 규칙을 사용하려고 한다.
|
||||
* 제어된 리소스의 콜렉션 또는 다른 리소스의 요약에 대한 오브젝트가 되기를 원한다.
|
||||
|
||||
## 커스텀 리소스 추가
|
||||
|
||||
쿠버네티스는 클러스터에 커스텀 리소스를 추가하는 두 가지 방법을 제공한다.
|
||||
|
||||
- CRD는 간단하며 프로그래밍 없이 만들 수 있다.
|
||||
- [API 애그리게이션](/ko/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation/)에는 프로그래밍이 필요하지만, 데이터 저장 방법 및 API 버전 간 변환과 같은 API 동작을 보다 강력하게 제어할 수 있다.
|
||||
|
||||
쿠버네티스는 다양한 사용자의 요구를 충족시키기 위해 이 두 가지 옵션을 제공하므로 사용의 용이성이나 유연성이 저하되지 않는다.
|
||||
|
||||
애그리게이트 API는 기본 API 서버 뒤에 있는 하위 API 서버이며 프록시 역할을 한다. 이 배치를 [API 애그리게이션](/ko/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation/)(AA)이라고 한다. 사용자에게는 쿠버네티스 API가 확장된 것과 같다.
|
||||
|
||||
CRD를 사용하면 다른 API 서버를 추가하지 않고도 새로운 타입의 리소스를 생성할 수 있다. CRD를 사용하기 위해 API 애그리게이션을 이해할 필요는 없다.
|
||||
|
||||
설치 방법에 관계없이 새 리소스는 커스텀 리소스라고 하며 빌트인 쿠버네티스 리소스(파드 등)와 구별된다.
|
||||
|
||||
## 커스텀리소스데피니션
|
||||
|
||||
[커스텀리소스데피니션](/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/)
|
||||
API 리소스를 사용하면 커스텀 리소스를 정의할 수 있다.
|
||||
CRD 오브젝트를 정의하면 지정한 이름과 스키마를 사용하여 새 커스텀 리소스가 만들어진다.
|
||||
쿠버네티스 API는 커스텀 리소스의 스토리지를 제공하고 처리한다.
|
||||
CRD 오브젝트의 이름은 유효한
|
||||
[DNS 서브도메인 이름](/ko/docs/concepts/overview/working-with-objects/names#dns-서브도메인-이름)이어야 한다.
|
||||
|
||||
따라서 커스텀 리소스를 처리하기 위해 자신의 API 서버를 작성할 수 없지만
|
||||
구현의 일반적인 특성으로 인해
|
||||
[API 서버 애그리게이션](#api-서버-애그리게이션)보다 유연성이 떨어진다.
|
||||
|
||||
새 커스텀 리소스를 등록하고 새 리소스 타입의 인스턴스에 대해 작업하고
|
||||
컨트롤러를 사용하여 이벤트를 처리하는 방법에 대한 예제는
|
||||
[커스텀 컨트롤러 예제](https://github.com/kubernetes/sample-controller)를 참고한다.
|
||||
|
||||
## API 서버 애그리게이션
|
||||
|
||||
일반적으로 쿠버네티스 API의 각 리소스에는 REST 요청을 처리하고 오브젝트의 퍼시스턴트 스토리지를 관리하는 코드가 필요하다. 주요 쿠버네티스 API 서버는 *파드* 및 *서비스* 와 같은 빌트인 리소스를 처리하고, 일반적으로 [CRD](#커스텀리소스데피니션)를 통해 커스텀 리소스를 처리할 수 있다.
|
||||
|
||||
[애그리게이션 레이어](/ko/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation/)를 사용하면 자체 독립형 API 서버를
|
||||
작성하고 배포하여 커스텀 리소스에 대한 특수한 구현을 제공할 수 있다.
|
||||
기본 API 서버는 처리하는 커스텀 리소스에 대한 요청을 사용자에게 위임하여
|
||||
모든 클라이언트가 사용할 수 있게 한다.
|
||||
|
||||
## 커스텀 리소스를 추가할 방법 선택
|
||||
|
||||
CRD는 사용하기가 더 쉽다. 애그리게이트 API가 더 유연하다. 자신의 요구에 가장 잘 맞는 방법을 선택하자.
|
||||
|
||||
일반적으로 CRD는 다음과 같은 경우에 적합하다.
|
||||
|
||||
* 필드가 몇 개 되지 않는다
|
||||
* 회사 내에서 또는 소규모 오픈소스 프로젝트의 일부인(상용 제품이 아닌) 리소스를 사용하고 있다.
|
||||
|
||||
### 사용 편의성 비교
|
||||
|
||||
CRD는 애그리게이트 API보다 생성하기가 쉽다.
|
||||
|
||||
| CRD | 애그리게이트 API |
|
||||
| --------------------------- | -------------- |
|
||||
| 프로그래밍이 필요하지 않다. 사용자는 CRD 컨트롤러에 대한 모든 언어를 선택할 수 있다. | Go로 프로그래밍하고 바이너리와 이미지를 빌드해야 한다. |
|
||||
| 실행할 추가 서비스가 없다. CR은 API 서버에서 처리한다. | 추가 서비스를 생성하면 실패할 수 있다. |
|
||||
| CRD가 생성된 후에는 지속적인 지원이 없다. 모든 버그 픽스는 일반적인 쿠버네티스 마스터 업그레이드의 일부로 선택된다. | 업스트림에서 버그 픽스를 주기적으로 선택하고 애그리게이트 API 서버를 다시 빌드하고 업데이트해야 할 수 있다. |
|
||||
| 여러 버전의 API를 처리할 필요가 없다. 예를 들어, 이 리소스에 대한 클라이언트를 제어할 때 API와 동기화하여 업그레이드할 수 있다. | 인터넷에 공유할 익스텐션을 개발할 때와 같이 여러 버전의 API를 처리해야 한다. |
|
||||
|
||||
### 고급 기능 및 유연성
|
||||
|
||||
애그리게이트 API는 보다 고급 API 기능과 스토리지 레이어와 같은 다른 기능의 사용자 정의를 제공한다.
|
||||
|
||||
| 기능 | 설명 | CRD | 애그리게이트 API |
|
||||
| ------- | ----------- | ---- | -------------- |
|
||||
| 유효성 검사 | 사용자가 오류를 방지하고 클라이언트와 독립적으로 API를 발전시킬 수 있도록 도와준다. 이러한 기능은 동시에 많은 클라이언트를 모두 업데이트할 수 없는 경우에 아주 유용하다. | 예. [OpenAPI v3.0 유효성 검사](/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions/#validation)를 사용하여 CRD에서 대부분의 유효성 검사를 지정할 수 있다. [웹훅 유효성 검사](/docs/reference/access-authn-authz/admission-controllers/#validatingadmissionwebhook-alpha-in-1-8-beta-in-1-9)를 추가해서 다른 모든 유효성 검사를 지원한다. | 예, 임의의 유효성 검사를 지원한다. |
|
||||
| 기본 설정 | 위를 참고하자. | 예, [OpenAPI v3.0 유효성 검사](/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions/#defaulting)의 `default` 키워드(1.17에서 GA) 또는 [웹훅 변형(mutating)](/docs/reference/access-authn-authz/admission-controllers/#mutatingadmissionwebhook)(이전 오브젝트의 etcd에서 읽을 때는 실행되지 않음)을 통해 지원한다. | 예 |
|
||||
| 다중 버전 관리 | 두 가지 API 버전을 통해 동일한 오브젝트를 제공할 수 있다. 필드 이름 바꾸기와 같은 API 변경을 쉽게 할 수 있다. 클라이언트 버전을 제어하는 경우는 덜 중요하다. | [예](/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definition-versioning) | 예 |
|
||||
| 사용자 정의 스토리지 | 다른 성능 모드(예를 들어, 키-값 저장소 대신 시계열 데이터베이스)나 보안에 대한 격리(예를 들어, 암호화된 시크릿이나 다른 암호화) 기능을 가진 스토리지가 필요한 경우 | 아니오 | 예 |
|
||||
| 사용자 정의 비즈니스 로직 | 오브젝트를 생성, 읽기, 업데이트 또는 삭제를 할 때 임의의 점검 또는 조치를 수행한다. | 예, [웹훅](/docs/reference/access-authn-authz/extensible-admission-controllers/#admission-webhooks)을 사용한다. | 예 |
|
||||
| 서브리소스 크기 조정 | HorizontalPodAutoscaler 및 PodDisruptionBudget과 같은 시스템이 새로운 리소스와 상호 작용할 수 있다. | [예](/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions/#scale-subresource) | 예 |
|
||||
| 서브리소스 상태 | 사용자가 스펙 섹션을 작성하고 컨트롤러가 상태 섹션을 작성하는 세분화된 접근 제어를 허용한다. 커스텀 리소스 데이터 변형 시 오브젝트 생성을 증가시킨다(리소스에서 별도의 스펙과 상태 섹션 필요). | [예](/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions/#status-subresource) | 예 |
|
||||
| 기타 서브리소스 | "logs" 또는 "exec"과 같은 CRUD 이외의 작업을 추가한다. | 아니오 | 예 |
|
||||
| strategic-merge-patch | 새로운 엔드포인트는 `Content-Type: application/strategic-merge-patch+json` 형식의 PATCH를 지원한다. 로컬 및 서버 양쪽에서 수정할 수도 있는 오브젝트를 업데이트하는 데 유용하다. 자세한 내용은 ["kubectl 패치를 사용한 API 오브젝트 업데이트"](/docs/tasks/run-application/update-api-object-kubectl-patch/)를 참고한다. | 아니오 | 예 |
|
||||
| 프로토콜 버퍼 | 새로운 리소스는 프로토콜 버퍼를 사용하려는 클라이언트를 지원한다. | 아니오 | 예 |
|
||||
| OpenAPI 스키마 | 서버에서 동적으로 가져올 수 있는 타입에 대한 OpenAPI(스웨거(swagger)) 스키마가 있는가? 허용된 필드만 설정하여 맞춤법이 틀린 필드 이름으로부터 사용자를 보호하는가? 타입이 적용되는가(즉, `string` 필드에 `int`를 넣지 않는가?) | 예, [OpenAPI v3.0 유효성 검사](/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions/#validation)를 기반으로 하는 스키마(1.16에서 GA) | 예 |
|
||||
|
||||
### 일반적인 기능
|
||||
|
||||
CRD 또는 AA를 통해 커스텀 리소스를 생성하면 쿠버네티스 플랫폼 외부에서 구현하는 것과 비교하여 API에 대한 많은 기능이 제공된다.
|
||||
|
||||
| 기능 | 설명 |
|
||||
| ------- | ------------ |
|
||||
| CRUD | 새로운 엔드포인트는 HTTP 및 `kubectl`을 통해 CRUD 기본 작업을 지원한다. |
|
||||
| 감시 | 새로운 엔드포인트는 HTTP를 통해 쿠버네티스 감시 작업을 지원한다. |
|
||||
| 디스커버리 | kubectl 및 대시보드와 같은 클라이언트는 리소스에 대해 목록, 표시 및 필드 수정 작업을 자동으로 제공한다. |
|
||||
| json-patch | 새로운 엔드포인트는 `Content-Type: application/json-patch+json` 형식의 PATCH를 지원한다. |
|
||||
| merge-patch | 새로운 엔드포인트는 `Content-Type: application/merge-patch+json` 형식의 PATCH를 지원한다. |
|
||||
| HTTPS | 새로운 엔드포인트는 HTTPS를 사용한다. |
|
||||
| 빌트인 인증 | 익스텐션에 대한 접근은 인증을 위해 기본 API 서버(애그리게이션 레이어)를 사용한다. |
|
||||
| 빌트인 권한 부여 | 익스텐션에 접근하면 기본 API 서버(예: RBAC)에서 사용하는 권한을 재사용할 수 있다. |
|
||||
| Finalizer | 외부 정리가 발생할 때까지 익스텐션 리소스의 삭제를 차단한다. |
|
||||
| 어드미션 웹훅 | 생성/업데이트/삭제 작업 중에 기본값을 설정하고 익스텐션 리소스의 유효성 검사를 한다. |
|
||||
| UI/CLI 디스플레이 | Kubectl, 대시보드는 익스텐션 리소스를 표시할 수 있다. |
|
||||
| 설정하지 않음(unset)과 비어있음(empty) | 클라이언트는 값이 없는 필드 중에서 설정되지 않은 필드를 구별할 수 있다. |
|
||||
| 클라이언트 라이브러리 생성 | 쿠버네티스는 일반 클라이언트 라이브러리와 타입별 클라이언트 라이브러리를 생성하는 도구를 제공한다. |
|
||||
| 레이블 및 어노테이션 | 공통 메타데이터는 핵심 및 커스텀 리소스를 수정하는 방법을 알고 있는 도구이다. |
|
||||
|
||||
## 커스텀 리소스 설치 준비
|
||||
|
||||
클러스터에 커스텀 리소스를 추가하기 전에 알아야 할 몇 가지 사항이 있다.
|
||||
|
||||
### 써드파티 코드 및 새로운 장애 포인트
|
||||
|
||||
CRD를 생성해도 새로운 장애 포인트(예를 들어, API 서버에서 장애를 유발하는 써드파티 코드가 실행됨)가 자동으로 추가되지는 않지만, 패키지(예: 차트(Charts)) 또는 기타 설치 번들에는 CRD 및 새로운 커스텀 리소스에 대한 비즈니스 로직을 구현하는 써드파티 코드의 디플로이먼트가 포함되는 경우가 종종 있다.
|
||||
|
||||
애그리게이트 API 서버를 설치하려면 항상 새 디플로이먼트를 실행해야 한다.
|
||||
|
||||
### 스토리지
|
||||
|
||||
커스텀 리소스는 컨피그맵과 동일한 방식으로 스토리지 공간을 사용한다. 너무 많은 커스텀 리소스를 생성하면 API 서버의 스토리지 공간이 과부하될 수 있다.
|
||||
|
||||
애그리게이트 API 서버는 기본 API 서버와 동일한 스토리지를 사용할 수 있으며 이 경우 동일한 경고가 적용된다.
|
||||
|
||||
### 인증, 권한 부여 및 감사
|
||||
|
||||
CRD는 항상 API 서버의 빌트인 리소스와 동일한 인증, 권한 부여 및 감사 로깅을 사용한다.
|
||||
|
||||
권한 부여에 RBAC를 사용하는 경우 대부분의 RBAC 역할은 새로운 리소스에 대한 접근 권한을 부여하지 않는다(클러스터 관리자 역할 또는 와일드 카드 규칙으로 생성된 역할 제외). 새로운 리소스에 대한 접근 권한을 명시적으로 부여해야 한다. CRD 및 애그리게이트 API는 종종 추가하는 타입에 대한 새로운 역할 정의와 함께 제공된다.
|
||||
|
||||
애그리게이트 API 서버는 기본 API 서버와 동일한 인증, 권한 부여 및 감사를 사용하거나 사용하지 않을 수 있다.
|
||||
|
||||
## 커스텀 리소스에 접근
|
||||
|
||||
쿠버네티스 [클라이언트 라이브러리](/docs/reference/using-api/client-libraries/)를 사용하여 커스텀 리소스에 접근할 수 있다. 모든 클라이언트 라이브러리가 커스텀 리소스를 지원하는 것은 아니다. Go와 python 클라이언트 라이브러리가 지원한다.
|
||||
|
||||
커스텀 리소스를 추가하면 다음을 사용하여 접근할 수 있다.
|
||||
|
||||
- kubectl
|
||||
- 쿠버네티스 동적 클라이언트
|
||||
- 작성한 REST 클라이언트
|
||||
- [쿠버네티스 클라이언트 생성 도구](https://github.com/kubernetes/code-generator)를 사용하여 생성된 클라이언트(하나를 생성하는 것은 고급 기능이지만, 일부 프로젝트는 CRD 또는 AA와 함께 클라이언트를 제공할 수 있다).
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture whatsnext %}}
|
||||
|
||||
* [애그리게이션 레이어(aggregation layer)로 쿠버네티스 API 확장](/ko/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation/)하는 방법에 대해 배우기.
|
||||
|
||||
* [커스텀리소스데피니션으로 쿠버네티스 API 확장](/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/)하는 방법에 대해 배우기.
|
||||
|
||||
{{% /capture %}}
|
||||
|
|
@ -0,0 +1,205 @@
|
|||
---
|
||||
title: 쿠버네티스 클러스터 확장
|
||||
content_template: templates/concept
|
||||
weight: 10
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
|
||||
쿠버네티스는 매우 유연하게 구성할 수 있고 확장 가능하다. 결과적으로
|
||||
쿠버네티스 프로젝트를 포크하거나 코드에 패치를 제출할 필요가
|
||||
거의 없다.
|
||||
|
||||
이 가이드는 쿠버네티스 클러스터를 사용자 정의하기 위한 옵션을 설명한다.
|
||||
쿠버네티스 클러스터를 업무 환경의 요구에 맞게
|
||||
조정하는 방법을 이해하려는 {{< glossary_tooltip text="클러스터 운영자" term_id="cluster-operator" >}}를 대상으로 한다.
|
||||
잠재적인 {{< glossary_tooltip text="플랫폼 개발자" term_id="platform-developer" >}} 또는 쿠버네티스 프로젝트 {{< glossary_tooltip text="컨트리뷰터" term_id="contributor" >}}인 개발자에게도
|
||||
어떤 익스텐션 포인트와 패턴이 있는지,
|
||||
그리고 그것들의 트레이드오프와 제약에 대한 소개 자료로 유용할 것이다.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
||||
{{% capture body %}}
|
||||
|
||||
## 개요
|
||||
|
||||
사용자 정의 방식은 크게 플래그, 로컬 구성 파일 또는 API 리소스 변경만 포함하는 *구성* 과 추가 프로그램이나 서비스 실행과 관련된 *익스텐션* 으로 나눌 수 있다. 이 문서는 주로 익스텐션에 관한 것이다.
|
||||
|
||||
## 구성
|
||||
|
||||
*구성 파일* 및 *플래그* 는 온라인 문서의 레퍼런스 섹션에 각 바이너리 별로 문서화되어 있다.
|
||||
|
||||
* [kubelet](/docs/admin/kubelet/)
|
||||
* [kube-apiserver](/docs/admin/kube-apiserver/)
|
||||
* [kube-controller-manager](/docs/admin/kube-controller-manager/)
|
||||
* [kube-scheduler](/docs/admin/kube-scheduler/).
|
||||
|
||||
호스팅된 쿠버네티스 서비스 또는 매니지드 설치 환경의 배포판에서 플래그 및 구성 파일을 항상 변경할 수 있는 것은 아니다. 변경 가능한 경우 일반적으로 클러스터 관리자만 변경할 수 있다. 또한 향후 쿠버네티스 버전에서 변경될 수 있으며, 이를 설정하려면 프로세스를 다시 시작해야 할 수도 있다. 이러한 이유로 다른 옵션이 없는 경우에만 사용해야 한다.
|
||||
|
||||
[리소스쿼터](/ko/docs/concepts/policy/resource-quotas/), [PodSecurityPolicy](/ko/docs/concepts/policy/pod-security-policy/), [네트워크폴리시](/ko/docs/concepts/services-networking/network-policies/) 및 역할 기반 접근 제어([RBAC](/docs/reference/access-authn-authz/rbac/))와 같은 *빌트인 정책 API(built-in Policy API)* 는 기본적으로 제공되는 쿠버네티스 API이다. API는 일반적으로 호스팅된 쿠버네티스 서비스 및 매니지드 쿠버네티스 설치 환경과 함께 사용된다. 그것들은 선언적이며 파드와 같은 다른 쿠버네티스 리소스와 동일한 규칙을 사용하므로, 새로운 클러스터 구성을 반복할 수 있고 애플리케이션과 동일한 방식으로 관리할 수 있다. 또한, 이들 API가 안정적인 경우, 다른 쿠버네티스 API와 같이 [정의된 지원 정책](/docs/reference/deprecation-policy/)을 사용할 수 있다. 이러한 이유로 인해 구성 파일과 플래그보다 선호된다.
|
||||
|
||||
## 익스텐션(Extension) {#익스텐션}
|
||||
|
||||
익스텐션은 쿠버네티스를 확장하고 쿠버네티스와 긴밀하게 통합되는 소프트웨어 컴포넌트이다.
|
||||
이들 컴포넌트는 쿠버네티스가 새로운 유형과 새로운 종류의 하드웨어를 지원할 수 있게 해준다.
|
||||
|
||||
대부분의 클러스터 관리자는 쿠버네티스의 호스팅 또는 배포판 인스턴스를 사용한다.
|
||||
결과적으로 대부분의 쿠버네티스 사용자는 익스텐션 기능을 설치할 필요가 있고
|
||||
새로운 익스텐션 기능을 작성할 필요가 있는 사람은 더 적다.
|
||||
|
||||
## 익스텐션 패턴
|
||||
|
||||
쿠버네티스는 클라이언트 프로그램을 작성하여 자동화 되도록 설계되었다.
|
||||
쿠버네티스 API를 읽고 쓰는 프로그램은 유용한 자동화를 제공할 수 있다.
|
||||
*자동화* 는 클러스터 상에서 또는 클러스터 밖에서 실행할 수 있다. 이 문서의 지침에 따라
|
||||
고가용성과 강력한 자동화를 작성할 수 있다.
|
||||
자동화는 일반적으로 호스트 클러스터 및 매니지드 설치 환경을 포함한 모든
|
||||
쿠버네티스 클러스터에서 작동한다.
|
||||
|
||||
쿠버네티스와 잘 작동하는 클라이언트 프로그램을 작성하기 위한 특정 패턴은 *컨트롤러* 패턴이라고 한다.
|
||||
컨트롤러는 일반적으로 오브젝트의 `.spec`을 읽고, 가능한 경우 수행한 다음
|
||||
오브젝트의 `.status`를 업데이트 한다.
|
||||
|
||||
컨트롤러는 쿠버네티스의 클라이언트이다. 쿠버네티스가 클라이언트이고
|
||||
원격 서비스를 호출할 때 이를 *웹훅(Webhook)* 이라고 한다. 원격 서비스를
|
||||
*웹훅 백엔드* 라고 한다. 컨트롤러와 마찬가지로 웹훅은 장애 지점을
|
||||
추가한다.
|
||||
|
||||
웹훅 모델에서 쿠버네티스는 원격 서비스에 네트워크 요청을 한다.
|
||||
*바이너리 플러그인* 모델에서 쿠버네티스는 바이너리(프로그램)를 실행한다.
|
||||
바이너리 플러그인은 kubelet(예:
|
||||
[Flex Volume 플러그인](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-storage/flexvolume.md)과
|
||||
[네트워크 플러그인](/docs/concepts/cluster-administration/network-plugins/))과
|
||||
kubectl에서
|
||||
사용한다.
|
||||
|
||||
아래는 익스텐션 포인트가 쿠버네티스 컨트롤 플레인과 상호 작용하는 방법을
|
||||
보여주는 다이어그램이다.
|
||||
|
||||
<img src="https://docs.google.com/drawings/d/e/2PACX-1vQBRWyXLVUlQPlp7BvxvV9S1mxyXSM6rAc_cbLANvKlu6kCCf-kGTporTMIeG5GZtUdxXz1xowN7RmL/pub?w=960&h=720">
|
||||
|
||||
<!-- image source drawing https://docs.google.com/drawings/d/1muJ7Oxuj_7Gtv7HV9-2zJbOnkQJnjxq-v1ym_kZfB-4/edit?ts=5a01e054 -->
|
||||
|
||||
|
||||
## 익스텐션 포인트
|
||||
|
||||
이 다이어그램은 쿠버네티스 시스템의 익스텐션 포인트를 보여준다.
|
||||
|
||||
<img src="https://docs.google.com/drawings/d/e/2PACX-1vSH5ZWUO2jH9f34YHenhnCd14baEb4vT-pzfxeFC7NzdNqRDgdz4DDAVqArtH4onOGqh0bhwMX0zGBb/pub?w=425&h=809">
|
||||
|
||||
<!-- image source diagrams: https://docs.google.com/drawings/d/1k2YdJgNTtNfW7_A8moIIkij-DmVgEhNrn3y2OODwqQQ/view -->
|
||||
|
||||
1. 사용자는 종종 `kubectl`을 사용하여 쿠버네티스 API와 상호 작용한다. [Kubectl 플러그인](/docs/tasks/extend-kubectl/kubectl-plugins/)은 kubectl 바이너리를 확장한다. 개별 사용자의 로컬 환경에만 영향을 미치므로 사이트 전체 정책을 적용할 수는 없다.
|
||||
2. apiserver는 모든 요청을 처리한다. apiserver의 여러 유형의 익스텐션 포인트는 요청을 인증하거나, 콘텐츠를 기반으로 요청을 차단하거나, 콘텐츠를 편집하고, 삭제 처리를 허용한다. 이 내용은 [API 접근 익스텐션](/ko/docs/concepts/extend-kubernetes/extend-cluster/#api-접근-익스텐션) 섹션에 설명되어 있다.
|
||||
3. apiserver는 다양한 종류의 *리소스* 를 제공한다. `pods`와 같은 *빌트인 리소스 종류* 는 쿠버네티스 프로젝트에 의해 정의되며 변경할 수 없다. 직접 정의한 리소스를 추가할 수도 있고, [커스텀 리소스](/ko/docs/concepts/extend-kubernetes/extend-cluster/#사용자-정의-유형) 섹션에 설명된대로 *커스텀 리소스* 라고 부르는 다른 프로젝트에서 정의한 리소스를 추가할 수도 있다. 커스텀 리소스는 종종 API 접근 익스텐션과 함께 사용된다.
|
||||
4. 쿠버네티스 스케줄러는 파드를 배치할 노드를 결정한다. 스케줄링을 확장하는 몇 가지 방법이 있다. 이들은 [스케줄러 익스텐션](/ko/docs/concepts/extend-kubernetes/extend-cluster/#스케줄러-익스텐션) 섹션에 설명되어 있다.
|
||||
5. 쿠버네티스의 많은 동작은 API-Server의 클라이언트인 컨트롤러(Controller)라는 프로그램으로 구현된다. 컨트롤러는 종종 커스텀 리소스와 함께 사용된다.
|
||||
6. kubelet은 서버에서 실행되며 파드가 클러스터 네트워크에서 자체 IP를 가진 가상 서버처럼 보이도록 한다. [네트워크 플러그인](/ko/docs/concepts/extend-kubernetes/extend-cluster/#네트워크-플러그인)을 사용하면 다양한 파드 네트워킹 구현이 가능하다.
|
||||
7. kubelet은 컨테이너의 볼륨을 마운트 및 마운트 해제한다. 새로운 유형의 스토리지는 [스토리지 플러그인](/ko/docs/concepts/extend-kubernetes/extend-cluster/#스토리지-플러그인)을 통해 지원될 수 있다.
|
||||
|
||||
어디서부터 시작해야 할지 모르겠다면, 이 플로우 차트가 도움이 될 수 있다. 일부 솔루션에는 여러 유형의 익스텐션이 포함될 수 있다.
|
||||
|
||||
|
||||
<img src="https://docs.google.com/drawings/d/e/2PACX-1vRWXNNIVWFDqzDY0CsKZJY3AR8sDeFDXItdc5awYxVH8s0OLherMlEPVUpxPIB1CSUu7GPk7B2fEnzM/pub?w=1440&h=1080">
|
||||
|
||||
<!-- image source drawing: https://docs.google.com/drawings/d/1sdviU6lDz4BpnzJNHfNpQrqI9F19QZ07KnhnxVrp2yg/edit -->
|
||||
|
||||
## API 익스텐션
|
||||
### 사용자 정의 유형
|
||||
|
||||
새 컨트롤러, 애플리케이션 구성 오브젝트 또는 기타 선언적 API를 정의하고 `kubectl`과 같은 쿠버네티스 도구를 사용하여 관리하려면 쿠버네티스에 커스텀 리소스를 추가하자.
|
||||
|
||||
애플리케이션, 사용자 또는 모니터링 데이터의 데이터 저장소로 커스텀 리소스를 사용하지 않는다.
|
||||
|
||||
커스텀 리소스에 대한 자세한 내용은 [커스텀 리소스 개념 가이드](/docs/concepts/api-extension/custom-resources/)를 참고하길 바란다.
|
||||
|
||||
|
||||
### 새로운 API와 자동화의 결합
|
||||
|
||||
사용자 정의 리소스 API와 컨트롤 루프의 조합을 [오퍼레이터(operator) 패턴](/docs/concepts/extend-kubernetes/operator/)이라고 한다. 오퍼레이터 패턴은 특정 애플리케이션, 일반적으로 스테이트풀(stateful) 애플리케이션을 관리하는 데 사용된다. 이러한 사용자 정의 API 및 컨트롤 루프를 사용하여 스토리지나 정책과 같은 다른 리소스를 제어할 수도 있다.
|
||||
|
||||
### 빌트인 리소스 변경
|
||||
|
||||
사용자 정의 리소스를 추가하여 쿠버네티스 API를 확장하면 추가된 리소스는 항상 새로운 API 그룹에 속한다. 기존 API 그룹을 바꾸거나 변경할 수 없다.
|
||||
API를 추가해도 기존 API(예: 파드)의 동작에 직접 영향을 미치지는 않지만 API 접근 익스텐션은 영향을 준다.
|
||||
|
||||
|
||||
### API 접근 익스텐션
|
||||
|
||||
요청이 쿠버네티스 API 서버에 도달하면 먼저 인증이 되고, 그런 다음 승인된 후 다양한 유형의 어드미션 컨트롤이 적용된다. 이 흐름에 대한 자세한 내용은 [쿠버네티스 API에 대한 접근 제어](/docs/reference/access-authn-authz/controlling-access/)를 참고하길 바란다.
|
||||
|
||||
이러한 각 단계는 익스텐션 포인트를 제공한다.
|
||||
|
||||
쿠버네티스에는 이를 지원하는 몇 가지 빌트인 인증 방법이 있다. 또한 인증 프록시 뒤에 있을 수 있으며 인증 헤더에서 원격 서비스로 토큰을 전송하여 확인할 수 있다(웹훅). 이러한 방법은 모두 [인증 설명서](/docs/reference/access-authn-authz/authentication/)에 설명되어 있다.
|
||||
|
||||
### 인증
|
||||
|
||||
[인증](/docs/reference/access-authn-authz/authentication/)은 모든 요청의 헤더 또는 인증서를 요청하는 클라이언트의 사용자 이름에 매핑한다.
|
||||
|
||||
쿠버네티스는 몇 가지 빌트인 인증 방법과 필요에 맞지 않는 경우 [인증 웹훅](/docs/reference/access-authn-authz/authentication/#webhook-token-authentication) 방법을 제공한다.
|
||||
|
||||
|
||||
### 승인
|
||||
|
||||
[승인](/docs/reference/access-authn-authz/webhook/)은 특정 사용자가 API 리소스에서 읽고, 쓰고, 다른 작업을 수행할 수 있는지를 결정한다. 전체 리소스 레벨에서 작동하며 임의의 오브젝트 필드를 기준으로 구별하지 않는다. 빌트인 인증 옵션이 사용자의 요구를 충족시키지 못하면 [인증 웹훅](/docs/reference/access-authn-authz/webhook/)을 통해 사용자가 제공한 코드를 호출하여 인증 결정을 내릴 수 있다.
|
||||
|
||||
|
||||
### 동적 어드미션 컨트롤
|
||||
|
||||
요청이 승인된 후, 쓰기 작업인 경우 [어드미션 컨트롤](/docs/reference/access-authn-authz/admission-controllers/) 단계도 수행된다. 빌트인 단계 외에도 몇 가지 익스텐션이 있다.
|
||||
|
||||
* [이미지 정책 웹훅](/docs/reference/access-authn-authz/admission-controllers/#imagepolicywebhook)은 컨테이너에서 실행할 수 있는 이미지를 제한한다.
|
||||
* 임의의 어드미션 컨트롤 결정을 내리기 위해 일반적인 [어드미션 웹훅](/docs/reference/access-authn-authz/extensible-admission-controllers/#admission-webhooks)을 사용할 수 있다. 어드미션 웹훅은 생성 또는 업데이트를 거부할 수 있다.
|
||||
|
||||
## 인프라스트럭처 익스텐션
|
||||
|
||||
|
||||
### 스토리지 플러그인
|
||||
|
||||
[Flex Volumes](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/flexvolume-deployment.md)을 사용하면
|
||||
Kubelet이 바이너리 플러그인을 호출하여 볼륨을 마운트하도록 함으로써
|
||||
빌트인 지원 없이 볼륨 유형을 마운트 할 수 있다.
|
||||
|
||||
|
||||
### 장치 플러그인
|
||||
|
||||
장치 플러그인은 노드가 [장치 플러그인](/docs/concepts/cluster-administration/device-plugins/)을
|
||||
통해 새로운 노드 리소스(CPU 및 메모리와 같은 빌트인 자원 외에)를
|
||||
발견할 수 있게 해준다.
|
||||
|
||||
|
||||
### 네트워크 플러그인
|
||||
|
||||
노드-레벨의 [네트워크 플러그인](/docs/admin/network-plugins/)을 통해 다양한 네트워킹 패브릭을 지원할 수 있다.
|
||||
|
||||
### 스케줄러 익스텐션
|
||||
|
||||
스케줄러는 파드를 감시하고 파드를 노드에 할당하는 특수한 유형의
|
||||
컨트롤러이다. 다른 쿠버네티스 컴포넌트를 계속 사용하면서
|
||||
기본 스케줄러를 완전히 교체하거나,
|
||||
[여러 스케줄러](/docs/tasks/administer-cluster/configure-multiple-schedulers/)를
|
||||
동시에 실행할 수 있다.
|
||||
|
||||
이것은 중요한 부분이며, 거의 모든 쿠버네티스 사용자는 스케줄러를 수정할
|
||||
필요가 없다는 것을 알게 된다.
|
||||
|
||||
스케줄러는 또한 웹훅 백엔드(스케줄러 익스텐션)가
|
||||
파드에 대해 선택된 노드를 필터링하고 우선 순위를 지정할 수 있도록 하는
|
||||
[웹훅](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/scheduling/scheduler_extender.md)을
|
||||
지원한다.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
||||
{{% capture whatsnext %}}
|
||||
|
||||
* [커스텀 리소스](/docs/concepts/api-extension/custom-resources/)에 대해 더 알아보기
|
||||
* [동적 어드미션 컨트롤](/docs/reference/access-authn-authz/extensible-admission-controllers/)에 대해 알아보기
|
||||
* 인프라스트럭처 익스텐션에 대해 더 알아보기
|
||||
* [네트워크 플러그인](/docs/concepts/cluster-administration/network-plugins/)
|
||||
* [장치 플러그인](/docs/concepts/cluster-administration/device-plugins/)
|
||||
* [kubectl 플러그인](/docs/tasks/extend-kubectl/kubectl-plugins/)에 대해 알아보기
|
||||
* [오퍼레이터 패턴](/docs/concepts/extend-kubernetes/operator/)에 대해 알아보기
|
||||
|
||||
{{% /capture %}}
|
||||
|
|
@ -0,0 +1,133 @@
|
|||
---
|
||||
title: 오퍼레이터(operator) 패턴
|
||||
content_template: templates/concept
|
||||
weight: 30
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
|
||||
오퍼레이터(Operator)는
|
||||
[사용자 정의 리소스](/docs/concepts/extend-kubernetes/api-extension/custom-resources/)를
|
||||
사용하여 애플리케이션 및 해당 컴포넌트를 관리하는 쿠버네티스의 소프트웨어 익스텐션이다. 오퍼레이터는
|
||||
쿠버네티스 원칙, 특히 [컨트롤 루프](/ko/docs/concepts/#쿠버네티스-컨트롤-플레인)를 따른다.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
||||
{{% capture body %}}
|
||||
|
||||
## 동기 부여
|
||||
|
||||
오퍼레이터 패턴은 서비스 또는 서비스 셋을 관리하는 운영자의
|
||||
주요 목표를 포착하는 것을 목표로 한다. 특정 애플리케이션 및
|
||||
서비스를 돌보는 운영자는 시스템의 작동 방식, 배포 방법 및 문제가 있는 경우
|
||||
대처 방법에 대해 깊이 알고 있다.
|
||||
|
||||
쿠버네티스에서 워크로드를 실행하는 사람들은 종종 반복 가능한 작업을 처리하기 위해
|
||||
자동화를 사용하는 것을 좋아한다. 오퍼레이터 패턴은 쿠버네티스 자체가 제공하는 것 이상의
|
||||
작업을 자동화하기 위해 코드를 작성하는 방법을 포착한다.
|
||||
|
||||
## 쿠버네티스의 오퍼레이터
|
||||
|
||||
쿠버네티스는 자동화를 위해 설계되었다. 기본적으로 쿠버네티스의 중추를 통해 많은
|
||||
빌트인 자동화 기능을 사용할 수 있다. 쿠버네티스를 사용하여 워크로드 배포
|
||||
및 실행을 자동화할 수 있고, *또한* 쿠버네티스가 수행하는 방식을
|
||||
자동화할 수 있다.
|
||||
|
||||
쿠버네티스의 {{< glossary_tooltip text="컨트롤러" term_id="controller" >}}
|
||||
개념을 통해 쿠버네티스 코드 자체를 수정하지 않고도 클러스터의 동작을
|
||||
확장할 수 있다.
|
||||
오퍼레이터는 [사용자 정의 리소스](/docs/concepts/api-extension/custom-resources/)의
|
||||
컨트롤러 역할을 하는 쿠버네티스 API의 클라이언트이다.
|
||||
|
||||
## 오퍼레이터 예시 {#example}
|
||||
|
||||
오퍼레이터를 사용하여 자동화할 수 있는 몇 가지 사항은 다음과 같다.
|
||||
|
||||
* 주문형 애플리케이션 배포
|
||||
* 해당 애플리케이션의 상태를 백업하고 복원
|
||||
* 데이터베이스 스키마 또는 추가 구성 설정과 같은 관련 변경 사항에 따른
|
||||
애플리케이션 코드 업그레이드 처리
|
||||
* 쿠버네티스 API를 지원하지 않는 애플리케이션에 서비스를
|
||||
게시하여 검색을 지원
|
||||
* 클러스터의 전체 또는 일부에서 장애를 시뮬레이션하여 가용성 테스트
|
||||
* 내부 멤버 선출 절차없이 분산 애플리케이션의
|
||||
리더를 선택
|
||||
|
||||
오퍼레이터의 모습을 더 자세하게 볼 수 있는 방법은 무엇인가? 자세한 예는
|
||||
다음과 같다.
|
||||
|
||||
1. 클러스터에 구성할 수 있는 SampleDB라는 사용자 정의 리소스.
|
||||
2. 오퍼레이터의 컨트롤러 부분이 포함된 파드의 실행을
|
||||
보장하는 디플로이먼트.
|
||||
3. 오퍼레이터 코드의 컨테이너 이미지.
|
||||
4. 컨트롤 플레인을 쿼리하여 어떤 SampleDB 리소스가 구성되어 있는지
|
||||
알아내는 컨트롤러 코드.
|
||||
5. 오퍼레이터의 핵심은 API 서버에 구성된 리소스와 현재 상태를
|
||||
일치시키는 방법을 알려주는 코드이다.
|
||||
* 새 SampleDB를 추가하면 오퍼레이터는 퍼시스턴트볼륨클레임을
|
||||
설정하여 내구성있는 데이터베이스 스토리지, SampleDB를 실행하는 스테이트풀셋 및
|
||||
초기 구성을 처리하는 잡을 제공한다.
|
||||
* SampleDB를 삭제하면 오퍼레이터는 스냅샷을 생성한 다음 스테이트풀셋과 볼륨도
|
||||
제거되었는지 확인한다.
|
||||
6. 오퍼레이터는 정기적인 데이터베이스 백업도 관리한다. 오퍼레이터는 각 SampleDB
|
||||
리소스에 대해 데이터베이스에 연결하고 백업을 수행할 수 있는 파드를 생성하는
|
||||
시기를 결정한다. 이 파드는 데이터베이스 연결 세부 정보 및 자격 증명이 있는
|
||||
컨피그맵 및 / 또는 시크릿에 의존한다.
|
||||
7. 오퍼레이터는 관리하는 리소스에 견고한 자동화를 제공하는 것을 목표로 하기 때문에
|
||||
추가 지원 코드가 있다. 이 예제에서 코드는 데이터베이스가 이전 버전을 실행 중인지
|
||||
확인하고, 업그레이드된 경우 이를 업그레이드하는
|
||||
잡 오브젝트를 생성한다.
|
||||
|
||||
## 오퍼레이터 배포
|
||||
|
||||
오퍼레이터를 배포하는 가장 일반적인 방법은
|
||||
커스텀 리소스 데피니션의 정의 및 연관된 컨트롤러를 클러스터에 추가하는 것이다.
|
||||
컨테이너화된 애플리케이션을 실행하는 것처럼
|
||||
컨트롤러는 일반적으로 {{< glossary_tooltip text="컨트롤 플레인" term_id="control-plane" >}}
|
||||
외부에서 실행된다.
|
||||
예를 들어 클러스터에서 컨트롤러를 디플로이먼트로 실행할 수 있다.
|
||||
|
||||
## 오퍼레이터 사용 {#using-operators}
|
||||
|
||||
오퍼레이터가 배포되면 오퍼레이터가 사용하는 리소스의 종류를 추가, 수정 또는
|
||||
삭제하여 사용한다. 위의 예에 따라 오퍼레이터 자체에 대한
|
||||
디플로이먼트를 설정한 후 다음을 수행한다.
|
||||
|
||||
```shell
|
||||
kubectl get SampleDB # 구성된 데이터베이스 찾기
|
||||
|
||||
kubectl edit SampleDB/example-database # 일부 설정을 수동으로 변경하기
|
||||
```
|
||||
|
||||
…이것으로 끝이다! 오퍼레이터는 변경 사항을 적용하고 기존 서비스를
|
||||
양호한 상태로 유지한다.
|
||||
|
||||
## 자신만의 오퍼레이터 작성 {#writing-operator}
|
||||
|
||||
에코시스템에 원하는 동작을 구현하는 오퍼레이터가 없다면 직접 코딩할 수 있다.
|
||||
[다음 내용](#다음-내용)에서는 클라우드 네이티브 오퍼레이터를 작성하는 데
|
||||
사용할 수 있는 라이브러리 및 도구에 대한 몇 가지 링크를
|
||||
찾을 수 있다.
|
||||
|
||||
또한 [쿠버네티스 API의 클라이언트](/docs/reference/using-api/client-libraries/)
|
||||
역할을 할 수 있는 모든 언어 / 런타임을 사용하여 오퍼레이터(즉, 컨트롤러)를 구현한다.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture whatsnext %}}
|
||||
|
||||
* [사용자 정의 리소스](/docs/concepts/extend-kubernetes/api-extension/custom-resources/)에 대해 더 알아보기
|
||||
* [OperatorHub.io](https://operatorhub.io/)에서 유스케이스에 맞는 이미 만들어진 오퍼레이터 찾기
|
||||
* 기존 도구를 사용하여 자신만의 오퍼레이터를 작성해보자. 다음은 예시이다.
|
||||
* [KUDO](https://kudo.dev/) (Kubernetes Universal Declarative Operator) 사용하기
|
||||
* [kubebuilder](https://book.kubebuilder.io/) 사용하기
|
||||
* 웹훅(WebHook)과 함께 [Metacontroller](https://metacontroller.app/)를
|
||||
사용하여 직접 구현하기
|
||||
* [오퍼레이터 프레임워크](https://github.com/operator-framework/getting-started) 사용하기
|
||||
* 다른 사람들이 사용할 수 있도록 자신의 오퍼레이터를 [게시](https://operatorhub.io/)하기
|
||||
* 오퍼레이터 패턴을 소개한 [CoreOS 원본 기사](https://coreos.com/blog/introducing-operators.html) 읽기
|
||||
* 오퍼레이터 구축을 위한 모범 사례에 대한 구글 클라우드(Google Cloud)의 [기사](https://cloud.google.com/blog/products/containers-kubernetes/best-practices-for-building-kubernetes-operators-and-stateful-apps) 읽기
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ metadata:
|
|||
spec:
|
||||
containers:
|
||||
- name: nginx
|
||||
image: nginx:1.7.9
|
||||
image: nginx:1.14.2
|
||||
ports:
|
||||
- containerPort: 80
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ metadata:
|
|||
spec:
|
||||
containers:
|
||||
- name: nginx
|
||||
image: nginx:1.7.9
|
||||
image: nginx:1.14.2
|
||||
ports:
|
||||
- containerPort: 80
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ metadata:
|
|||
spec:
|
||||
containers:
|
||||
- name: nginx
|
||||
image: nginx:1.7.9
|
||||
image: nginx:1.14.2
|
||||
ports:
|
||||
- containerPort: 80
|
||||
```
|
||||
|
|
|
|||
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
title: "정책"
|
||||
weight: 90
|
||||
---
|
||||
|
|
@ -0,0 +1,388 @@
|
|||
---
|
||||
title: 리밋 레인지(Limit Range)
|
||||
content_template: templates/concept
|
||||
weight: 10
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
|
||||
기본적으로 컨테이너는 쿠버네티스 클러스터에서 무제한 [컴퓨팅 리소스](/docs/user-guide/compute-resources)로 실행된다.
|
||||
리소스 쿼터을 사용하면 클러스터 관리자는 네임스페이스별로 리소스 사용과 생성을 제한할 수 있다.
|
||||
네임스페이스 내에서 파드나 컨테이너는 네임스페이스의 리소스 쿼터에 정의된 만큼의 CPU와 메모리를 사용할 수 있다. 하나의 파드 또는 컨테이너가 사용 가능한 모든 리소스를 독점할 수 있다는 우려가 있다. 리밋레인지는 네임스페이스에서 리소스 할당(파드 또는 컨테이너)을 제한하는 정책이다.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
||||
{{% capture body %}}
|
||||
|
||||
_리밋레인지_ 는 다음과 같은 제약 조건을 제공한다.
|
||||
|
||||
- 네임스페이스에서 파드 또는 컨테이너별 최소 및 최대 컴퓨팅 리소스 사용량을 지정한다.
|
||||
- 네임스페이스에서 스토리지클래스별 최소 및 최대 스토리지 요청을 지정한다.
|
||||
- 네임스페이스에서 리소스에 대한 요청과 제한 사이의 비율을 지정한다.
|
||||
- 네임스페이스에서 컴퓨팅 리소스에 대한 기본 요청/제한을 설정하고 런타임에 있는 컨테이너에 자동으로 설정한다.
|
||||
|
||||
## 리밋레인지 활성화
|
||||
|
||||
많은 쿠버네티스 배포판에 리밋레인지 지원이 기본적으로 활성화되어 있다. apiserver `--enable-admission-plugins=` 플래그의 인수 중 하나로 `LimitRanger` 어드미션 컨트롤러가 있는 경우 활성화된다.
|
||||
|
||||
해당 네임스페이스에 리밋레인지 오브젝트가 있는 경우 특정 네임스페이스에 리밋레인지가 지정된다.
|
||||
|
||||
리밋레인지 오브젝트의 이름은 유효한 [DNS 서브도메인 이름](/ko/docs/concepts/overview/working-with-objects/names/#dns-서브도메인-이름)이어야한다.
|
||||
|
||||
### 범위 제한의 개요
|
||||
|
||||
- 관리자는 하나의 네임스페이스에 하나의 `LimitRange`를 만든다.
|
||||
- 사용자는 네임스페이스에서 파드, 컨테이너 및 퍼시스턴트볼륨클레임과 같은 리소스를 생성한다.
|
||||
- `LimitRanger` 어드미션 컨트롤러는 컴퓨팅 리소스 요청 사항을 설정하지 않은 모든 파드와 컨테이너에 대한 기본값과 제한을 지정하고 네임스페이스의 리밋레인지에 정의된 리소스의 최소, 최대 및 비율을 초과하지 않도록 사용량을 추적한다.
|
||||
- 리밋레인지 제약 조건을 위반하는 리소스(파드, 컨테이너, 퍼시스턴트볼륨클레임)를 생성하거나 업데이트하는 경우 HTTP 상태 코드 `403 FORBIDDEN` 및 위반된 제약 조건을 설명하는 메시지와 함께 API 서버에 대한 요청이 실패한다.
|
||||
- `cpu`, `memory`와 같은 컴퓨팅 리소스의 네임스페이스에서 리밋레인지가 활성화된 경우 사용자는 해당 값에 대한 요청 또는 제한을 지정해야 한다. 그렇지 않으면 시스템에서 파드 생성이 거부될 수 있다.
|
||||
- 리밋레인지 유효성 검사는 파드 실행 단계가 아닌 파드 어드미션 단계에서만 발생한다.
|
||||
|
||||
범위 제한을 사용하여 생성할 수 있는 정책의 예는 다음과 같다.
|
||||
|
||||
- 용량이 8GiB RAM과 16 코어인 2 노드 클러스터에서 네임스페이스의 파드를 제한하여 CPU의 최대 제한이 500m인 CPU 100m를 요청하고 메모리의 최대 제한이 600M인 메모리 200Mi를 요청하라.
|
||||
- 스펙에 CPU 및 메모리 요청없이 시작된 컨테이너에 대해 기본 CPU 제한 및 요청을 150m로, 메모리 기본 요청을 300Mi로 정의하라.
|
||||
|
||||
네임스페이스의 총 제한이 파드/컨테이너의 제한 합보다 작은 경우 리소스에 대한 경합이 있을 수 있다.
|
||||
이 경우 컨테이너 또는 파드가 생성되지 않는다.
|
||||
|
||||
경합이나 리밋레인지 변경은 이미 생성된 리소스에 영향을 미치지 않는다.
|
||||
|
||||
## 컨테이너 컴퓨팅 리소스 제한
|
||||
|
||||
다음 절에서는 컨테이너 레벨에서 작동하는 리밋레인지 생성에 대해 설명한다.
|
||||
4개의 컨테이너가 있는 파드가 먼저 생성된다. 파드 내의 각 컨테이너에는 특정 `spec.resource` 구성이 있다.
|
||||
파드 내의 각 컨테이너는 `LimitRanger` 어드미션 컨트롤러에 의해 다르게 처리된다.
|
||||
|
||||
다음 kubectl 명령을 사용하여 네임스페이스 `limitrange-demo`를 생성한다.
|
||||
|
||||
```shell
|
||||
kubectl create namespace limitrange-demo
|
||||
```
|
||||
|
||||
kubectl 명령에서 네임스페이스 대상인 `limitrange-demo`를 빠트리지 않으려면 다음 명령으로 컨텍스트를 변경한다.
|
||||
|
||||
```shell
|
||||
kubectl config set-context --current --namespace=limitrange-demo
|
||||
```
|
||||
|
||||
다음은 리밋레인지 오브젝트의 구성 파일이다.
|
||||
{{< codenew file="admin/resource/limit-mem-cpu-container.yaml" >}}
|
||||
|
||||
이 오브젝트는 컨테이너에 적용할 최소 및 최대 CPU/메모리 제한, 기본 CPU/메모리 요청과 CPU/메모리 리소스에 대한 기본 제한을 정의한다.
|
||||
|
||||
다음 kubectl 명령을 사용하여 `limit-mem-cpu-per-container` 리밋레인지를 생성한다.
|
||||
|
||||
```shell
|
||||
kubectl create -f https://k8s.io/examples/admin/resource/limit-mem-cpu-container.yaml
|
||||
```
|
||||
|
||||
```shell
|
||||
kubectl describe limitrange/limit-mem-cpu-per-container
|
||||
```
|
||||
|
||||
```shell
|
||||
Type Resource Min Max Default Request Default Limit Max Limit/Request Ratio
|
||||
---- -------- --- --- --------------- ------------- -----------------------
|
||||
Container cpu 100m 800m 110m 700m -
|
||||
Container memory 99Mi 1Gi 111Mi 900Mi -
|
||||
```
|
||||
다음은 4개의 컨테이너가 포함된 파드의 구성 파일로 리밋레인지 기능을 보여준다.
|
||||
{{< codenew file="admin/resource/limit-range-pod-1.yaml" >}}
|
||||
|
||||
`busybox1` 파드를 생성한다.
|
||||
|
||||
```shell
|
||||
kubectl apply -f https://k8s.io/examples/admin/resource/limit-range-pod-1.yaml
|
||||
```
|
||||
|
||||
### 유효한 CPU/메모리 요청과 제한이 있는 컨테이너 스펙
|
||||
|
||||
`busybox-cnt01`의 리소스 구성을 보자.
|
||||
|
||||
```shell
|
||||
kubectl get po/busybox1 -o json | jq ".spec.containers[0].resources"
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"limits": {
|
||||
"cpu": "500m",
|
||||
"memory": "200Mi"
|
||||
},
|
||||
"requests": {
|
||||
"cpu": "100m",
|
||||
"memory": "100Mi"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- `busybox` 파드 내의 `busybox-cnt01` 컨테이너는 `requests.cpu=100m`와 `requests.memory=100Mi`로 정의됐다.
|
||||
- `100m <= 500m <= 800m`, 컨테이너 CPU 제한(500m)은 승인된 CPU 리밋레인지 내에 있다.
|
||||
- `99Mi <= 200Mi <= 1Gi`, 컨테이너 메모리 제한(200Mi)은 승인된 메모리 리밋레인지 내에 있다.
|
||||
- CPU/메모리에 대한 요청/제한 비율 검증이 없으므로 컨테이너가 유효하며 생성되었다.
|
||||
|
||||
|
||||
### 유효한 CPU/메모리 요청은 있지만 제한이 없는 컨테이너 스펙
|
||||
|
||||
`busybox-cnt02`의 리소스 구성을 보자.
|
||||
|
||||
```shell
|
||||
kubectl get po/busybox1 -o json | jq ".spec.containers[1].resources"
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"limits": {
|
||||
"cpu": "700m",
|
||||
"memory": "900Mi"
|
||||
},
|
||||
"requests": {
|
||||
"cpu": "100m",
|
||||
"memory": "100Mi"
|
||||
}
|
||||
}
|
||||
```
|
||||
- `busybox1` 파드 내의 `busybox-cnt02` 컨테이너는 `requests.cpu=100m`와 `requests.memory=100Mi`를 정의했지만 CPU와 메모리에 대한 제한은 없다.
|
||||
- 컨테이너에 제한 섹션이 없다. `limit-mem-cpu-per-container` 리밋레인지 오브젝트에 정의된 기본 제한은 `limits.cpu=700mi` 및 `limits.memory=900Mi`로 이 컨테이너에 설정된다.
|
||||
- `100m <= 700m <= 800m`, 컨테이너 CPU 제한(700m)이 승인된 CPU 제한 범위 내에 있다.
|
||||
- `99Mi <= 900Mi <= 1Gi`, 컨테이너 메모리 제한(900Mi)이 승인된 메모리 제한 범위 내에 있다.
|
||||
- 요청/제한 비율이 설정되지 않았으므로 컨테이너가 유효하며 생성되었다.
|
||||
|
||||
### 유효한 CPU/메모리 제한은 있지만 요청은 없는 컨테이너 스펙
|
||||
|
||||
`busybox-cnt03`의 리소스 구성을 보자.
|
||||
|
||||
```shell
|
||||
kubectl get po/busybox1 -o json | jq ".spec.containers[2].resources"
|
||||
```
|
||||
```json
|
||||
{
|
||||
"limits": {
|
||||
"cpu": "500m",
|
||||
"memory": "200Mi"
|
||||
},
|
||||
"requests": {
|
||||
"cpu": "500m",
|
||||
"memory": "200Mi"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- `busybox1` 파드 내의 `busybox-cnt03` 컨테이너는 `limits.cpu=500m`와 `limits.memory=200Mi`를 정의했지만 CPU와 메모리에 대한 요청은 없다.
|
||||
- 컨테이너에 요청 섹션이 정의되지 않았다. `limit-mem-cpu-per-container` 리밋레인지에 정의된 기본 요청은 제한 섹션을 채우는 데 사용되지 않지만 컨테이너에 의해 정의된 제한은 `limits.cpu=500m` 및 `limits.memory=200Mi`로 설정된다.
|
||||
- `100m <= 500m <= 800m`, 컨테이너 CPU 제한(500m)은 승인된 CPU 제한 범위 내에 있다.
|
||||
- `99Mi <= 200Mi <= 1Gi`, 컨테이너 메모리 제한(200Mi)은 승인된 메모리 제한 범위 내에 있다.
|
||||
- 요청/제한 비율이 설정되지 않았으므로 컨테이너가 유효하며 생성되었다.
|
||||
|
||||
### CPU/메모리 요청/제한이 없는 컨테이너 스펙
|
||||
|
||||
`busybox-cnt04`의 리소스 구성을 보자.
|
||||
|
||||
```shell
|
||||
kubectl get po/busybox1 -o json | jq ".spec.containers[3].resources"
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"limits": {
|
||||
"cpu": "700m",
|
||||
"memory": "900Mi"
|
||||
},
|
||||
"requests": {
|
||||
"cpu": "110m",
|
||||
"memory": "111Mi"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- `busybox1`의 `busybox-cnt04` 컨테이너는 제한이나 요청을 정의하지 않았다.
|
||||
- 컨테이너는 제한 섹션을 정의하지 않으며 `limit-mem-cpu-per-container` 리밋레인지에 정의된 기본 제한은 `limit.cpu=700m` 및 `limits.memory=900Mi`로 설정된다.
|
||||
- 컨테이너는 요청 섹션을 정의하지 않으며 `limit-mem-cpu-per-container` 리밋레인지에 정의된 defaultRequest는 `requests.cpu=110m` 및 `requests.memory=111Mi`로 설정된다.
|
||||
- `100m <= 700m <= 800m`, 컨테이너 CPU 제한(700m)은 승인된 CPU 제한 범위 내에 있다.
|
||||
- `99Mi <= 900Mi <= 1Gi`, 컨테이너 메모리 제한(900Mi)은 승인된 메모리 제한 범위 내에 있다.
|
||||
- 요청/제한 비율이 설정되지 않았으므로 컨테이너가 유효하며 생성되었다.
|
||||
|
||||
`busybox` 파드에 정의된 모든 컨테이너는 리밋레인지 유효성 검사를 통과했으므로 이 파드는 유효하며 네임스페이스에서 생성된다.
|
||||
|
||||
## 파드 컴퓨팅 리소스 제한
|
||||
|
||||
다음 절에서는 파드 레벨에서 리소스를 제한하는 방법에 대해 설명한다.
|
||||
|
||||
{{< codenew file="admin/resource/limit-mem-cpu-pod.yaml" >}}
|
||||
|
||||
`busybox1` 파드를 삭제하지 않고 `limitrange-demo` 네임스페이스에 `limit-mem-cpu-pod` 리밋레인지를 생성한다.
|
||||
|
||||
```shell
|
||||
kubectl apply -f https://k8s.io/examples/admin/resource/limit-mem-cpu-pod.yaml
|
||||
```
|
||||
리밋레인지가 생성되고 파드별로 CPU가 2 코어로, 메모리가 2Gi로 제한된다.
|
||||
|
||||
```shell
|
||||
limitrange/limit-mem-cpu-per-pod created
|
||||
```
|
||||
|
||||
다음 kubectl 명령을 사용하여 `limit-mem-cpu-per-pod` 리밋레인지 오브젝트의 정보를 나타낸다.
|
||||
|
||||
```shell
|
||||
kubectl describe limitrange/limit-mem-cpu-per-pod
|
||||
```
|
||||
|
||||
```shell
|
||||
Name: limit-mem-cpu-per-pod
|
||||
Namespace: limitrange-demo
|
||||
Type Resource Min Max Default Request Default Limit Max Limit/Request Ratio
|
||||
---- -------- --- --- --------------- ------------- -----------------------
|
||||
Pod cpu - 2 - - -
|
||||
Pod memory - 2Gi - - -
|
||||
```
|
||||
|
||||
이제 `busybox2` 파드를 생성한다.
|
||||
|
||||
{{< codenew file="admin/resource/limit-range-pod-2.yaml" >}}
|
||||
|
||||
```shell
|
||||
kubectl apply -f https://k8s.io/examples/admin/resource/limit-range-pod-2.yaml
|
||||
```
|
||||
|
||||
`busybox2` 파드 정의는 `busybox1`과 동일하지만 이제 파드 리소스가 제한되어 있으므로 오류가 보고된다.
|
||||
|
||||
```shell
|
||||
Error from server (Forbidden): error when creating "limit-range-pod-2.yaml": pods "busybox2" is forbidden: [maximum cpu usage per Pod is 2, but limit is 2400m., maximum memory usage per Pod is 2Gi, but limit is 2306867200.]
|
||||
```
|
||||
|
||||
```shell
|
||||
kubectl get po/busybox1 -o json | jq ".spec.containers[].resources.limits.memory"
|
||||
"200Mi"
|
||||
"900Mi"
|
||||
"200Mi"
|
||||
"900Mi"
|
||||
```
|
||||
|
||||
해당 컨테이너의 총 메모리 제한이 리밋레인지에 정의된 제한보다 크므로 `busybox2` 파드는 클러스터에서 허용되지 않는다.
|
||||
`busyRange1`은 리밋레인지를 생성하기 전에 클러스터에서 생성되고 허용되므로 제거되지 않는다.
|
||||
|
||||
## 스토리지 리소스 제한
|
||||
|
||||
리밋레인지를 사용하여 네임스페이스에서 각 퍼시스턴트볼륨클레임이 요청할 수 있는 [스토리지 리소스](/ko/docs/concepts/storage/persistent-volumes/)의 최소 및 최대 크기를 지정할 수 있다.
|
||||
|
||||
{{< codenew file="admin/resource/storagelimits.yaml" >}}
|
||||
|
||||
`kubectl create`를 사용하여 YAML을 적용한다.
|
||||
|
||||
```shell
|
||||
kubectl create -f https://k8s.io/examples/admin/resource/storagelimits.yaml
|
||||
```
|
||||
|
||||
```shell
|
||||
limitrange/storagelimits created
|
||||
```
|
||||
|
||||
생성된 오브젝트의 정보를 나타낸다.
|
||||
|
||||
```shell
|
||||
kubectl describe limits/storagelimits
|
||||
```
|
||||
|
||||
출력은 다음과 같다.
|
||||
|
||||
```shell
|
||||
Name: storagelimits
|
||||
Namespace: limitrange-demo
|
||||
Type Resource Min Max Default Request Default Limit Max Limit/Request Ratio
|
||||
---- -------- --- --- --------------- ------------- -----------------------
|
||||
PersistentVolumeClaim storage 1Gi 2Gi - - -
|
||||
```
|
||||
|
||||
{{< codenew file="admin/resource/pvc-limit-lower.yaml" >}}
|
||||
|
||||
```shell
|
||||
kubectl create -f https://k8s.io/examples/admin/resource/pvc-limit-lower.yaml
|
||||
```
|
||||
|
||||
`requests.storage`가 리밋레인지의 Min 값보다 낮은 PVC를 만드는 동안 서버에서 발생하는 오류는 다음과 같다.
|
||||
|
||||
```shell
|
||||
Error from server (Forbidden): error when creating "pvc-limit-lower.yaml": persistentvolumeclaims "pvc-limit-lower" is forbidden: minimum storage usage per PersistentVolumeClaim is 1Gi, but request is 500Mi.
|
||||
```
|
||||
|
||||
`requests.storage`가 리밋레인지의 Max 값보다 큰 경우에도 동일한 동작이 나타난다.
|
||||
|
||||
{{< codenew file="admin/resource/pvc-limit-greater.yaml" >}}
|
||||
|
||||
```shell
|
||||
kubectl create -f https://k8s.io/examples/admin/resource/pvc-limit-greater.yaml
|
||||
```
|
||||
|
||||
```shell
|
||||
Error from server (Forbidden): error when creating "pvc-limit-greater.yaml": persistentvolumeclaims "pvc-limit-greater" is forbidden: maximum storage usage per PersistentVolumeClaim is 2Gi, but request is 5Gi.
|
||||
```
|
||||
|
||||
## 제한/요청 비율
|
||||
|
||||
`LimitRangeSpec`에 `LimitRangeItem.maxLimitRequestRatio`가 지정되어 있으면 명명된 리소스는 제한을 요청으로 나눈 값이 열거된 값보다 작거나 같은 0이 아닌 값을 요청과 제한 모두 가져야 한다.
|
||||
|
||||
다음의 리밋레인지는 메모리 제한이 네임스페이스의 모든 파드에 대한 메모리 요청 양의 최대 두 배가 되도록 한다.
|
||||
|
||||
{{< codenew file="admin/resource/limit-memory-ratio-pod.yaml" >}}
|
||||
|
||||
```shell
|
||||
kubectl apply -f https://k8s.io/examples/admin/resource/limit-memory-ratio-pod.yaml
|
||||
```
|
||||
|
||||
다음의 kubectl 명령으로 `limit-memory-ratio-pod` 리밋레인지의 정보를 나타낸다.
|
||||
|
||||
```shell
|
||||
kubectl describe limitrange/limit-memory-ratio-pod
|
||||
```
|
||||
|
||||
```shell
|
||||
Name: limit-memory-ratio-pod
|
||||
Namespace: limitrange-demo
|
||||
Type Resource Min Max Default Request Default Limit Max Limit/Request Ratio
|
||||
---- -------- --- --- --------------- ------------- -----------------------
|
||||
Pod memory - - - - 2
|
||||
```
|
||||
|
||||
|
||||
`requests.memory=100Mi` 및 `limits.memory=300Mi`로 파드를 생성한다.
|
||||
|
||||
{{< codenew file="admin/resource/limit-range-pod-3.yaml" >}}
|
||||
|
||||
```shell
|
||||
kubectl apply -f https://k8s.io/examples/admin/resource/limit-range-pod-3.yaml
|
||||
```
|
||||
|
||||
위 예에서 제한/요청 비율(`3`)이 `limit-memory-ratio-pod` 리밋레인지에 지정된 제한 비율(`2`)보다 커서 파드 생성에 실패했다.
|
||||
|
||||
```
|
||||
Error from server (Forbidden): error when creating "limit-range-pod-3.yaml": pods "busybox3" is forbidden: memory max limit to request ratio per Pod is 2, but provided ratio is 3.000000.
|
||||
```
|
||||
|
||||
## 정리
|
||||
|
||||
모든 리소스를 해제하려면 `limitrange-demo` 네임스페이스를 삭제한다.
|
||||
|
||||
```shell
|
||||
kubectl delete ns limitrange-demo
|
||||
```
|
||||
다음 명령을 사용하여 컨텍스트를 `default` 네임스페이스로 변경한다.
|
||||
|
||||
```shell
|
||||
kubectl config set-context --current --namespace=default
|
||||
```
|
||||
|
||||
## 예제
|
||||
|
||||
- [네임스페이스별 컴퓨팅 리소스를 제한하는 방법에 대한 튜토리얼](/docs/tasks/administer-cluster/manage-resources/cpu-constraint-namespace/)을 참고하길 바란다.
|
||||
- [스토리지 사용을 제한하는 방법](/docs/tasks/administer-cluster/limit-storage-consumption/#limitrange-to-limit-requests-for-storage)을 확인하라.
|
||||
- [네임스페이스별 쿼터에 대한 자세한 예](/docs/tasks/administer-cluster/quota-memory-cpu-namespace/)를 참고하길 바란다.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture whatsnext %}}
|
||||
|
||||
보다 자세한 내용은 [LimitRanger 설계 문서](https://git.k8s.io/community/contributors/design-proposals/resource-management/admission_control_limit_range.md)를 참고하길 바란다.
|
||||
|
||||
{{% /capture %}}
|
||||
|
|
@ -0,0 +1,635 @@
|
|||
---
|
||||
title: 파드 시큐리티 폴리시
|
||||
content_template: templates/concept
|
||||
weight: 20
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
|
||||
{{< feature-state state="beta" >}}
|
||||
|
||||
파드 시큐리티 폴리시를 사용하면 파드 생성 및 업데이트에 대한 세분화된 권한을
|
||||
부여할 수 있다.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
||||
{{% capture body %}}
|
||||
|
||||
## 파드 시큐리티 폴리시란?
|
||||
|
||||
_Pod Security Policy_ 는 파드 명세의 보안 관련 측면을 제어하는 클러스터-레벨의
|
||||
리소스이다. [파드시큐리티폴리시](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#podsecuritypolicy-v1beta1-policy) 오브젝트는
|
||||
관련 필드에 대한 기본값뿐만 아니라 시스템에 적용하기 위해 파드가 실행해야만 하는
|
||||
조건 셋을 정의한다. 관리자는
|
||||
다음을 제어할 수 있다.
|
||||
|
||||
| 제어 측면 | 필드 이름 |
|
||||
| ----------------------------------------------------| ------------------------------------------- |
|
||||
| 특권을 가진(privileged) 컨테이너의 실행 | [`privileged`](#privileged) |
|
||||
| 호스트 네임스페이스의 사용 | [`hostPID`, `hostIPC`](#host-namespaces) |
|
||||
| 호스트 네트워킹과 포트의 사용 | [`hostNetwork`, `hostPorts`](#host-namespaces) |
|
||||
| 볼륨 유형의 사용 | [`volumes`](#volumes-and-file-systems) |
|
||||
| 호스트 파일시스템의 사용 | [`allowedHostPaths`](#volumes-and-file-systems) |
|
||||
| FlexVolume 드라이버의 화이트리스트 | [`allowedFlexVolumes`](#flexvolume-drivers) |
|
||||
| 파드 볼륨을 소유한 FSGroup 할당 | [`fsGroup`](#volumes-and-file-systems) |
|
||||
| 읽기 전용 루트 파일시스템 사용 필요 | [`readOnlyRootFilesystem`](#volumes-and-file-systems) |
|
||||
| 컨테이너의 사용자 및 그룹 ID | [`runAsUser`, `runAsGroup`, `supplementalGroups`](#users-and-groups) |
|
||||
| 루트 특권으로의 에스컬레이션 제한 | [`allowPrivilegeEscalation`, `defaultAllowPrivilegeEscalation`](#privilege-escalation) |
|
||||
| 리눅스 기능 | [`defaultAddCapabilities`, `requiredDropCapabilities`, `allowedCapabilities`](#capabilities) |
|
||||
| 컨테이너의 SELinux 컨텍스트 | [`seLinux`](#selinux) |
|
||||
| 컨테이너에 허용된 Proc 마운트 유형 | [`allowedProcMountTypes`](#allowedprocmounttypes) |
|
||||
| 컨테이너가 사용하는 AppArmor 프로파일 | [어노테이션](#apparmor) |
|
||||
| 컨테이너가 사용하는 seccomp 프로파일 | [어노테이션](#seccomp) |
|
||||
| 컨테이너가 사용하는 sysctl 프로파일 | [`forbiddenSysctls`,`allowedUnsafeSysctls`](#sysctl) |
|
||||
|
||||
|
||||
## 파드 시큐리티 폴리시 활성화
|
||||
|
||||
파드 시큐리티 폴리시 제어는 선택 사항(하지만 권장함)인
|
||||
[어드미션
|
||||
컨트롤러](/docs/reference/access-authn-authz/admission-controllers/#podsecuritypolicy)로
|
||||
구현된다. [어드미션 컨트롤러 활성화](/docs/reference/access-authn-authz/admission-controllers/#how-do-i-turn-on-an-admission-control-plug-in)하면
|
||||
파드시큐리티폴리시가 적용되지만,
|
||||
정책을 승인하지 않고 활성화하면 클러스터에
|
||||
**파드가 생성되지 않는다.**
|
||||
|
||||
파드 시큐리티 폴리시 API(`policy/v1beta1/podsecuritypolicy`)는
|
||||
어드미션 컨트롤러와 독립적으로 활성화되므로 기존 클러스터의 경우
|
||||
어드미션 컨트롤러를 활성화하기 전에 정책을 추가하고 권한을
|
||||
부여하는 것이 좋다.
|
||||
|
||||
## 정책 승인
|
||||
|
||||
파드시큐리티폴리시 리소스가 생성되면 아무 것도 수행하지 않는다. 이를 사용하려면
|
||||
요청 사용자 또는 대상 파드의
|
||||
[서비스 어카운트](/docs/tasks/configure-pod-container/configure-service-account/)는
|
||||
정책에서 `use` 동사를 허용하여 정책을 사용할 권한이 있어야 한다.
|
||||
|
||||
대부분의 쿠버네티스 파드는 사용자가 직접 만들지 않는다. 대신 일반적으로
|
||||
컨트롤러 관리자를 통해
|
||||
[디플로이먼트](/ko/docs/concepts/workloads/controllers/deployment/),
|
||||
[레플리카셋](/ko/docs/concepts/workloads/controllers/replicaset/), 또는 기타
|
||||
템플릿 컨트롤러의 일부로 간접적으로 생성된다. 컨트롤러에 정책에 대한 접근 권한을 부여하면
|
||||
해당 컨트롤러에 의해 생성된 *모든* 파드에 대한 접근 권한이 부여되므로 정책을 승인하는
|
||||
기본 방법은 파드의 서비스 어카운트에 대한 접근 권한을
|
||||
부여하는 것이다([예](#다른-파드를-실행) 참고).
|
||||
|
||||
### RBAC을 통한 방법
|
||||
|
||||
[RBAC](/docs/reference/access-authn-authz/rbac/)은 표준 쿠버네티스 권한 부여 모드이며,
|
||||
정책 사용 권한을 부여하는 데 쉽게 사용할 수 있다.
|
||||
|
||||
먼저, `Role` 또는 `ClusterRole`은 원하는 정책을 `use` 하려면 접근 권한을 부여해야 한다.
|
||||
접근 권한을 부여하는 규칙은 다음과 같다.
|
||||
|
||||
```yaml
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: <role name>
|
||||
rules:
|
||||
- apiGroups: ['policy']
|
||||
resources: ['podsecuritypolicies']
|
||||
verbs: ['use']
|
||||
resourceNames:
|
||||
- <list of policies to authorize>
|
||||
```
|
||||
|
||||
그런 다음 `(Cluster)Role`이 승인된 사용자에게 바인딩된다.
|
||||
|
||||
```yaml
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: <binding name>
|
||||
roleRef:
|
||||
kind: ClusterRole
|
||||
name: <role name>
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
subjects:
|
||||
# Authorize specific service accounts:
|
||||
- kind: ServiceAccount
|
||||
name: <authorized service account name>
|
||||
namespace: <authorized pod namespace>
|
||||
# Authorize specific users (not recommended):
|
||||
- kind: User
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
name: <authorized user name>
|
||||
```
|
||||
|
||||
`RoleBinding`(`ClusterRoleBinding` 아님)을 사용하는 경우, 바인딩과 동일한 네임스페이스에서
|
||||
실행되는 파드에 대해서만 사용 권한을 부여한다. 네임스페이스에서 실행되는 모든 파드에 접근 권한을
|
||||
부여하기 위해 시스템 그룹과 쌍을 이룰 수 있다.
|
||||
```yaml
|
||||
# Authorize all service accounts in a namespace:
|
||||
- kind: Group
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
name: system:serviceaccounts
|
||||
# Or equivalently, all authenticated users in a namespace:
|
||||
- kind: Group
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
name: system:authenticated
|
||||
```
|
||||
|
||||
RBAC 바인딩에 대한 자세한 예는,
|
||||
[역할 바인딩 예제](/docs/reference/access-authn-authz/rbac#role-binding-examples)를 참고하길 바란다.
|
||||
파드시큐리티폴리시 인증에 대한 전체 예제는
|
||||
[아래](#예제)를 참고하길 바란다.
|
||||
|
||||
|
||||
### 문제 해결
|
||||
|
||||
- [컨트롤러 관리자](/docs/admin/kube-controller-manager/)는
|
||||
[보안 API 포트](/docs/reference/access-authn-authz/controlling-access/)에 대해 실행해야 하며,
|
||||
슈퍼유저 권한이 없어야 한다. 그렇지 않으면 요청이 인증 및 권한 부여 모듈을 우회하고,
|
||||
모든 파드시큐리티폴리시 오브젝트가 허용되며
|
||||
사용자는 특권있는 컨테이너를 만들 수 있다. 컨트롤러 관리자 권한 구성에 대한 자세한
|
||||
내용은 [컨트롤러 역할](/docs/reference/access-authn-authz/rbac/#controller-roles)을
|
||||
참고하길 바란다.
|
||||
|
||||
## 정책 순서
|
||||
|
||||
파드 생성 및 업데이트를 제한할 뿐만 아니라 파드 시큐리티 폴리시를 사용하여
|
||||
제어하는 많은 필드에 기본값을 제공할 수도 있다. 여러 정책을
|
||||
사용할 수 있는 경우 파드 시큐리티 폴리시 컨트롤러는
|
||||
다음 기준에 따라 정책을 선택한다.
|
||||
|
||||
1. 기본 설정을 변경하거나 파드를 변경하지 않고 파드를 있는 그대로 허용하는 파드시큐리티폴리시가
|
||||
선호된다. 이러한 비-변이(non-mutating) 파드시큐리티폴리시의
|
||||
순서는 중요하지 않다.
|
||||
2. 파드를 기본값으로 설정하거나 변경해야 하는 경우, 파드를 허용할 첫 번째 파드시큐리티폴리시
|
||||
(이름순)가 선택된다.
|
||||
|
||||
{{< note >}}
|
||||
업데이트 작업 중(파드 스펙에 대한 변경이 허용되지 않는 동안) 비-변이 파드시큐리티폴리시만
|
||||
파드의 유효성을 검사하는 데 사용된다.
|
||||
{{< /note >}}
|
||||
|
||||
## 예제
|
||||
|
||||
_이 예에서는 파드시큐리티폴리시 어드미션 컨트롤러가 활성화된 클러스터가 실행 중이고
|
||||
클러스터 관리자 권한이 있다고 가정한다._
|
||||
|
||||
### 설정
|
||||
|
||||
이 예제와 같이 네임스페이스와 서비스 어카운트를 설정한다.
|
||||
이 서비스 어카운트를 사용하여 관리자가 아닌 사용자를 조정한다.
|
||||
|
||||
```shell
|
||||
kubectl create namespace psp-example
|
||||
kubectl create serviceaccount -n psp-example fake-user
|
||||
kubectl create rolebinding -n psp-example fake-editor --clusterrole=edit --serviceaccount=psp-example:fake-user
|
||||
```
|
||||
|
||||
어떤 사용자로 활동하고 있는지 명확하게 하고 입력 내용을 저장하려면 2개의 별칭(alias)을
|
||||
만든다.
|
||||
|
||||
```shell
|
||||
alias kubectl-admin='kubectl -n psp-example'
|
||||
alias kubectl-user='kubectl --as=system:serviceaccount:psp-example:fake-user -n psp-example'
|
||||
```
|
||||
|
||||
### 정책과 파드 생성
|
||||
|
||||
파일에서 예제 파드시큐리티폴리시 오브젝트를 정의한다. 이는 특권있는 파드를
|
||||
만들지 못하게 하는 정책이다.
|
||||
파드시큐리티폴리시 오브젝트의 이름은 유효한
|
||||
[DNS 서브도메인 이름](/ko/docs/concepts/overview/working-with-objects/names#dns-서브도메인-이름)이어야 한다.
|
||||
|
||||
{{< codenew file="policy/example-psp.yaml" >}}
|
||||
|
||||
그리고 kubectl로 생성한다.
|
||||
|
||||
```shell
|
||||
kubectl-admin create -f example-psp.yaml
|
||||
```
|
||||
|
||||
이제 권한이 없는 사용자로서 간단한 파드를 생성해보자.
|
||||
|
||||
```shell
|
||||
kubectl-user create -f- <<EOF
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: pause
|
||||
spec:
|
||||
containers:
|
||||
- name: pause
|
||||
image: k8s.gcr.io/pause
|
||||
EOF
|
||||
Error from server (Forbidden): error when creating "STDIN": pods "pause" is forbidden: unable to validate against any pod security policy: []
|
||||
```
|
||||
|
||||
**무슨 일이 일어났나?** 파드시큐리티폴리시가 생성되었지만, 파드의 서비스 어카운트나 `fake-user`는
|
||||
새 정책을 사용할 권한이 없다.
|
||||
|
||||
```shell
|
||||
kubectl-user auth can-i use podsecuritypolicy/example
|
||||
no
|
||||
```
|
||||
|
||||
예제 정책에서 `fake-user`에게 `use` 동사를 부여하는 rolebinding을
|
||||
생성한다.
|
||||
|
||||
{{< note >}}
|
||||
이 방법은 권장하지 않는다! 선호하는 방법은 [다음 절](#다른-파드를-실행)을
|
||||
참고하길 바란다.
|
||||
{{< /note >}}
|
||||
|
||||
```shell
|
||||
kubectl-admin create role psp:unprivileged \
|
||||
--verb=use \
|
||||
--resource=podsecuritypolicy \
|
||||
--resource-name=example
|
||||
role "psp:unprivileged" created
|
||||
|
||||
kubectl-admin create rolebinding fake-user:psp:unprivileged \
|
||||
--role=psp:unprivileged \
|
||||
--serviceaccount=psp-example:fake-user
|
||||
rolebinding "fake-user:psp:unprivileged" created
|
||||
|
||||
kubectl-user auth can-i use podsecuritypolicy/example
|
||||
yes
|
||||
```
|
||||
|
||||
이제 파드 생성을 다시 시도하자.
|
||||
|
||||
```shell
|
||||
kubectl-user create -f- <<EOF
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: pause
|
||||
spec:
|
||||
containers:
|
||||
- name: pause
|
||||
image: k8s.gcr.io/pause
|
||||
EOF
|
||||
pod "pause" created
|
||||
```
|
||||
|
||||
예상대로 작동한다! 그러나 특권있는 파드를 만들려는 시도는 여전히
|
||||
거부되어야 한다.
|
||||
|
||||
```shell
|
||||
kubectl-user create -f- <<EOF
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: privileged
|
||||
spec:
|
||||
containers:
|
||||
- name: pause
|
||||
image: k8s.gcr.io/pause
|
||||
securityContext:
|
||||
privileged: true
|
||||
EOF
|
||||
Error from server (Forbidden): error when creating "STDIN": pods "privileged" is forbidden: unable to validate against any pod security policy: [spec.containers[0].securityContext.privileged: Invalid value: true: Privileged containers are not allowed]
|
||||
```
|
||||
|
||||
계속 진행하기 전에 파드를 삭제하자.
|
||||
|
||||
```shell
|
||||
kubectl-user delete pod pause
|
||||
```
|
||||
|
||||
### 다른 파드를 실행
|
||||
|
||||
약간 다르게 다시 시도해보자.
|
||||
|
||||
```shell
|
||||
kubectl-user run pause --image=k8s.gcr.io/pause
|
||||
deployment "pause" created
|
||||
|
||||
kubectl-user get pods
|
||||
No resources found.
|
||||
|
||||
kubectl-user get events | head -n 2
|
||||
LASTSEEN FIRSTSEEN COUNT NAME KIND SUBOBJECT TYPE REASON SOURCE MESSAGE
|
||||
1m 2m 15 pause-7774d79b5 ReplicaSet Warning FailedCreate replicaset-controller Error creating: pods "pause-7774d79b5-" is forbidden: no providers available to validate pod request
|
||||
```
|
||||
|
||||
**무슨 일이 일어났나?** 우리는 이미 `fake-user`에 대해 `psp:unprivileged` 역할을 바인딩했는데,
|
||||
`Error creating: pods "pause-7774d79b5-" is
|
||||
forbidden: no providers available to validate pod request` 오류가
|
||||
발생하는 이유는 무엇인가? 그 답은 소스인 `replicaset-controller`에 있다. Fake-user가
|
||||
디플로이먼트를 성공적으로 생성했지만(레플리카셋을 성공적으로 생성했음), 레플리카셋이
|
||||
파드를 생성했을 때 podsecuritypolicy 예제를
|
||||
사용할 권한이 없었다.
|
||||
|
||||
이 문제를 해결하려면 `psp:unprivileged` 역할을 파드의 서비스 어카운트에 대신
|
||||
바인딩한다. 이 경우(지정하지 않았으므로) 서비스 어카운트는
|
||||
`default`이다.
|
||||
|
||||
```shell
|
||||
kubectl-admin create rolebinding default:psp:unprivileged \
|
||||
--role=psp:unprivileged \
|
||||
--serviceaccount=psp-example:default
|
||||
rolebinding "default:psp:unprivileged" created
|
||||
```
|
||||
|
||||
이제 다시 한번 해본다면 replicaset-controller가
|
||||
파드를 성공적으로 생성할 것이다.
|
||||
|
||||
```shell
|
||||
kubectl-user get pods --watch
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
pause-7774d79b5-qrgcb 0/1 Pending 0 1s
|
||||
pause-7774d79b5-qrgcb 0/1 Pending 0 1s
|
||||
pause-7774d79b5-qrgcb 0/1 ContainerCreating 0 1s
|
||||
pause-7774d79b5-qrgcb 1/1 Running 0 2s
|
||||
```
|
||||
|
||||
### 정리
|
||||
|
||||
네임스페이스를 삭제하여 대부분의 예제 리소스를 정리한다.
|
||||
|
||||
```shell
|
||||
kubectl-admin delete ns psp-example
|
||||
namespace "psp-example" deleted
|
||||
```
|
||||
|
||||
`PodSecurityPolicy` 리소스는 네임스페이스에 포함되지 않으므로 별도로
|
||||
정리해야 한다.
|
||||
|
||||
```shell
|
||||
kubectl-admin delete psp example
|
||||
podsecuritypolicy "example" deleted
|
||||
```
|
||||
|
||||
### 정책 예제
|
||||
|
||||
다음은 파드 시큐리티 폴리시 어드미션 컨트롤러를 사용하지 않는 것과 동일하게 만들 수 있는
|
||||
최소한의 제한 정책이다.
|
||||
|
||||
{{< codenew file="policy/privileged-psp.yaml" >}}
|
||||
|
||||
다음은 권한이 없는 사용자로서의 실행을 필요로 하고, 루트로의 에스컬레이션(escalation) 가능성을 차단하고,
|
||||
여러 보안 메커니즘을 사용을 필요로 하는 제한적
|
||||
정책의 예제이다.
|
||||
|
||||
{{< codenew file="policy/restricted-psp.yaml" >}}
|
||||
|
||||
## 정책 레퍼런스
|
||||
|
||||
### 특권을 가진
|
||||
|
||||
**Privileged** - 파드의 컨테이너가 특권 모드를 사용할 수 있는지 여부를 결정한다.
|
||||
기본적으로 컨테이너는 호스트의 모든 장치에 접근할 수 없지만
|
||||
"특권을 가진" 컨테이너는 호스트의 모든 장치에 접근할 수 있다. 이것은
|
||||
컨테이너가 호스트에서 실행되는 프로세스와 거의 동일한 접근을 허용한다.
|
||||
이것은 네트워크 스택 조작 및 장치 접근과 같은
|
||||
리눅스 기능을 사용하려는 컨테이너에 유용하다.
|
||||
|
||||
### 호스트 네임스페이스
|
||||
|
||||
**HostPID** - 파드 컨테이너가 호스트 프로세스 ID 네임스페이스를 공유할 수 있는지 여부를
|
||||
제어한다. ptrace와 함께 사용하면 컨테이너 외부로 권한을 에스컬레이션하는 데 사용할 수
|
||||
있다(ptrace는 기본적으로 금지되어 있음).
|
||||
|
||||
**HostIPC** - 파드 컨테이너가 호스트 IPC 네임스페이스를 공유할 수 있는지 여부를
|
||||
제어한다.
|
||||
|
||||
**HostNetwork** - 파드가 노드 네트워크 네임스페이스를 사용할 수 있는지 여부를 제어한다.
|
||||
이렇게 하면 파드에 루프백 장치에 접근 권한을 주고, 서비스는 로컬호스트(localhost)를 리스닝할 수 있으며,
|
||||
동일한 노드에 있는 다른 파드의 네트워크 활동을 스누핑(snoop)하는 데
|
||||
사용할 수 있다.
|
||||
|
||||
**HostPorts** - 호스트 네트워크 네임스페이스에 허용되는 포트 범위의 화이트리스트(whitelist)를
|
||||
제공한다. `min`과 `max`를 포함하여 `HostPortRange`의 목록으로 정의된다.
|
||||
기본값은 허용하는 호스트 포트 없음(no allowed host ports)이다.
|
||||
|
||||
### 볼륨 및 파일시스템
|
||||
|
||||
**Volumes** - 허용되는 볼륨 유형의 화이트리스트를 제공한다. 허용 가능한 값은
|
||||
볼륨을 생성할 때 정의된 볼륨 소스에 따른다. 볼륨 유형의 전체 목록은
|
||||
[볼륨 유형들](/ko/docs/concepts/storage/volumes/#볼륨-유형들)에서 참고한다.
|
||||
또한 `*`를 사용하여 모든 볼륨 유형을
|
||||
허용할 수 있다.
|
||||
|
||||
새 PSP에 허용되는 볼륨의 **최소 권장 셋** 은 다음과 같다.
|
||||
|
||||
- 컨피그맵
|
||||
- 다운워드API
|
||||
- emptyDir
|
||||
- 퍼시스턴트볼륨클레임
|
||||
- 시크릿
|
||||
- 프로젝티드(projected)
|
||||
|
||||
{{< warning >}}
|
||||
파드시큐리티폴리시는 `PersistentVolumeClaim`이 참조할 수 있는 `PersistentVolume`
|
||||
오브젝트의 유형을 제한하지 않으며 hostPath 유형
|
||||
`PersistentVolumes`은 읽기-전용 접근 모드를 지원하지 않는다. 신뢰할 수 있는 사용자만
|
||||
`PersistentVolume` 오브젝트를 생성할 수 있는 권한을 부여 받아야 한다.
|
||||
{{< /warning >}}
|
||||
|
||||
**FSGroup** - 일부 볼륨에 적용되는 보충 그룹(supplemental group)을 제어한다.
|
||||
|
||||
- *MustRunAs* - 하나 이상의 `range`를 지정해야 한다. 첫 번째 범위의 최솟값을
|
||||
기본값으로 사용한다. 모든 범위에 대해 검증한다.
|
||||
- *MayRunAs* - 하나 이상의 `range`를 지정해야 한다. 기본값을 제공하지 않고
|
||||
`FSGroups`을 설정하지 않은 상태로 둘 수 있다. `FSGroups`이 설정된 경우 모든 범위에 대해
|
||||
유효성을 검사한다.
|
||||
- *RunAsAny* - 기본값은 제공되지 않는다. 어떠한 `fsGroup` ID의 지정도 허용한다.
|
||||
|
||||
**AllowedHostPaths** - hostPath 볼륨에서 사용할 수 있는 호스트 경로의 화이트리스트를
|
||||
지정한다. 빈 목록은 사용되는 호스트 경로에 제한이 없음을 의미한다.
|
||||
이는 단일 `pathPrefix` 필드가 있는 오브젝트 목록으로 정의되며, hostPath 볼륨은
|
||||
허용된 접두사로 시작하는 경로를 마운트할 수 있으며 `readOnly` 필드는
|
||||
읽기-전용으로 마운트 되어야 함을 나타낸다.
|
||||
예를 들면 다음과 같습니다.
|
||||
|
||||
```yaml
|
||||
allowedHostPaths:
|
||||
# 이 정책은 "/foo", "/foo/", "/foo/bar" 등을 허용하지만,
|
||||
# "/fool", "/etc/foo" 등은 허용하지 않는다.
|
||||
# "/foo/../" 는 절대 유효하지 않다.
|
||||
- pathPrefix: "/foo"
|
||||
readOnly: true # 읽기 전용 마운트만 허용
|
||||
```
|
||||
|
||||
{{< warning >}}호스트 파일시스템에 제한없는 접근을 부여하며, 컨테이너가 특권을 에스컬레이션
|
||||
(다른 컨테이너들에 있는 데이터를 읽고, 시스템 서비스의 자격 증명을 어뷰징(abusing)하는 등)할
|
||||
수 있도록 만드는 다양한 방법이 있다. 예를 들면, Kubelet과 같다.
|
||||
|
||||
쓰기 가능한 hostPath 디렉토리 볼륨을 사용하면, 컨테이너가 `pathPrefix` 외부의
|
||||
호스트 파일시스템에 대한 통행을 허용하는 방식으로 컨테이너의 파일시스템 쓰기(write)를 허용한다.
|
||||
쿠버네티스 1.11 이상 버전에서 사용 가능한 `readOnly: true`는 지정된 `pathPrefix`에 대한
|
||||
접근을 효과적으로 제한하기 위해 **모든** `allowedHostPaths`에서 사용해야 한다.
|
||||
{{< /warning >}}
|
||||
|
||||
**ReadOnlyRootFilesystem** - 컨테이너는 읽기-전용 루트 파일시스템(즉, 쓰기 가능한 레이어 없음)으로
|
||||
실행해야 한다.
|
||||
|
||||
### FlexVolume 드라이버
|
||||
|
||||
flexvolume에서 사용할 수 있는 FlexVolume 드라이버의 화이트리스트를 지정한다.
|
||||
빈 목록 또는 nil은 드라이버에 제한이 없음을 의미한다.
|
||||
[`volumes`](#볼륨-및-파일시스템) 필드에 `flexVolume` 볼륨 유형이 포함되어
|
||||
있는지 확인한다. 그렇지 않으면 FlexVolume 드라이버가 허용되지 않는다.
|
||||
|
||||
예를 들면 다음과 같다.
|
||||
|
||||
```yaml
|
||||
apiVersion: policy/v1beta1
|
||||
kind: PodSecurityPolicy
|
||||
metadata:
|
||||
name: allow-flex-volumes
|
||||
spec:
|
||||
# ... 다른 스펙 필드
|
||||
volumes:
|
||||
- flexVolume
|
||||
allowedFlexVolumes:
|
||||
- driver: example/lvm
|
||||
- driver: example/cifs
|
||||
```
|
||||
|
||||
### 사용자 및 그룹
|
||||
|
||||
**RunAsUser** - 컨테이너를 실행할 사용자 ID를 제어힌다.
|
||||
|
||||
- *MustRunAs* - 하나 이상의 `range`를 지정해야 한다. 첫 번째 범위의 최솟값을
|
||||
기본값으로 사용한다. 모든 범위에 대해 검증한다.
|
||||
- *MustRunAsNonRoot* - 파드가 0이 아닌 `runAsUser`로 제출되거나
|
||||
이미지에 `USER` 지시문이 정의되어 있어야 한다(숫자 UID 사용). `runAsNonRoot` 또는
|
||||
`runAsUser` 설정을 지정하지 않은 파드는 `runAsNonRoot=true`를 설정하도록
|
||||
변경되므로 컨테이너에 0이 아닌 숫자가 정의된 `USER` 지시문이
|
||||
필요하다. 기본값은 제공되지 않는다.
|
||||
이 전략에서는 `allowPrivilegeEscalation=false`를 설정하는 것이 좋다.
|
||||
- *RunAsAny* - 기본값은 제공되지 않는다. 어떠한 `runAsUser`의 지정도 허용한다.
|
||||
|
||||
**RunAsGroup** - 컨테이너가 실행될 기본 그룹 ID를 제어한다.
|
||||
|
||||
- *MustRunAs* - 하나 이상의 `range`를 지정해야 한다. 첫 번째 범위의 최솟값을
|
||||
기본값으로 사용한다. 모든 범위에 대해 검증한다.
|
||||
- *MayRunAs* - `RunAsGroup`을 지정할 필요가 없다. 그러나 `RunAsGroup`을 지정하면
|
||||
정의된 범위에 속해야 한다.
|
||||
- *RunAsAny* - 기본값은 제공되지 않는다. 어떠한 `runAsGroup`의 지정도 허용한다.
|
||||
|
||||
|
||||
**SupplementalGroups** - 컨테이너가 추가할 그룹 ID를 제어한다.
|
||||
|
||||
- *MustRunAs* - 하나 이상의 `range`를 지정해야 한다. 첫 번째 범위의 최솟값을
|
||||
기본값으로 사용한다. 모든 범위에 대해 검증한다.
|
||||
- *MayRunAs* - 하나 이상의 `range`를 지정해야 한다. `supplementalGroups`에
|
||||
기본값을 제공하지 않고 설정하지 않은 상태로 둘 수 있다.
|
||||
`supplementalGroups`가 설정된 경우 모든 범위에 대해 유효성을 검증한다.
|
||||
- *RunAsAny* - 기본값은 제공되지 않는다. 어떠한 `supplementalGroups`의 지정도
|
||||
허용한다.
|
||||
|
||||
### 권한 에스컬레이션
|
||||
|
||||
이 옵션은 `allowPrivilegeEscalation` 컨테이너 옵션을 제어한다. 이 bool은
|
||||
컨테이너 프로세스에서
|
||||
[`no_new_privs`](https://www.kernel.org/doc/Documentation/prctl/no_new_privs.txt)
|
||||
플래그가 설정되는지 여부를 직접 제어한다. 이 플래그는 `setuid` 바이너리가
|
||||
유효 사용자 ID를 변경하지 못하게 하고 파일에 추가 기능을 활성화하지 못하게
|
||||
한다(예: `ping` 도구 사용을 못하게 함). `MustRunAsNonRoot`를 효과적으로
|
||||
강제하려면 이 동작이 필요하다.
|
||||
|
||||
**AllowPrivilegeEscalation** - 사용자가 컨테이너의 보안 컨텍스트를
|
||||
`allowPrivilegeEscalation=true`로 설정할 수 있는지 여부를 게이트한다.
|
||||
이 기본값은 setuid 바이너리를 중단하지 않도록 허용한다. 이를 `false`로 설정하면
|
||||
컨테이너의 하위 프로세스가 상위 프로세스보다 더 많은 권한을 얻을 수 없다.
|
||||
|
||||
**DefaultAllowPrivilegeEscalation** - `allowPrivilegeEscalation` 옵션의
|
||||
기본값을 설정한다. 이것이 없는 기본 동작은 setuid 바이너리를 중단하지 않도록
|
||||
권한 에스컬레이션을 허용하는 것이다. 해당 동작이 필요하지 않은 경우 이 필드를 사용하여
|
||||
기본적으로 허용하지 않도록 설정할 수 있지만 파드는 여전히 `allowPrivilegeEscalation`을
|
||||
명시적으로 요청할 수 있다.
|
||||
|
||||
### 기능
|
||||
|
||||
리눅스 기능은 전통적으로 슈퍼유저와 관련된 권한을 보다 세밀하게 분류한다.
|
||||
이러한 기능 중 일부는 권한 에스컬레이션 또는 컨테이너 분류에 사용될 수 있으며
|
||||
파드시큐리티폴리시에 의해 제한될 수 있다. 리눅스 기능에 대한 자세한 내용은
|
||||
[기능(7)](http://man7.org/linux/man-pages/man7/capabilities.7.html)을
|
||||
참고하길 바란다.
|
||||
|
||||
다음 필드는 대문자로 표기된 기능 이름 목록을
|
||||
`CAP_` 접두사 없이 가져온다.
|
||||
|
||||
**AllowedCapabilities** - 컨테이너에 추가될 수 있는 기능의 화이트리스트를
|
||||
제공한다. 기본적인 기능 셋은 암시적으로 허용된다. 비어있는 셋은
|
||||
기본 셋을 넘어서는 추가 기능이 추가되지 않는 것을
|
||||
의미한다. `*`는 모든 기능을 허용하는 데 사용할 수 있다.
|
||||
|
||||
**RequiredDropCapabilities** - 컨테이너에서 삭제해야 하는 기능이다.
|
||||
이러한 기능은 기본 셋에서 제거되며 추가해서는 안된다.
|
||||
`RequiredDropCapabilities`에 나열된 기능은 `AllowedCapabilities` 또는
|
||||
`DefaultAddCapabilities`에 포함되지 않아야 한다.
|
||||
|
||||
**DefaultAddCapabilities** - 런타임 기본값 외에 기본적으로 컨테이너에 추가되는 기능이다.
|
||||
도커 런타임을 사용할 때 기본 기능 목록은
|
||||
[도커 문서](https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities)를
|
||||
참고하길 바란다.
|
||||
|
||||
### SELinux
|
||||
|
||||
- *MustRunAs* - `seLinuxOptions`을 구성해야 한다.
|
||||
`seLinuxOptions`을 기본값으로 사용한다. `seLinuxOptions`에 대해 유효성을 검사한다.
|
||||
- *RunAsAny* - 기본값은 제공되지 않는다. 어떠한 `seLinuxOptions`의 지정도
|
||||
허용한다.
|
||||
|
||||
### AllowedProcMountTypes
|
||||
|
||||
`allowedProcMountTypes`는 허용된 ProcMountTypes의 화이트리스트이다.
|
||||
비어 있거나 nil은 `DefaultProcMountType`만 사용할 수 있음을 나타낸다.
|
||||
|
||||
`DefaultProcMount`는 /proc의 읽기 전용 및 마스킹(masking)된 경로에 컨테이너 런타임
|
||||
기본값을 사용한다. 대부분의 컨테이너 런타임은 특수 장치나 정보가 실수로 보안에
|
||||
노출되지 않도록 /proc의 특정 경로를 마스킹한다. 이것은 문자열
|
||||
`Default`로 표시된다.
|
||||
|
||||
유일하게 다른 ProcMountType은 `UnmaskedProcMount`로, 컨테이너 런타임의
|
||||
기본 마스킹 동작을 무시하고 새로 작성된 /proc 컨테이너가 수정없이
|
||||
그대로 유지되도록 한다. 이 문자열은
|
||||
`Unmasked`로 표시된다.
|
||||
|
||||
### AppArmor
|
||||
|
||||
파드시큐리티폴리시의 어노테이션을 통해 제어된다. [AppArmor
|
||||
문서](/docs/tutorials/clusters/apparmor/#podsecuritypolicy-annotations)를 참고하길 바란다.
|
||||
|
||||
### Seccomp
|
||||
|
||||
파드에서 seccomp 프로파일의 사용은 파드시큐리티폴리시의 어노테이션을 통해
|
||||
제어할 수 있다. Seccomp는 쿠버네티스의 알파 기능이다.
|
||||
|
||||
**seccomp.security.alpha.kubernetes.io/defaultProfileName** - 컨테이너에
|
||||
적용할 기본 seccomp 프로파일을 지정하는 어노테이션이다. 가능한 값은
|
||||
다음과 같다.
|
||||
|
||||
- `unconfined` - 대안이 제공되지 않으면 Seccomp가 컨테이너 프로세스에 적용되지
|
||||
않는다(쿠버네티스의 기본값임).
|
||||
- `runtime/default` - 기본 컨테이너 런타임 프로파일이 사용된다.
|
||||
- `docker/default` - 도커 기본 seccomp 프로파일이 사용된다. 쿠버네티스 1.11 부터 사용 중단(deprecated)
|
||||
되었다. 대신 `runtime/default` 사용을 권장한다.
|
||||
- `localhost/<path>` - `<seccomp_root>/<path>`에 있는 노드에서 파일을 프로파일로
|
||||
지정한다. 여기서 `<seccomp_root>`는 Kubelet의 `--seccomp-profile-root` 플래그를
|
||||
통해 정의된다.
|
||||
|
||||
**seccomp.security.alpha.kubernetes.io/allowedProfileNames** - 파드 seccomp
|
||||
어노테이션에 허용되는 값을 지정하는 어노테이션. 쉼표로 구분된
|
||||
허용된 값의 목록으로 지정된다. 가능한 값은 위에 나열된 값과
|
||||
모든 프로파일을 허용하는 `*` 이다.
|
||||
이 주석이 없으면 기본값을 변경할 수 없다.
|
||||
|
||||
### Sysctl
|
||||
|
||||
기본적으로 모든 안전한 sysctls가 허용된다.
|
||||
|
||||
- `forbiddenSysctls` - 특정 sysctls를 제외한다. 목록에서 안전한 것과 안전하지 않은 sysctls의 조합을 금지할 수 있다. 모든 sysctls 설정을 금지하려면 자체적으로 `*`를 사용한다.
|
||||
- `allowedUnsafeSysctls` - `forbiddenSysctls`에 나열되지 않는 한 기본 목록에서 허용하지 않은 특정 sysctls를 허용한다.
|
||||
|
||||
[Sysctl 문서](
|
||||
/docs/concepts/cluster-administration/sysctl-cluster/#podsecuritypolicy)를 참고하길 바란다.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture whatsnext %}}
|
||||
|
||||
API 세부 정보는 [파드 시큐리티 폴리시 레퍼런스](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#podsecuritypolicy-v1beta1-policy) 참조
|
||||
|
||||
{{% /capture %}}
|
||||
|
|
@ -0,0 +1,600 @@
|
|||
---
|
||||
title: 리소스 쿼터
|
||||
content_template: templates/concept
|
||||
weight: 10
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
|
||||
여러 사용자나 팀이 정해진 수의 노드로 클러스터를 공유할 때
|
||||
한 팀이 공정하게 분배된 리소스보다 많은 리소스를 사용할 수 있다는 우려가 있다.
|
||||
|
||||
리소스 쿼터는 관리자가 이 문제를 해결하기 위한 도구이다.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
||||
{{% capture body %}}
|
||||
|
||||
`ResourceQuota` 오브젝트로 정의된 리소스 쿼터는 네임스페이스별 총 리소스 사용을 제한하는
|
||||
제약 조건을 제공한다. 유형별로 네임스페이스에서 만들 수 있는 오브젝트 수와
|
||||
해당 프로젝트의 리소스가 사용할 수 있는 총 컴퓨트 리소스의 양을
|
||||
제한할 수 있다.
|
||||
|
||||
리소스 쿼터는 다음과 같이 작동한다.
|
||||
|
||||
- 다른 팀은 다른 네임스페이스에서 작동한다. 현재 이것은 자발적이지만 ACL을 통해 이 필수 사항을
|
||||
적용하기 위한 지원이 계획되어 있다.
|
||||
- 관리자는 각 네임스페이스에 대해 하나의 `ResourceQuota`를 생성한다.
|
||||
- 사용자는 네임스페이스에서 리소스(파드, 서비스 등)를 생성하고 쿼터 시스템은
|
||||
사용량을 추적하여 `ResourceQuota`에 정의된 하드(hard) 리소스 제한을 초과하지 않도록 한다.
|
||||
- 리소스를 생성하거나 업데이트할 때 쿼터 제약 조건을 위반하면 위반된 제약 조건을 설명하는
|
||||
메시지와 함께 HTTP 상태 코드 `403 FORBIDDEN`으로 요청이 실패한다.
|
||||
- `cpu`, `memory`와 같은 컴퓨트 리소스에 대해 네임스페이스에서 쿼터가 활성화된 경우
|
||||
사용자는 해당값에 대한 요청 또는 제한을 지정해야 한다. 그렇지 않으면 쿼터 시스템이
|
||||
파드 생성을 거부할 수 있다. 힌트: 컴퓨트 리소스 요구 사항이 없는 파드를 기본값으로 설정하려면 `LimitRanger` 어드미션 컨트롤러를 사용하자.
|
||||
이 문제를 회피하는 방법에 대한 예제는 [연습](/docs/tasks/administer-cluster/quota-memory-cpu-namespace/)을 참고하길 바란다.
|
||||
|
||||
`ResourceQuota` 오브젝트의 이름은 유효한
|
||||
[DNS 서브도메인 이름](/ko/docs/concepts/overview/working-with-objects/names#dns-서브도메인-이름)이어야 한다.
|
||||
|
||||
네임스페이스와 쿼터를 사용하여 만들 수 있는 정책의 예는 다음과 같다.
|
||||
|
||||
- 용량이 32GiB RAM, 16 코어인 클러스터에서 A 팀이 20GiB 및 10 코어를 사용하고
|
||||
B 팀은 10GiB 및 4 코어를 사용하게 하고 2GiB 및 2 코어를 향후 할당을 위해 보유하도록 한다.
|
||||
- "testing" 네임스페이스를 1 코어 및 1GiB RAM을 사용하도록 제한한다.
|
||||
"production" 네임스페이스에는 원하는 양을 사용하도록 한다.
|
||||
|
||||
클러스터의 총 용량이 네임스페이스의 쿼터 합보다 작은 경우 리소스에 대한 경합이 있을 수 있다.
|
||||
이것은 선착순으로 처리된다.
|
||||
|
||||
경합이나 쿼터 변경은 이미 생성된 리소스에 영향을 미치지 않는다.
|
||||
|
||||
## 리소스 쿼터 활성화
|
||||
|
||||
많은 쿠버네티스 배포판에 기본적으로 리소스 쿼터 지원이 활성화되어 있다.
|
||||
API 서버 `--enable-admission-plugins=` 플래그의 인수 중 하나로
|
||||
`ResourceQuota`가 있는 경우 활성화된다.
|
||||
|
||||
해당 네임스페이스에 `ResourceQuota`가 있는 경우 특정 네임스페이스에 리소스 쿼터가 적용된다.
|
||||
|
||||
## 컴퓨트 리소스 쿼터
|
||||
|
||||
지정된 네임스페이스에서 요청할 수 있는 총 [컴퓨트 리소스](/docs/user-guide/compute-resources) 합을 제한할 수 있다.
|
||||
|
||||
다음과 같은 리소스 유형이 지원된다.
|
||||
|
||||
| 리소스 이름 | 설명 |
|
||||
| --------------------- | ----------------------------------------------------------- |
|
||||
| `limits.cpu` | 터미널이 아닌 상태의 모든 파드에서 CPU 제한의 합은 이 값을 초과할 수 없음 |
|
||||
| `limits.memory` | 터미널이 아닌 상태의 모든 파드에서 메모리 제한의 합은 이 값을 초과할 수 없음 |
|
||||
| `requests.cpu` | 터미널이 아닌 상태의 모든 파드에서 CPU 요청의 합은 이 값을 초과할 수 없음 |
|
||||
| `requests.memory` | 터미널이 아닌 상태의 모든 파드에서 메모리 요청의 합은 이 값을 초과할 수 없음 |
|
||||
|
||||
### 확장된 리소스에 대한 리소스 쿼터
|
||||
|
||||
위에서 언급한 리소스 외에도 릴리스 1.10에서는
|
||||
[확장된 리소스](/docs/concepts/configuration/manage-compute-resources-container/#extended-resources)에 대한 쿼터 지원이 추가되었다.
|
||||
|
||||
확장된 리소스에는 오버커밋(overcommit)이 허용되지 않으므로 하나의 쿼터에서
|
||||
동일한 확장된 리소스에 대한 `requests`와 `limits`을 모두 지정하는 것은 의미가 없다. 따라서 확장된
|
||||
리소스의 경우 지금은 접두사 `requests.`이 있는 쿼터 항목만 허용된다.
|
||||
|
||||
예를 들어, 리소스 이름이 `nvidia.com/gpu`이고 네임스페이스에서 요청된 총 GPU 수를 4개로 제한하려는 경우,
|
||||
GPU 리소스를 다음과 같이 쿼터를 정의할 수 있다.
|
||||
|
||||
* `requests.nvidia.com/gpu: 4`
|
||||
|
||||
자세한 내용은 [쿼터 보기 및 설정](#쿼터-보기-및-설정)을 참고하길 바란다.
|
||||
|
||||
|
||||
## 스토리지 리소스 쿼터
|
||||
|
||||
지정된 네임스페이스에서 요청할 수 있는 총 [스토리지 리소스](/ko/docs/concepts/storage/persistent-volumes/) 합을 제한할 수 있다.
|
||||
|
||||
또한 연관된 스토리지 클래스를 기반으로 스토리지 리소스 사용을 제한할 수 있다.
|
||||
|
||||
| 리소스 이름 | 설명 |
|
||||
| --------------------- | ----------------------------------------------------------- |
|
||||
| `requests.storage` | 모든 퍼시스턴트 볼륨 클레임에서 스토리지 요청의 합은 이 값을 초과할 수 없음 |
|
||||
| `persistentvolumeclaims` | 네임스페이스에 존재할 수 있는 총 [퍼시스턴트 볼륨 클레임](/ko/docs/concepts/storage/persistent-volumes/#퍼시스턴트볼륨클레임) 수 |
|
||||
| `<storage-class-name>.storageclass.storage.k8s.io/requests.storage` | storage-class-name과 관련된 모든 퍼시스턴트 볼륨 클레임에서 스토리지 요청의 합은 이 값을 초과할 수 없음 |
|
||||
| `<storage-class-name>.storageclass.storage.k8s.io/persistentvolumeclaims` | storage-class-name과 관련된 모든 퍼시스턴트 볼륨 클레임에서 네임스페이스에 존재할 수 있는 총 [퍼시스턴트 볼륨 클레임](/ko/docs/concepts/storage/persistent-volumes/#퍼시스턴트볼륨클레임) 수 |
|
||||
|
||||
예를 들어, 운영자가 `bronze` 스토리지 클래스와 별도로 `gold` 스토리지 클래스를 사용하여 스토리지에 쿼터를 지정하려는 경우 운영자는 다음과 같이
|
||||
쿼터를 정의할 수 있다.
|
||||
|
||||
* `gold.storageclass.storage.k8s.io/requests.storage: 500Gi`
|
||||
* `bronze.storageclass.storage.k8s.io/requests.storage: 100Gi`
|
||||
|
||||
릴리스 1.8에서는 로컬 임시 스토리지에 대한 쿼터 지원이 알파 기능으로 추가되었다.
|
||||
|
||||
| 리소스 이름 | 설명 |
|
||||
| ------------------------------- |----------------------------------------------------------- |
|
||||
| `requests.ephemeral-storage` | 네임스페이스의 모든 파드에서 로컬 임시 스토리지 요청의 합은 이 값을 초과할 수 없음 |
|
||||
| `limits.ephemeral-storage` | 네임스페이스의 모든 파드에서 로컬 임시 스토리지 제한의 합은 이 값을 초과할 수 없음 |
|
||||
|
||||
## 오브젝트 수 쿼터
|
||||
|
||||
1.9 릴리스는 다음 구문을 사용하여 모든 표준 네임스페이스 리소스 유형에 쿼터를 지정하는 지원을 추가했다.
|
||||
|
||||
* `count/<resource>.<group>`
|
||||
|
||||
다음은 사용자가 오브젝트 수 쿼터 아래에 배치하려는 리소스 셋의 예이다.
|
||||
|
||||
* `count/persistentvolumeclaims`
|
||||
* `count/services`
|
||||
* `count/secrets`
|
||||
* `count/configmaps`
|
||||
* `count/replicationcontrollers`
|
||||
* `count/deployments.apps`
|
||||
* `count/replicasets.apps`
|
||||
* `count/statefulsets.apps`
|
||||
* `count/jobs.batch`
|
||||
* `count/cronjobs.batch`
|
||||
* `count/deployments.extensions`
|
||||
|
||||
1.15 릴리스는 동일한 구문을 사용하여 사용자 정의 리소스에 대한 지원을 추가했다.
|
||||
예를 들어 `example.com` API 그룹에서 `widgets` 사용자 정의 리소스에 대한 쿼터를 생성하려면 `count/widgets.example.com`을 사용한다.
|
||||
|
||||
`count/*` 리소스 쿼터를 사용할 때 서버 스토리지 영역에 있다면 오브젝트는 쿼터에 대해 과금된다.
|
||||
이러한 유형의 쿼터는 스토리지 리소스 고갈을 방지하는 데 유용하다. 예를 들어,
|
||||
크기가 큰 서버에서 시크릿 수에 쿼터를 지정할 수 있다. 클러스터에 시크릿이 너무 많으면 실제로 서버와
|
||||
컨트롤러가 시작되지 않을 수 있다! 네임스페이스에 너무 많은 작업을 생성하는
|
||||
잘못 구성된 크론 잡으로 인해 서비스 거부를 유발하는 것으로부터 보호하기 위해 작업의 쿼터를 지정하도록 선택할 수 있다.
|
||||
|
||||
1.9 릴리스 이전에는 제한된 리소스 셋에서 일반 오브젝트 수 쿼터를 적용할 수 있었다.
|
||||
또한, 특정 리소스에 대한 쿼터를 유형별로 추가로 제한할 수 있다.
|
||||
|
||||
다음 유형이 지원된다.
|
||||
|
||||
| 리소스 이름 | 설명 |
|
||||
| ------------------------------- | ------------------------------------------------- |
|
||||
| `configmaps` | 네임스페이스에 존재할 수 있는 총 구성 맵 수 |
|
||||
| `persistentvolumeclaims` | 네임스페이스에 존재할 수 있는 총 [퍼시스턴트 볼륨 클레임](/ko/docs/concepts/storage/persistent-volumes/#퍼시스턴트볼륨클레임) 수 |
|
||||
| `pods` | 네임스페이스에 존재할 수 있는 터미널이 아닌 상태의 파드의 총 수. `.status.phase in (Failed, Succeeded)`가 true인 경우 파드는 터미널 상태임 |
|
||||
| `replicationcontrollers` | 네임스페이스에 존재할 수 있는 총 레플리케이션 컨트롤러 수 |
|
||||
| `resourcequotas` | 네임스페이스에 존재할 수 있는 총 [리소스 쿼터](/docs/reference/access-authn-authz/admission-controllers/#resourcequota) 수 |
|
||||
| `services` | 네임스페이스에 존재할 수 있는 총 서비스 수 |
|
||||
| `services.loadbalancers` | 네임스페이스에 존재할 수 있는 로드 밸런서 유형의 총 서비스 수 |
|
||||
| `services.nodeports` | 네임스페이스에 존재할 수 있는 노드 포트 유형의 총 서비스 수 |
|
||||
| `secrets` | 네임스페이스에 존재할 수 있는 총 시크릿 수 |
|
||||
|
||||
예를 들어, `pods` 쿼터는 터미널이 아닌 단일 네임스페이스에서 생성된 `pods` 수를 계산하고 최대값을 적용한다.
|
||||
사용자가 작은 파드를 많이 생성하여 클러스터의 파드 IP 공급이 고갈되는 경우를 피하기 위해
|
||||
네임스페이스에 `pods` 쿼터를 설정할 수 있다.
|
||||
|
||||
## 쿼터 범위
|
||||
|
||||
각 쿼터에는 연결된 범위 셋이 있을 수 있다. 쿼터는 열거된 범위의 교차 부분과 일치하는 경우에만
|
||||
리소스 사용량을 측정한다.
|
||||
|
||||
범위가 쿼터에 추가되면 해당 범위와 관련된 리소스를 지원하는 리소스 수가 제한된다.
|
||||
허용된 셋 이외의 쿼터에 지정된 리소스는 유효성 검사 오류가 발생한다.
|
||||
|
||||
| 범위 | 설명 |
|
||||
| ----- | ----------- |
|
||||
| `Terminating` | `.spec.activeDeadlineSeconds >= 0`에 일치하는 파드 |
|
||||
| `NotTerminating` | `.spec.activeDeadlineSeconds is nil`에 일치하는 파드 |
|
||||
| `BestEffort` | 최상의 서비스 품질을 제공하는 파드 |
|
||||
| `NotBestEffort` | 서비스 품질이 나쁜 파드 |
|
||||
|
||||
`BestEffort` 범위는 다음의 리소스(파드)를 추적하도록 쿼터를 제한한다.
|
||||
|
||||
`Terminating`, `NotTerminating` 및 `NotBestEffort` 범위는 쿼터를 제한하여 다음의 리소스를 추적한다.
|
||||
|
||||
* `cpu`
|
||||
* `limits.cpu`
|
||||
* `limits.memory`
|
||||
* `memory`
|
||||
* `pods`
|
||||
* `requests.cpu`
|
||||
* `requests.memory`
|
||||
|
||||
### PriorityClass별 리소스 쿼터
|
||||
|
||||
{{< feature-state for_k8s_version="1.12" state="beta" >}}
|
||||
|
||||
특정 [우선 순위](/docs/concepts/configuration/pod-priority-preemption/#pod-priority)로 파드를 생성할 수 있다.
|
||||
쿼터 스펙의 `scopeSelector` 필드를 사용하여 파드의 우선 순위에 따라 파드의 시스템 리소스 사용을
|
||||
제어할 수 있다.
|
||||
|
||||
쿼터 스펙의 `scopeSelector`가 파드를 선택한 경우에만 쿼터가 일치하고 사용된다.
|
||||
|
||||
이 예에서는 쿼터 오브젝트를 생성하여 특정 우선 순위의 파드와 일치시킨다.
|
||||
예제는 다음과 같이 작동한다.
|
||||
|
||||
- 클러스터의 파드는 "low(낮음)", "medium(중간)", "high(높음)"의 세 가지 우선 순위 클래스 중 하나를 가진다.
|
||||
- 각 우선 순위마다 하나의 쿼터 오브젝트가 생성된다.
|
||||
|
||||
다음 YAML을 `quota.yml` 파일에 저장한다.
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: List
|
||||
items:
|
||||
- apiVersion: v1
|
||||
kind: ResourceQuota
|
||||
metadata:
|
||||
name: pods-high
|
||||
spec:
|
||||
hard:
|
||||
cpu: "1000"
|
||||
memory: 200Gi
|
||||
pods: "10"
|
||||
scopeSelector:
|
||||
matchExpressions:
|
||||
- operator : In
|
||||
scopeName: PriorityClass
|
||||
values: ["high"]
|
||||
- apiVersion: v1
|
||||
kind: ResourceQuota
|
||||
metadata:
|
||||
name: pods-medium
|
||||
spec:
|
||||
hard:
|
||||
cpu: "10"
|
||||
memory: 20Gi
|
||||
pods: "10"
|
||||
scopeSelector:
|
||||
matchExpressions:
|
||||
- operator : In
|
||||
scopeName: PriorityClass
|
||||
values: ["medium"]
|
||||
- apiVersion: v1
|
||||
kind: ResourceQuota
|
||||
metadata:
|
||||
name: pods-low
|
||||
spec:
|
||||
hard:
|
||||
cpu: "5"
|
||||
memory: 10Gi
|
||||
pods: "10"
|
||||
scopeSelector:
|
||||
matchExpressions:
|
||||
- operator : In
|
||||
scopeName: PriorityClass
|
||||
values: ["low"]
|
||||
```
|
||||
|
||||
`kubectl create`를 사용하여 YAML을 적용한다.
|
||||
|
||||
```shell
|
||||
kubectl create -f ./quota.yml
|
||||
```
|
||||
|
||||
```shell
|
||||
resourcequota/pods-high created
|
||||
resourcequota/pods-medium created
|
||||
resourcequota/pods-low created
|
||||
```
|
||||
|
||||
`kubectl describe quota`를 사용하여 `Used` 쿼터가 `0`인지 확인하자.
|
||||
|
||||
```shell
|
||||
kubectl describe quota
|
||||
```
|
||||
|
||||
```shell
|
||||
Name: pods-high
|
||||
Namespace: default
|
||||
Resource Used Hard
|
||||
-------- ---- ----
|
||||
cpu 0 1k
|
||||
memory 0 200Gi
|
||||
pods 0 10
|
||||
|
||||
|
||||
Name: pods-low
|
||||
Namespace: default
|
||||
Resource Used Hard
|
||||
-------- ---- ----
|
||||
cpu 0 5
|
||||
memory 0 10Gi
|
||||
pods 0 10
|
||||
|
||||
|
||||
Name: pods-medium
|
||||
Namespace: default
|
||||
Resource Used Hard
|
||||
-------- ---- ----
|
||||
cpu 0 10
|
||||
memory 0 20Gi
|
||||
pods 0 10
|
||||
```
|
||||
|
||||
우선 순위가 "high"인 파드를 생성한다. 다음 YAML을
|
||||
`high-priority-pod.yml` 파일에 저장한다.
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: high-priority
|
||||
spec:
|
||||
containers:
|
||||
- name: high-priority
|
||||
image: ubuntu
|
||||
command: ["/bin/sh"]
|
||||
args: ["-c", "while true; do echo hello; sleep 10;done"]
|
||||
resources:
|
||||
requests:
|
||||
memory: "10Gi"
|
||||
cpu: "500m"
|
||||
limits:
|
||||
memory: "10Gi"
|
||||
cpu: "500m"
|
||||
priorityClassName: high
|
||||
```
|
||||
|
||||
`kubectl create`로 적용하자.
|
||||
|
||||
```shell
|
||||
kubectl create -f ./high-priority-pod.yml
|
||||
```
|
||||
|
||||
"high" 우선 순위 쿼터가 적용된 `pods-high`에 대한 "Used" 통계가 변경되었고
|
||||
다른 두 쿼터는 변경되지 않았는지 확인한다.
|
||||
|
||||
```shell
|
||||
kubectl describe quota
|
||||
```
|
||||
|
||||
```shell
|
||||
Name: pods-high
|
||||
Namespace: default
|
||||
Resource Used Hard
|
||||
-------- ---- ----
|
||||
cpu 500m 1k
|
||||
memory 10Gi 200Gi
|
||||
pods 1 10
|
||||
|
||||
|
||||
Name: pods-low
|
||||
Namespace: default
|
||||
Resource Used Hard
|
||||
-------- ---- ----
|
||||
cpu 0 5
|
||||
memory 0 10Gi
|
||||
pods 0 10
|
||||
|
||||
|
||||
Name: pods-medium
|
||||
Namespace: default
|
||||
Resource Used Hard
|
||||
-------- ---- ----
|
||||
cpu 0 10
|
||||
memory 0 20Gi
|
||||
pods 0 10
|
||||
```
|
||||
|
||||
`scopeSelector`는 `operator` 필드에서 다음 값을 지원한다.
|
||||
|
||||
* `In`
|
||||
* `NotIn`
|
||||
* `Exist`
|
||||
* `DoesNotExist`
|
||||
|
||||
## 요청과 제한의 비교 {#requests-vs-limits}
|
||||
|
||||
컴퓨트 리소스를 할당할 때 각 컨테이너는 CPU 또는 메모리에 대한 요청과 제한값을 지정할 수 있다.
|
||||
쿼터는 값에 대한 쿼터를 지정하도록 구성할 수 있다.
|
||||
|
||||
쿼터에 `requests.cpu`나 `requests.memory`에 지정된 값이 있으면 들어오는 모든
|
||||
컨테이너가 해당 리소스에 대한 명시적인 요청을 지정해야 한다. 쿼터에 `limits.cpu`나
|
||||
`limits.memory`에 지정된 값이 있으면 들어오는 모든 컨테이너가 해당 리소스에 대한 명시적인 제한을 지정해야 한다.
|
||||
|
||||
## 쿼터 보기 및 설정
|
||||
|
||||
Kubectl은 쿼터 생성, 업데이트 및 보기를 지원한다.
|
||||
|
||||
```shell
|
||||
kubectl create namespace myspace
|
||||
```
|
||||
|
||||
```shell
|
||||
cat <<EOF > compute-resources.yaml
|
||||
apiVersion: v1
|
||||
kind: ResourceQuota
|
||||
metadata:
|
||||
name: compute-resources
|
||||
spec:
|
||||
hard:
|
||||
requests.cpu: "1"
|
||||
requests.memory: 1Gi
|
||||
limits.cpu: "2"
|
||||
limits.memory: 2Gi
|
||||
requests.nvidia.com/gpu: 4
|
||||
EOF
|
||||
```
|
||||
|
||||
```shell
|
||||
kubectl create -f ./compute-resources.yaml --namespace=myspace
|
||||
```
|
||||
|
||||
```shell
|
||||
cat <<EOF > object-counts.yaml
|
||||
apiVersion: v1
|
||||
kind: ResourceQuota
|
||||
metadata:
|
||||
name: object-counts
|
||||
spec:
|
||||
hard:
|
||||
configmaps: "10"
|
||||
persistentvolumeclaims: "4"
|
||||
pods: "4"
|
||||
replicationcontrollers: "20"
|
||||
secrets: "10"
|
||||
services: "10"
|
||||
services.loadbalancers: "2"
|
||||
EOF
|
||||
```
|
||||
|
||||
```shell
|
||||
kubectl create -f ./object-counts.yaml --namespace=myspace
|
||||
```
|
||||
|
||||
```shell
|
||||
kubectl get quota --namespace=myspace
|
||||
```
|
||||
|
||||
```shell
|
||||
NAME AGE
|
||||
compute-resources 30s
|
||||
object-counts 32s
|
||||
```
|
||||
|
||||
```shell
|
||||
kubectl describe quota compute-resources --namespace=myspace
|
||||
```
|
||||
|
||||
```shell
|
||||
Name: compute-resources
|
||||
Namespace: myspace
|
||||
Resource Used Hard
|
||||
-------- ---- ----
|
||||
limits.cpu 0 2
|
||||
limits.memory 0 2Gi
|
||||
requests.cpu 0 1
|
||||
requests.memory 0 1Gi
|
||||
requests.nvidia.com/gpu 0 4
|
||||
```
|
||||
|
||||
```shell
|
||||
kubectl describe quota object-counts --namespace=myspace
|
||||
```
|
||||
|
||||
```shell
|
||||
Name: object-counts
|
||||
Namespace: myspace
|
||||
Resource Used Hard
|
||||
-------- ---- ----
|
||||
configmaps 0 10
|
||||
persistentvolumeclaims 0 4
|
||||
pods 0 4
|
||||
replicationcontrollers 0 20
|
||||
secrets 1 10
|
||||
services 0 10
|
||||
services.loadbalancers 0 2
|
||||
```
|
||||
|
||||
Kubectl은 `count/<resource>.<group>` 구문을 사용하여 모든 표준 네임스페이스 리소스에 대한
|
||||
오브젝트 수 쿼터를 지원한다.
|
||||
|
||||
```shell
|
||||
kubectl create namespace myspace
|
||||
```
|
||||
|
||||
```shell
|
||||
kubectl create quota test --hard=count/deployments.extensions=2,count/replicasets.extensions=4,count/pods=3,count/secrets=4 --namespace=myspace
|
||||
```
|
||||
|
||||
```shell
|
||||
kubectl run nginx --image=nginx --replicas=2 --namespace=myspace
|
||||
```
|
||||
|
||||
```shell
|
||||
kubectl describe quota --namespace=myspace
|
||||
```
|
||||
|
||||
```shell
|
||||
Name: test
|
||||
Namespace: myspace
|
||||
Resource Used Hard
|
||||
-------- ---- ----
|
||||
count/deployments.extensions 1 2
|
||||
count/pods 2 3
|
||||
count/replicasets.extensions 1 4
|
||||
count/secrets 1 4
|
||||
```
|
||||
|
||||
## 쿼터 및 클러스터 용량
|
||||
|
||||
`ResourceQuotas`는 클러스터 용량과 무관하다. 그것들은 절대 단위로 표현된다.
|
||||
따라서 클러스터에 노드를 추가해도 각 네임스페이스에 더 많은 리소스를
|
||||
사용할 수 있는 기능이 자동으로 부여되지는 *않는다*.
|
||||
|
||||
가끔 다음과 같은 보다 복잡한 정책이 필요할 수 있다.
|
||||
|
||||
- 여러 팀으로 전체 클러스터 리소스를 비례적으로 나눈다.
|
||||
- 각 테넌트가 필요에 따라 리소스 사용량을 늘릴 수 있지만, 실수로 리소스가 고갈되는 것을
|
||||
막기 위한 충분한 제한이 있다.
|
||||
- 하나의 네임스페이스에서 요구를 감지하고 노드를 추가하며 쿼터를 늘린다.
|
||||
|
||||
이러한 정책은 쿼터 사용을 감시하고 다른 신호에 따라 각 네임스페이스의 쿼터 하드 제한을
|
||||
조정하는 "컨트롤러"를 작성하여 `ResourceQuotas`를 구성 요소로
|
||||
사용하여 구현할 수 있다.
|
||||
|
||||
리소스 쿼터는 통합된 클러스터 리소스를 분할하지만 노드에 대한 제한은 없다.
|
||||
여러 네임스페이스의 파드가 동일한 노드에서 실행될 수 있다.
|
||||
|
||||
## 기본적으로 우선 순위 클래스 소비 제한
|
||||
|
||||
파드가 특정 우선 순위, 예를 들어 일치하는 쿼터 오브젝트가 존재하는 경우에만 "cluster-services"가 네임스페이스에 허용되어야 힌다.
|
||||
|
||||
이 메커니즘을 통해 운영자는 특정 우선 순위가 높은 클래스의 사용을 제한된 수의 네임스페이스로 제한할 수 있으며 모든 네임스페이스가 기본적으로 이러한 우선 순위 클래스를 사용할 수 있는 것은 아니다.
|
||||
|
||||
이를 적용하려면 kube-apiserver 플래그 `--admission-control-config-file`을 사용하여 다음 구성 파일의 경로를 전달해야 한다.
|
||||
|
||||
{{< tabs name="example1" >}}
|
||||
{{% tab name="apiserver.config.k8s.io/v1" %}}
|
||||
```yaml
|
||||
apiVersion: apiserver.config.k8s.io/v1
|
||||
kind: AdmissionConfiguration
|
||||
plugins:
|
||||
- name: "ResourceQuota"
|
||||
configuration:
|
||||
apiVersion: apiserver.config.k8s.io/v1
|
||||
kind: ResourceQuotaConfiguration
|
||||
limitedResources:
|
||||
- resource: pods
|
||||
matchScopes:
|
||||
- scopeName: PriorityClass
|
||||
operator: In
|
||||
values: ["cluster-services"]
|
||||
```
|
||||
{{% /tab %}}
|
||||
{{% tab name="apiserver.k8s.io/v1alpha1" %}}
|
||||
```yaml
|
||||
# Deprecated in v1.17 in favor of apiserver.config.k8s.io/v1
|
||||
apiVersion: apiserver.k8s.io/v1alpha1
|
||||
kind: AdmissionConfiguration
|
||||
plugins:
|
||||
- name: "ResourceQuota"
|
||||
configuration:
|
||||
# Deprecated in v1.17 in favor of apiserver.config.k8s.io/v1, ResourceQuotaConfiguration
|
||||
apiVersion: resourcequota.admission.k8s.io/v1beta1
|
||||
kind: Configuration
|
||||
limitedResources:
|
||||
- resource: pods
|
||||
matchScopes:
|
||||
- scopeName: PriorityClass
|
||||
operator: In
|
||||
values: ["cluster-services"]
|
||||
```
|
||||
{{% /tab %}}
|
||||
{{< /tabs >}}
|
||||
|
||||
이제 "cluster-services" 파드는 `scopeSelector`와 일치하는 쿼터 오브젝트가 있는 네임스페이스에서만 허용된다.
|
||||
예를 들면 다음과 같다.
|
||||
```yaml
|
||||
scopeSelector:
|
||||
matchExpressions:
|
||||
- scopeName: PriorityClass
|
||||
operator: In
|
||||
values: ["cluster-services"]
|
||||
```
|
||||
|
||||
자세한 내용은 [LimitedResources](https://github.com/kubernetes/kubernetes/pull/36765)와 [우선 순위 클래스에 대한 쿼터 지원 디자인 문서](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/scheduling/pod-priority-resourcequota.md)를 참고하길 바란다.
|
||||
|
||||
## 예제
|
||||
|
||||
[리소스 쿼터를 사용하는 방법에 대한 자세한 예](/docs/tasks/administer-cluster/quota-api-object/)를 참고하길 바란다.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture whatsnext %}}
|
||||
|
||||
자세한 내용은 [리소스쿼터 디자인 문서](https://git.k8s.io/community/contributors/design-proposals/resource-management/admission_control_resource_quota.md)를 참고하길 바란다.
|
||||
|
||||
{{% /capture %}}
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
---
|
||||
title: 쿠버네티스 스케줄러
|
||||
content_template: templates/concept
|
||||
weight: 50
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
|
||||
쿠버네티스에서 _스케줄링_ 은 {{< glossary_tooltip term_id="kubelet" >}}이
|
||||
파드를 실행할 수 있도록 {{< glossary_tooltip text="파드" term_id="pod" >}}가
|
||||
{{< glossary_tooltip text="노드" term_id="node" >}}에 적합한지 확인하는 것을 말한다.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture body %}}
|
||||
|
||||
## 스케줄링 개요 {#scheduling}
|
||||
|
||||
스케줄러는 노드가 할당되지 않은 새로 생성된 파드를 감시한다.
|
||||
스케줄러가 발견한 모든 파드에 대해 스케줄러는 해당 파드가 실행될
|
||||
최상의 노드를 찾는 책임을 진다. 스케줄러는
|
||||
아래 설명된 스케줄링 원칙을 고려하여 이 배치 결정을
|
||||
하게 된다.
|
||||
|
||||
파드가 특정 노드에 배치되는 이유를 이해하려고 하거나
|
||||
사용자 정의된 스케줄러를 직접 구현하려는 경우 이
|
||||
페이지를 통해서 스케줄링에 대해 배울 수 있을 것이다.
|
||||
|
||||
## kube-scheduler
|
||||
|
||||
[kube-scheduler](https://kubernetes.io/docs/reference/command-line-tools-reference/kube-scheduler/)는
|
||||
쿠버네티스의 기본 스케줄러이며 {{< glossary_tooltip text="컨트롤 플레인" term_id="control-plane" >}}의
|
||||
일부로 실행된다.
|
||||
kube-scheduler는 원하거나 필요에 따라 자체 스케줄링 컴포넌트를
|
||||
만들고 대신 사용할 수 있도록 설계되었다.
|
||||
|
||||
새로 생성된 모든 파드 또는 예약되지 않은 다른 파드에 대해 kube-scheduler는
|
||||
실행할 최적의 노드를 선택한다. 그러나 파드의 모든 컨테이너에는
|
||||
리소스에 대한 요구사항이 다르며 모든 파드에도
|
||||
요구사항이 다르다. 따라서 기존 노드들은
|
||||
특정 스케줄링 요구사항에 따라 필터링 되어야 한다.
|
||||
|
||||
클러스터에서 파드에 대한 스케줄링 요구사항을 충족하는 노드를
|
||||
_실행 가능한(feasible)_ 노드라고 한다. 적합한 노드가 없으면 스케줄러가
|
||||
배치할 수 있을 때까지 파드가 스케줄 되지 않은 상태로 유지된다.
|
||||
|
||||
스케줄러는 파드가 실행 가능한 노드를 찾은 다음 실행 가능한 노드의
|
||||
점수를 측정하는 기능 셋을 수행하고 실행 가능한 노드 중에서 가장 높은 점수를
|
||||
가진 노드를 선택하여 파드를 실행한다. 그런 다음 스케줄러는
|
||||
_바인딩_ 이라는 프로세스에서 이 결정에 대해 API 서버에 알린다.
|
||||
|
||||
스케줄링 결정을 위해 고려해야 할 요소에는
|
||||
개별 및 집단 리소스 요구사항, 하드웨어 / 소프트웨어 /
|
||||
정책 제한조건, 어피니티 및 안티-어피니티 명세, 데이터
|
||||
지역성(data locality), 워크로드 간 간섭 등이 포함된다.
|
||||
|
||||
### kube-scheduler에서 노드 선택 {#kube-scheduler-implementation}
|
||||
|
||||
kube-scheduler는 2단계 작업에서 파드에 대한 노드를 선택한다.
|
||||
|
||||
1. 필터링
|
||||
1. 스코어링(scoring)
|
||||
|
||||
_필터링_ 단계는 파드를 스케줄링 할 수 있는 노드 셋을
|
||||
찾는다. 예를 들어 PodFitsResources 필터는
|
||||
후보 노드가 파드의 특정 리소스 요청을 충족시키기에 충분한 가용 리소스가
|
||||
있는지 확인한다. 이 단계 다음에 노드 목록에는 적합한 노드들이
|
||||
포함된다. 하나 이상의 노드가 포함된 경우가 종종 있을 것이다. 목록이 비어 있으면
|
||||
해당 파드는 (아직) 스케줄링 될 수 없다.
|
||||
|
||||
_스코어링_ 단계에서 스케줄러는 목록에 남아있는 노드의 순위를 지정하여
|
||||
가장 적합한 파드 배치를 선택한다. 스케줄러는 사용 중인 스코어링 규칙에 따라
|
||||
이 점수를 기준으로 필터링에서 통과된 각 노드에 대해 점수를 지정한다.
|
||||
|
||||
마지막으로 kube-scheduler는 파드를 순위가 가장 높은 노드에 할당한다.
|
||||
점수가 같은 노드가 두 개 이상인 경우 kube-scheduler는
|
||||
이들 중 하나를 임의로 선택한다.
|
||||
|
||||
스케줄러의 필터링 및 스코어링 동작을 구성하는 데 지원되는 두 가지
|
||||
방법이 있다.
|
||||
|
||||
1. [스케줄링 정책](/docs/reference/scheduling/policies)을 사용하면
|
||||
필터링을 위한 _단정(Predicates)_ 및 스코어링을 위한 _우선순위(Priorities)_ 를 구성할 수 있다.
|
||||
1. [스케줄링 프로파일](/docs/reference/scheduling/profiles)을 사용하면
|
||||
`QueueSort`, `Filter`, `Score`, `Bind`, `Reserve`, `Permit` 등의
|
||||
다른 스케줄링 단계를 구현하는 플러그인을 구성할 수 있다. 다른 프로파일을 실행하도록
|
||||
kube-scheduler를 구성할 수도 있다.
|
||||
|
||||
{{% /capture %}}
|
||||
{{% capture whatsnext %}}
|
||||
* [스케줄러 성능 튜닝](/ko/docs/concepts/scheduling/scheduler-perf-tuning/)에 대해 읽기
|
||||
* [파드 토폴로지 분배 제약 조건](/ko/docs/concepts/workloads/pods/pod-topology-spread-constraints/)에 대해 읽기
|
||||
* kube-scheduler의 [레퍼런스 문서](/docs/reference/command-line-tools-reference/kube-scheduler/) 읽기
|
||||
* [멀티 스케줄러 구성하기](/docs/tasks/administer-cluster/configure-multiple-schedulers/)에 대해 배우기
|
||||
* [토폴로지 관리 정책](/docs/tasks/administer-cluster/topology-manager/)에 대해 배우기
|
||||
* [파드 오버헤드](/docs/concepts/configuration/pod-overhead/)에 대해 배우기
|
||||
{{% /capture %}}
|
||||
|
|
@ -71,6 +71,7 @@ spec:
|
|||
- http:
|
||||
paths:
|
||||
- path: /testpath
|
||||
pathType: Prefix
|
||||
backend:
|
||||
serviceName: test
|
||||
servicePort: 80
|
||||
|
|
@ -115,6 +116,84 @@ spec:
|
|||
만약 인그레스 오브젝트의 HTTP 요청과 일치하는 호스트 또는 경로가 없으면, 트래픽은
|
||||
기본 백엔드로 라우팅 된다.
|
||||
|
||||
### 경로(Path) 유형
|
||||
|
||||
인그레스의 각 경로에는 해당하는 경로 유형이 있다. 지원되는 세 가지의 경로
|
||||
유형이 있다.
|
||||
|
||||
* _`ImplementationSpecific`_ (기본): 이 경로 유형의 일치 여부는 IngressClass에 따라
|
||||
달라진다. 이를 구현할 때 별도 pathType으로 처리하거나, `Prefix` 또는 `Exact`
|
||||
경로 유형과 같이 동일하게 처리할 수 있다.
|
||||
|
||||
* _`Exact`_: URL 경로의 대소문자를 엄격하게 일치시킨다.
|
||||
|
||||
* _`Prefix`_: URL 경로의 접두사를 `/` 를 기준으로 분리한 값과 일치시킨다.
|
||||
일치는 대소문자를 구분하고,
|
||||
요소별로 경로 요소에 대해 수행한다.
|
||||
모든 _p_ 가 요청 경로의 요소별 접두사가 _p_ 인 경우
|
||||
요청은 _p_ 경로에 일치한다.
|
||||
{{< note >}}
|
||||
경로의 마지막 요소가 요청 경로에 있는 마지막 요소의
|
||||
하위 문자열인 경우에는 일치하지 않는다(예시:
|
||||
`/foo/bar` 와 `/foo/bar/baz` 와 일치하지만, `/foo/barbaz` 는 일치하지 않는다).
|
||||
{{< /note >}}
|
||||
|
||||
#### 다중 일치
|
||||
경우에 따라 인그레스의 여러 경로가 요청과 일치할 수 있다.
|
||||
이 경우 가장 긴 일치하는 경로가 우선하게 된다. 두 개의 경로가
|
||||
여전히 동일하게 일치하는 경우 접두사(prefix) 경로 유형보다
|
||||
정확한(exact) 경로 유형을 가진 경로가 사용 된다.
|
||||
|
||||
## 인그레스 클래스
|
||||
|
||||
인그레스는 서로 다른 컨트롤러에 의해 구현될 수 있으며, 종종 다른 구성으로
|
||||
구현될 수 있다. 각 인그레스에서는 클래스를 구현해야하는 컨트롤러
|
||||
이름을 포함하여 추가 구성이 포함된 IngressClass
|
||||
리소스에 대한 참조 클래스를 지정해야 한다.
|
||||
|
||||
```yaml
|
||||
apiVersion: networking.k8s.io/v1beta1
|
||||
kind: IngressClass
|
||||
metadata:
|
||||
name: external-lb
|
||||
spec:
|
||||
controller: example.com/ingress-controller
|
||||
parameters:
|
||||
apiGroup: k8s.example.com/v1alpha
|
||||
kind: IngressParameters
|
||||
name: external-lb
|
||||
```
|
||||
|
||||
IngressClass 리소스에는 선택적인 파라미터 필드가 있다. 이 클래스에 대한
|
||||
추가 구성을 참조하는데 사용할 수 있다.
|
||||
|
||||
### 사용중단(Deprecated) 어노테이션
|
||||
|
||||
쿠버네티스 1.18에 IngressClass 리소스 및 `ingressClassName` 필드가 추가되기
|
||||
전에 인그레스 클래스는 인그레스에서
|
||||
`kubernetes.io/ingress.class` 어노테이션으로 지정되었다. 이 어노테이션은
|
||||
공식적으로 정의된 것은 아니지만, 인그레스 컨트롤러에서 널리 지원되었었다.
|
||||
|
||||
인그레스의 최신 `ingressClassName` 필드는 해당 어노테이션을
|
||||
대체하지만, 직접적으로 해당하는 것은 아니다. 어노테이션은 일반적으로
|
||||
인그레스를 구현해야 하는 인그레스 컨트롤러의 이름을 참조하는 데 사용되었지만,
|
||||
이 필드는 인그레스 컨트롤러의 이름을 포함하는 추가 인그레스 구성이
|
||||
포함된 인그레스 클래스 리소스에 대한 참조이다.
|
||||
|
||||
### 기본 인그레스 클래스
|
||||
|
||||
특정 IngressClass를 클러스터의 기본 값으로 표시할 수 있다. IngressClass
|
||||
리소스에서 `ingressclass.kubernetes.io/is-default-class` 를 `true` 로
|
||||
설정하면 `ingressClassName` 필드가 지정되지 않은
|
||||
새 인그레스에게 기본 IngressClass가 할당된다.
|
||||
|
||||
{{< caution >}}
|
||||
클러스터의 기본값으로 표시된 IngressClass가 두 개 이상 있는 경우
|
||||
어드미션 컨트롤러에서 `ingressClassName` 이 지정되지 않은
|
||||
새 인그레스 오브젝트를 생성할 수 없다. 클러스터에서 최대 1개의 IngressClass가
|
||||
기본값으로 표시하도록 해서 이 문제를 해결할 수 있다.
|
||||
{{< /caution >}}
|
||||
|
||||
## 인그레스 유형들
|
||||
|
||||
### 단일 서비스 인그레스
|
||||
|
|
|
|||
|
|
@ -202,6 +202,17 @@ API 리소스이다. 개념적으로 엔드포인트와 매우 유사하지만,
|
|||
엔드포인트슬라이스는 [엔드포인트슬라이스](/ko/docs/concepts/services-networking/endpoint-slices/)에서
|
||||
자세하게 설명된 추가적인 속성 및 기능을 제공한다.
|
||||
|
||||
### 애플리케이션 프로토콜
|
||||
|
||||
{{< feature-state for_k8s_version="v1.18" state="alpha" >}}
|
||||
|
||||
AppProtocol 필드는 각 서비스 포트에 사용될 애플리케이션 프로토콜을
|
||||
지정하는 방법을 제공한다.
|
||||
|
||||
알파 기능으로 이 필드는 기본적으로 활성화되어 있지 않다. 이 필드를 사용하려면,
|
||||
[기능 게이트](/docs/reference/command-line-tools-reference/feature-gates/)에서
|
||||
`ServiceAppProtocol` 을 활성화해야 한다.
|
||||
|
||||
## 가상 IP와 서비스 프록시
|
||||
|
||||
쿠버네티스 클러스터의 모든 노드는 `kube-proxy`를 실행한다. `kube-proxy`는
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue