Merge remote-tracking branch 'upstream/master' into merged-master-dev-1.20
commit
86d9492ccb
161
README-ko.md
161
README-ko.md
|
@ -1,69 +1,144 @@
|
|||
# 쿠버네티스 문서화
|
||||
|
||||
[](https://travis-ci.org/kubernetes/website)
|
||||
[](https://github.com/kubernetes/website/releases/latest)
|
||||
[](https://app.netlify.com/sites/kubernetes-io-master-staging/deploys) [](https://github.com/kubernetes/website/releases/latest)
|
||||
|
||||
환영합니다! 이 저장소는 쿠버네티스 웹사이트 및 문서화를 만드는 데 필요로 하는 모든 asset에 대한 공간을 제공합니다. 여러분이 기여를 원한다는 사실에 매우 기쁩니다!
|
||||
이 저장소에는 [쿠버네티스 웹사이트 및 문서](https://kubernetes.io/)를 빌드하는 데 필요한 자산이 포함되어 있습니다. 기여해주셔서 감사합니다!
|
||||
|
||||
## 문서에 기여하기
|
||||
# 저장소 사용하기
|
||||
|
||||
이 저장소에 대한 복제본을 여러분의 GitHub 계정에 생성하기 위해 화면 오른쪽 위 영역에 있는 **Fork** 버튼을 클릭 가능합니다. 이 복제본은 *fork* 라고 부릅니다. 여러분의 fork에서 원하는 임의의 변경 사항을 만들고, 해당 변경 사항을 보낼 준비가 되었다면, 여러분의 fork로 이동하여 새로운 풀 리퀘스트를 만들어 우리에게 알려주시기 바랍니다.
|
||||
Hugo(확장 버전)를 사용하여 웹사이트를 로컬에서 실행하거나, 컨테이너 런타임에서 실행할 수 있습니다. 라이브 웹사이트와의 배포 일관성을 제공하므로, 컨테이너 런타임을 사용하는 것을 적극 권장합니다.
|
||||
|
||||
여러분의 풀 리퀘스트가 생성된 이후에는, 쿠버네티스 리뷰어가 명료하고 실행 가능한 피드백을 제공하는 책임을 담당할 것입니다. 풀 리퀘스트의 오너로서, **쿠버네티스 리뷰어로부터 제공받은 피드백을 수용하기 위해 풀 리퀘스트를 수정하는 것은 여러분의 책임입니다.** 또한, 참고로 한 명 이상의 쿠버네티스 리뷰어가 여러분에게 피드백을 제공하는 상황에 처하거나, 또는 여러분에게 피드백을 제공하기로 원래 할당된 사람이 아닌 다른 쿠버네티스 리뷰어로부터 피드백을 받는 상황에 처할 수도 있습니다. 그뿐만 아니라, 몇몇 상황에서는, 필요에 따라 리뷰어 중 한 명이 [쿠버네티스 기술 리뷰어](https://github.com/kubernetes/website/wiki/Tech-reviewers)로부터의 기술 리뷰를 요청할지도 모릅니다. 리뷰어는 제시간에 피드백을 제공하기 위해 최선을 다할 것이지만, 응답 시간은 상황에 따라 달라질 수도 있습니다.
|
||||
## 사전 준비 사항
|
||||
|
||||
쿠버네티스 문서화에 기여하기와 관련된 보다 자세한 정보는, 다음을 살펴봅니다:
|
||||
이 저장소를 사용하기 위해, 로컬에 다음의 소프트웨어들이 설치되어 있어야 합니다.
|
||||
|
||||
* [기여 시작하기](https://kubernetes.io/docs/contribute/start/)
|
||||
* [문서화 변경 사항 스테이징하기](http://kubernetes.io/docs/contribute/intermediate#view-your-changes-locally)
|
||||
* [페이지 템플릿 사용하기](https://kubernetes.io/docs/contribute/style/page-content-types/)
|
||||
* [문서화 스타일 가이드](http://kubernetes.io/docs/contribute/style/style-guide/)
|
||||
* [쿠버네티스 문서화 로컬라이징](https://kubernetes.io/docs/contribute/localization/)
|
||||
- [npm](https://www.npmjs.com/)
|
||||
- [Go](https://golang.org/)
|
||||
- [Hugo(확장 버전)](https://gohugo.io/)
|
||||
- [도커](https://www.docker.com/)와 같은 컨테이너 런타임.
|
||||
|
||||
## `README.md`에 대한 쿠버네티스 문서화 번역
|
||||
시작하기 전에 의존성이 있는 소프트웨어를 설치합니다. 저장소를 복제(clone)하고 디렉터리로 이동합니다.
|
||||
|
||||
### 한국어
|
||||
|
||||
`README.md` 번역 및 한국어 기여자를 위한 보다 자세한 가이드를 [한국어 README](README-ko.md) 페이지 혹은 [쿠버네티스 문서 한글화 가이드](https://kubernetes.io/ko/docs/contribute/localization_ko/)에서 살펴봅니다.
|
||||
|
||||
한국어 번역 메인테이너에게 다음을 통해 연락 가능합니다.
|
||||
|
||||
* 이덕준 ([GitHub - @gochist](https://github.com/gochist))
|
||||
* [Slack channel](https://kubernetes.slack.com/messages/kubernetes-docs-ko)
|
||||
|
||||
## 도커를 사용하여 사이트를 로컬에서 실행하기
|
||||
|
||||
쿠버네티스 웹사이트를 로컬에서 실행하기 위한 추천하는 방식은 [Hugo](https://gohugo.io) 정적 사이트 생성기를 포함하는 특별한 [도커](https://docker.com) 이미지를 실행하는 것입니다.
|
||||
|
||||
> Windows에서 실행하는 경우, [Chocolatey](https://chocolatey.org)로 설치할 수 있는 명명 추가 도구를 필요로 할 것입니다. `choco install make`
|
||||
|
||||
> 도커를 사용하지 않고 웹사이트를 로컬에서 실행하기를 선호하는 경우에는, 아래 [Hugo를 사용한 로컬 사이트 실행하기](#hugo를-사용한-로컬-사이트-실행하기)를 살펴봅니다.
|
||||
|
||||
도커 [동작 및 실행](https://www.docker.com/get-started) 환경이 있는 경우, 로컬에서 `kubernetes-hugo` 도커 이미지를 빌드 합니다:
|
||||
|
||||
```bash
|
||||
make container-image
|
||||
```
|
||||
git clone https://github.com/kubernetes/website.git
|
||||
cd website
|
||||
```
|
||||
|
||||
해당 이미지가 빌드 된 이후, 사이트를 로컬에서 실행할 수 있습니다:
|
||||
쿠버네티스 웹사이트는 [Docsy Hugo 테마](https://github.com/google/docsy#readme)를 사용합니다. 웹사이트를 컨테이너에서 실행하려는 경우에도, 다음을 실행하여 하위 모듈 및 기타 개발 종속성을 가져오는 것이 좋습니다.
|
||||
|
||||
```bash
|
||||
```
|
||||
# Docsy 하위 모듈 가져오기
|
||||
git submodule update --init --recursive --depth 1
|
||||
```
|
||||
|
||||
## 컨테이너를 사용하여 웹사이트 실행하기
|
||||
|
||||
컨테이너에서 사이트를 빌드하려면, 다음을 실행하여 컨테이너 이미지를 빌드하고 실행합니다.
|
||||
|
||||
```
|
||||
make container-image
|
||||
make container-serve
|
||||
```
|
||||
|
||||
브라우저에서 http://localhost:1313 를 열어 사이트를 살펴봅니다. 소스 파일에 변경 사항이 있을 때, Hugo는 사이트를 업데이트하고 브라우저를 강제로 새로고침합니다.
|
||||
웹사이트를 보려면 브라우저를 http://localhost:1313 으로 엽니다. 소스 파일을 변경하면 Hugo가 웹사이트를 업데이트하고 브라우저를 강제로 새로 고칩니다.
|
||||
|
||||
## Hugo를 사용한 로컬 사이트 실행하기
|
||||
## Hugo를 사용하여 로컬에서 웹사이트 실행하기
|
||||
|
||||
Hugo 설치 안내를 위해서는 [공식 Hugo 문서화](https://gohugo.io/getting-started/installing/)를 살펴봅니다. [`netlify.toml`](netlify.toml#L9) 파일에 있는 `HUGO_VERSION` 환경 변수에서 지정된 Hugo 버전이 설치되었는지를 확인합니다.
|
||||
[`netlify.toml`](netlify.toml#L10) 파일의 `HUGO_VERSION` 환경 변수에 지정된 Hugo 확장 버전을 설치해야 합니다.
|
||||
|
||||
Hugo가 설치되었을 때 로컬에서 사이트를 실행하기 위해 (다음을 실행합니다):
|
||||
사이트를 로컬에서 빌드하고 테스트하려면, 다음을 실행합니다.
|
||||
|
||||
```bash
|
||||
# 의존성 있는 소프트웨어 설치
|
||||
npm ci
|
||||
make serve
|
||||
```
|
||||
|
||||
이를 통해 로컬 Hugo 서버를 1313번 포트에 시작합니다. 브라우저에서 http://localhost:1313 를 열어 사이트를 살펴봅니다. 소스 파일에 변경 사항이 있을 때, Hugo는 사이트를 업데이트하고 브라우저를 강제로 새로고침합니다.
|
||||
그러면 포트 1313에서 로컬 Hugo 서버가 시작됩니다. 웹사이트를 보려면 http://localhost:1313 으로 브라우저를 엽니다. 소스 파일을 변경하면, Hugo가 웹사이트를 업데이트하고 브라우저를 강제로 새로 고칩니다.
|
||||
|
||||
## 감사합니다!
|
||||
## 문제 해결
|
||||
### error: failed to transform resource: TOCSS: failed to transform "scss/main.scss" (text/x-scss): this feature is not available in your current Hugo version
|
||||
|
||||
쿠버네티스는 커뮤니티 참여와 함께 생존하며, 우리는 사이트 및 문서화에 대한 여러분의 컨트리뷰션에 대해 정말 감사하게 생각합니다!
|
||||
Hugo는 기술적인 이유로 2개의 바이너리 세트로 제공됩니다. 현재 웹사이트는 **Hugo 확장** 버전 기반에서만 실행됩니다. [릴리스 페이지](https://github.com/gohugoio/hugo/releases)에서 이름에 `extended` 가 포함된 아카이브를 찾습니다. 확인하려면, `hugo version` 을 실행하고 `extended` 라는 단어를 찾습니다.
|
||||
|
||||
### too many open files 이슈에 대한 macOS 문제 해결
|
||||
|
||||
macOS에서 `make serve` 를 실행하면 다음의 오류 메시지가 출력됩니다.
|
||||
|
||||
```
|
||||
ERROR 2020/08/01 19:09:18 Error: listen tcp 127.0.0.1:1313: socket: too many open files
|
||||
make: *** [serve] Error 1
|
||||
```
|
||||
|
||||
파일 오픈 개수에 대한 현재 제한값을 확인합니다.
|
||||
|
||||
`launchctl limit maxfiles`
|
||||
|
||||
그리고 다음의 명령을 실행합니다(https://gist.github.com/tombigel/d503800a282fcadbee14b537735d202c 를 참고하여 적용).
|
||||
|
||||
```
|
||||
#!/bin/sh
|
||||
|
||||
# 코멘트 처리한 것은 원래 gist 링크들이며, 그 아래는 수정된 tombigel의 gist 링크입니다.
|
||||
# curl -O https://gist.githubusercontent.com/a2ikm/761c2ab02b7b3935679e55af5d81786a/raw/ab644cb92f216c019a2f032bbf25e258b01d87f9/limit.maxfiles.plist
|
||||
# curl -O https://gist.githubusercontent.com/a2ikm/761c2ab02b7b3935679e55af5d81786a/raw/ab644cb92f216c019a2f032bbf25e258b01d87f9/limit.maxproc.plist
|
||||
|
||||
curl -O https://gist.githubusercontent.com/tombigel/d503800a282fcadbee14b537735d202c/raw/ed73cacf82906fdde59976a0c8248cce8b44f906/limit.maxfiles.plist
|
||||
curl -O https://gist.githubusercontent.com/tombigel/d503800a282fcadbee14b537735d202c/raw/ed73cacf82906fdde59976a0c8248cce8b44f906/limit.maxproc.plist
|
||||
|
||||
sudo mv limit.maxfiles.plist /Library/LaunchDaemons
|
||||
sudo mv limit.maxproc.plist /Library/LaunchDaemons
|
||||
|
||||
sudo chown root:wheel /Library/LaunchDaemons/limit.maxfiles.plist
|
||||
sudo chown root:wheel /Library/LaunchDaemons/limit.maxproc.plist
|
||||
|
||||
sudo launchctl load -w /Library/LaunchDaemons/limit.maxfiles.plist
|
||||
```
|
||||
|
||||
이 내용은 Catalina와 Mojave macOS에서 작동합니다.
|
||||
|
||||
|
||||
# SIG Docs에 참여하기
|
||||
|
||||
[커뮤니티 페이지](https://github.com/kubernetes/community/tree/master/sig-docs#meetings)에서 SIG Docs 쿠버네티스 커뮤니티 및 회의에 대한 자세한 내용을 확인합니다.
|
||||
|
||||
이 프로젝트의 메인테이너에게 연락을 할 수도 있습니다.
|
||||
|
||||
- [슬랙](https://kubernetes.slack.com/messages/sig-docs) [슬랙에 초대 받기](https://slack.k8s.io/)
|
||||
- [메일링 리스트](https://groups.google.com/forum/#!forum/kubernetes-sig-docs)
|
||||
|
||||
# 문서에 기여하기
|
||||
|
||||
이 저장소에 대한 복제본을 여러분의 GitHub 계정에 생성하기 위해 화면 오른쪽 위 영역에 있는 **Fork** 버튼을 클릭하면 됩니다. 이 복제본은 *fork* 라고 부릅니다. 여러분의 fork에서 원하는 임의의 변경 사항을 만들고, 해당 변경 사항을 보낼 준비가 되었다면, 여러분의 fork로 이동하여 새로운 풀 리퀘스트를 만들어 우리에게 알려주시기 바랍니다.
|
||||
|
||||
여러분의 풀 리퀘스트가 생성된 이후에는, 쿠버네티스 리뷰어가 명료하고 실행 가능한 피드백을 제공하는 책임을 담당할 것입니다. 풀 리퀘스트의 오너로서, **쿠버네티스 리뷰어로부터 제공받은 피드백을 수용하기 위해 풀 리퀘스트를 수정하는 것은 여러분의 책임입니다.**
|
||||
|
||||
또한, 참고로 한 명 이상의 쿠버네티스 리뷰어가 여러분에게 피드백을 제공하는 상황이거나, 또는 원래 여러분에게 피드백을 제공하기로 할당된 사람이 아닌 다른 쿠버네티스 리뷰어로부터 피드백을 받는 상황도 있습니다.
|
||||
|
||||
그뿐만 아니라, 몇몇 상황에서는, 필요에 따라 리뷰어 중 한 명이 [쿠버네티스 기술 리뷰어](https://github.com/kubernetes/website/wiki/Tech-reviewers)로부터의 기술 리뷰를 요청할지도 모릅니다. 리뷰어는 제시간에 피드백을 제공하기 위해 최선을 다할 것이지만, 응답 시간은 상황에 따라 달라질 수도 있습니다.
|
||||
|
||||
쿠버네티스 문서화에 기여하기와 관련된 보다 자세한 정보는, 다음을 참고합니다.
|
||||
|
||||
* [쿠버네티스 문서에 기여하기](https://kubernetes.io/docs/contribute/)
|
||||
* [페이지 콘텐트 타입](https://kubernetes.io/docs/contribute/style/page-content-types/)
|
||||
* [문서화 스타일 가이드](http://kubernetes.io/docs/contribute/style/style-guide/)
|
||||
* [쿠버네티스 문서 현지화](https://kubernetes.io/docs/contribute/localization/)
|
||||
|
||||
# `README.md`에 대한 쿠버네티스 문서 현지화(localization)
|
||||
|
||||
## 한국어
|
||||
|
||||
`README.md` 번역 및 한국어 기여자를 위한 보다 자세한 가이드는 [쿠버네티스 문서 한글화 가이드](https://kubernetes.io/ko/docs/contribute/localization_ko/)를 참고합니다.
|
||||
|
||||
한국어 번역 메인테이너에게 다음을 통해 연락할 수 있습니다.
|
||||
|
||||
* 손석호 ([GitHub - @seokho-son](https://github.com/seokho-son))
|
||||
* [슬랙 채널](https://kubernetes.slack.com/messages/kubernetes-docs-ko)
|
||||
|
||||
# 행동 강령
|
||||
|
||||
쿠버네티스 커뮤니티 참여는 [CNCF 행동 강령](https://github.com/cncf/foundation/blob/master/code-of-conduct-languages/ko.md)을 따릅니다.
|
||||
|
||||
# 감사합니다!
|
||||
|
||||
쿠버네티스는 커뮤니티 참여를 통해 번창하며, 우리는 웹사이트 및 문서화에 대한 당신의 기여에 감사드립니다!
|
||||
|
|
|
@ -17,7 +17,7 @@ Więcej informacji na temat współpracy przy tworzeniu dokumentacji znajdziesz
|
|||
|
||||
* [Jak rozpocząć współpracę](https://kubernetes.io/docs/contribute/start/)
|
||||
* [Podgląd wprowadzanych zmian w dokumentacji](http://kubernetes.io/docs/contribute/intermediate#view-your-changes-locally)
|
||||
* [Szablony stron](http://kubernetes.io/docs/contribute/style/page-templates/)
|
||||
* [Szablony stron](https://kubernetes.io/docs/contribute/style/page-content-types/)
|
||||
* [Styl pisania dokumentacji](http://kubernetes.io/docs/contribute/style/style-guide/)
|
||||
* [Lokalizacja dokumentacji Kubernetes](https://kubernetes.io/docs/contribute/localization/)
|
||||
|
||||
|
|
|
@ -71,6 +71,22 @@ body.td-404 main .error-details {
|
|||
max-width: 80%;
|
||||
border: 1px solid rgb(222, 226, 230);
|
||||
border-radius: 5px;
|
||||
margin-bottom: 1rem;
|
||||
padding-top: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
|
||||
// mermaid diagram - sequence diagram
|
||||
.actor {
|
||||
fill: #326ce5 !important;
|
||||
}
|
||||
text.actor {
|
||||
font-size: 18px !important;
|
||||
stroke: white !important;
|
||||
fill: white !important;
|
||||
}
|
||||
.activation0 {
|
||||
fill: #c9e9ec !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* HEADER */
|
||||
|
|
|
@ -6,7 +6,7 @@ weight: 10
|
|||
|
||||
<!-- overview -->
|
||||
|
||||
Ein Knoten (Node in Englisch) ist eine Arbeitsmaschine in Kubernetes, früher als `minion` bekannt. Ein Node
|
||||
Ein Knoten (Node in Englisch) ist eine Arbeitsmaschine in Kubernetes. Ein Node
|
||||
kann je nach Cluster eine VM oder eine physische Maschine sein. Jeder Node enthält
|
||||
die für den Betrieb von [Pods](/docs/concepts/workloads/pods/pod/) notwendigen Dienste
|
||||
und wird von den Master-Komponenten verwaltet.
|
||||
|
|
|
@ -0,0 +1,180 @@
|
|||
---
|
||||
layout: blog
|
||||
title: "Dockershim Deprecation FAQ"
|
||||
date: 2020-12-02
|
||||
slug: dockershim-faq
|
||||
aliases: [ '/dockershim' ]
|
||||
---
|
||||
|
||||
This document goes over some frequently asked questions regarding the Dockershim
|
||||
depreaction announced as a part of the Kubernetes v1.20 release. For more detail
|
||||
on the deprecation of Docker as a container runtime for Kubernetes kubelets, and
|
||||
what that means, check out the blog post
|
||||
[Don't Panic: Kubernetes and Docker](/blog/2020/12/02/dont-panic-kubernetes-and-docker/).
|
||||
|
||||
### Why is dockershim being deprecated?
|
||||
|
||||
Maintaining dockershim has become a heavy burden on the Kubernetes maintainers.
|
||||
The CRI standard was created to reduce this burden and allow smooth interoperability
|
||||
of different container runtimes. Docker itself doesn't currently implement CRI,
|
||||
thus the problem.
|
||||
|
||||
Dockershim was always intended to be a temporary solution (hence the name: shim).
|
||||
You can read more about the community discussion and planning in the
|
||||
[Dockershim Removal Kubernetes Enhancement Proposal][drkep].
|
||||
|
||||
Additionally, features that were largely incompatible with the dockershim, such
|
||||
as cgroups v2 and user namespaces are being implemented in these newer CRI
|
||||
runtimes. Removing support for the dockershim will allow further development in
|
||||
those areas.
|
||||
|
||||
[drkep]: https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/1985-remove-dockershim
|
||||
|
||||
### Can I still use Docker in Kubernetes 1.20?
|
||||
|
||||
Yes, the only thing changing in 1.20 is a single warning log printed at [kubelet]
|
||||
startup if using Docker as the runtime.
|
||||
|
||||
[kubelet]: /docs/reference/command-line-tools-reference/kubelet/
|
||||
|
||||
|
||||
### When will dockershim be removed?
|
||||
|
||||
Given the impact of this change, we are using an extended deprecation timeline.
|
||||
It will not be removed before Kubernetes 1.22, meaning the earliest release without
|
||||
dockershim would be 1.23 in late 2021. We will be working closely with vendors
|
||||
and other ecosystem groups to ensure a smooth transition and will evaluate things
|
||||
as the situation evolves.
|
||||
|
||||
|
||||
### Will my existing Docker images still work?
|
||||
|
||||
Yes, the images produced from `docker build` will work with all CRI implementations.
|
||||
All your existing images will still work exactly the same.
|
||||
|
||||
|
||||
### What about private images?
|
||||
|
||||
Also yes. All CRI runtimes support the same pull secrets configuration used in
|
||||
Kubernetes, either via the PodSpec or ServiceAccount.
|
||||
|
||||
|
||||
### Are Docker and containers the same thing?
|
||||
|
||||
Docker popularized the Linux containers pattern and has been instrumental in
|
||||
developing the underlying technology, however containers in Linux have existed
|
||||
for a long time. The container ecosystem has grown to be much broader than just
|
||||
Docker. Standards like OCI and CRI have helped many tools grow and thrive in our
|
||||
ecosystem, some replacing aspects of Docker while others enhance existing
|
||||
functionality.
|
||||
|
||||
|
||||
### Are there examples of folks using other runtimes in production today?
|
||||
|
||||
All Kubernetes project produced artifacts (Kubernetes binaries) are validated
|
||||
with each release.
|
||||
|
||||
Additionally, the [kind] project has been using containerd for some time and has
|
||||
seen an improvement in stability for its use case. Kind and containerd are leveraged
|
||||
multiple times every day to validate any changes to the Kubernetes codebase. Other
|
||||
related projects follow a similar pattern as well, demonstrating the stability and
|
||||
usability of other container runtimes. As an example, OpenShift 4.x has been
|
||||
using the [CRI-O] runtime in production since June 2019.
|
||||
|
||||
For other examples and references you can look at the adopters of containerd and
|
||||
cri-o, two container runtimes under the Cloud Native Computing Foundation ([CNCF]).
|
||||
- [containerd](https://github.com/containerd/containerd/blob/master/ADOPTERS.md)
|
||||
- [CRI-O](https://github.com/cri-o/cri-o/blob/master/ADOPTERS.md)
|
||||
|
||||
[CRI-O]: https://cri-o.io/
|
||||
[kind]: https://kind.sigs.k8s.io/
|
||||
[CNCF]: https://cncf.io
|
||||
|
||||
|
||||
### People keep referencing OCI, what is that?
|
||||
|
||||
OCI stands for the [Open Container Initiative], which standardized many of the
|
||||
interfaces between container tools and technologies. They maintain a standard
|
||||
specification for packaging container images (OCI image-spec) and running containers
|
||||
(OCI runtime-spec). They also maintain an actual implementation of the runtime-spec
|
||||
in the form of [runc], which is the underlying default runtime for both
|
||||
[containerd] and [CRI-O]. The CRI builds on these low-level specifications to
|
||||
provide an end-to-end standard for managing containers.
|
||||
|
||||
[Open Container Initative]: https://opencontainers.org/about/overview/
|
||||
[runc]: https://github.com/opencontainers/runc
|
||||
[containerd]: https://containerd.io/
|
||||
|
||||
|
||||
### Which CRI implementation should I use?
|
||||
|
||||
That’s a complex question and it depends on a lot of factors. If Docker is
|
||||
working for you, moving to containerd should be a relatively easy swap and
|
||||
has have strictly better performance and less overhead. However we encourage you
|
||||
to explore all the options from the [CNCF landscape] in case another would be an
|
||||
even better fit for your environment.
|
||||
|
||||
[CNCF landscape]: https://landscape.cncf.io/category=container-runtime&format=card-mode&grouping=category
|
||||
|
||||
|
||||
### What should I look out for when changing CRI implementations?
|
||||
|
||||
While the underlying containerization code is the same between Docker and most
|
||||
CRIs (including containerd), there are a few differences around the edges. Some
|
||||
common things to consider when migrating are:
|
||||
|
||||
- Logging configuration
|
||||
- Runtime resource limitations
|
||||
- Node provisioning scripts that call docker or use docker via it's control socket
|
||||
- Kubectl plugins that require docker CLI or the control socket
|
||||
- Kubernetes tools that require direct access to Docker (e.g. kube-imagepuller)
|
||||
- Configuration of functionality like `registry-mirrors` and insecure registries
|
||||
- Other support scripts or daemons that expect docker to be available and are run
|
||||
outside of Kubernetes (e.g. monitoring or security agents)
|
||||
- GPUs or special hardware and how they integrate with your runtime and Kubernetes
|
||||
|
||||
If you use Kubernetes resource requests/limits or file-based log collection
|
||||
DaemonSets then they will continue to work the same, but if you’ve customized
|
||||
your dockerd configuration, you’ll need to adapt that for your new container
|
||||
runtime where possible.
|
||||
|
||||
Another thing to look out for is anything expecting to run for system maintenance
|
||||
or nested inside a container when building images will no longer work. For the
|
||||
former, you can use the [`crictl`][cr] tool as a drop-in replacement and for the
|
||||
latter you can use newer container build options like [img], [buildah], or
|
||||
[kaniko] that don’t require Docker.
|
||||
|
||||
[cr]: https://github.com/kubernetes-sigs/cri-tools
|
||||
[img]: https://github.com/genuinetools/img
|
||||
[buildah]: https://github.com/containers/buildah
|
||||
[kaniko]: https://github.com/GoogleContainerTools/kaniko
|
||||
|
||||
For containerd, you can start with their [documentation] to see what configuration
|
||||
options are available as you migrate things over.
|
||||
|
||||
[documentation]: https://github.com/containerd/cri/blob/master/docs/registry.md
|
||||
|
||||
For instructions on how to use containerd and CRI-O with Kubernetes, see the
|
||||
Kubernetes documentation on [Container Runtimes]
|
||||
|
||||
[Container Runtimes]: /docs/setup/production-environment/container-runtimes
|
||||
|
||||
|
||||
### What if I have more questions?
|
||||
|
||||
If you use a vendor-supported Kubernetes distribution, you can ask them about
|
||||
upgrade plans for their products. For end-user questions, please post them
|
||||
to our end user community forum: https://discuss.kubernetes.io/.
|
||||
|
||||
You can also check out the excellent blog post
|
||||
[Wait, Docker is deprecated in Kubernetes now?][dep] a more in-depth technical
|
||||
discussion of the changes.
|
||||
|
||||
[dep]: https://dev.to/inductor/wait-docker-is-deprecated-in-kubernetes-now-what-do-i-do-e4m
|
||||
|
||||
|
||||
### Can I have a hug?
|
||||
|
||||
Always and whenever you want! 🤗🤗
|
||||
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
---
|
||||
layout: blog
|
||||
title: "Don't Panic: Kubernetes and Docker"
|
||||
date: 2020-12-02
|
||||
slug: dont-panic-kubernetes-and-docker
|
||||
---
|
||||
|
||||
**Authors:** Jorge Castro, Duffie Cooley, Kat Cosgrove, Justin Garrison, Noah Kantrowitz, Bob Killen, Rey Lejano, Dan “POP” Papandrea, Jeffrey Sica, Davanum “Dims” Srinivas
|
||||
|
||||
Kubernetes is [deprecating
|
||||
Docker](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.20.md#deprecation)
|
||||
as a container runtime after v1.20.
|
||||
|
||||
**You do not need to panic. It’s not as dramatic as it sounds.**
|
||||
|
||||
tl;dr Docker as an underlying runtime is being deprecated in favor of runtimes
|
||||
that use the [Container Runtime Interface(CRI)](https://kubernetes.io/blog/2016/12/container-runtime-interface-cri-in-kubernetes/)
|
||||
created for Kubernetes. Docker-produced images will continue to work in your
|
||||
cluster with all runtimes, as they always have.
|
||||
|
||||
If you’re an end-user of Kubernetes, not a whole lot will be changing for you.
|
||||
This doesn’t mean the death of Docker, and it doesn’t mean you can’t, or
|
||||
shouldn’t, use Docker as a development tool anymore. Docker is still a useful
|
||||
tool for building containers, and the images that result from running `docker
|
||||
build` can still run in your Kubernetes cluster.
|
||||
|
||||
If you’re using a managed Kubernetes service like GKE, EKS, or AKS (which [defaults to containerd](https://github.com/Azure/AKS/releases/tag/2020-11-16)) you will need to
|
||||
make sure your worker nodes are using a supported container runtime before
|
||||
Docker support is removed in a future version of Kubernetes. If you have node
|
||||
customizations you may need to update them based on your environment and runtime
|
||||
requirements. Please work with your service provider to ensure proper upgrade
|
||||
testing and planning.
|
||||
|
||||
If you’re rolling your own clusters, you will also need to make changes to avoid
|
||||
your clusters breaking. At v1.20, you will get a deprecation warning for Docker.
|
||||
When Docker runtime support is removed in a future release (currently planned
|
||||
for the 1.22 release in late 2021) of Kubernetes it will no longer be supported
|
||||
and you will need to switch to one of the other compliant container runtimes,
|
||||
like containerd or CRI-O. Just make sure that the runtime you choose supports
|
||||
the docker daemon configurations you currently use (e.g. logging).
|
||||
|
||||
## So why the confusion and what is everyone freaking out about?
|
||||
|
||||
We’re talking about two different environments here, and that’s creating
|
||||
confusion. Inside of your Kubernetes cluster, there’s a thing called a container
|
||||
runtime that’s responsible for pulling and running your container images. Docker
|
||||
is a popular choice for that runtime (other common options include containerd
|
||||
and CRI-O), but Docker was not designed to be embedded inside Kubernetes, and
|
||||
that causes a problem.
|
||||
|
||||
You see, the thing we call “Docker” isn’t actually one thing -- it’s an entire
|
||||
tech stack, and one part of it is a thing called “containerd,” which is a
|
||||
high-level container runtime by itself. Docker is cool and useful because it has
|
||||
a lot of UX enhancements that make it really easy for humans to interact with
|
||||
while we’re doing development work, but those UX enhancements aren’t necessary
|
||||
for Kubernetes, because it isn’t a human.
|
||||
|
||||
As a result of this human-friendly abstraction layer, your Kubernetes cluster
|
||||
has to use another tool called Dockershim to get at what it really needs, which
|
||||
is containerd. That’s not great, because it gives us another thing that has to
|
||||
be maintained and can possibly break. What’s actually happening here is that
|
||||
Dockershim is being removed from Kubelet as early as v1.23 release, which
|
||||
removes support for Docker as a container runtime as a result. You might be
|
||||
thinking to yourself, but if containerd is included in the Docker stack, why
|
||||
does Kubernetes need the Dockershim?
|
||||
|
||||
Docker isn’t compliant with CRI, the [Container Runtime Interface](https://kubernetes.io/blog/2016/12/container-runtime-interface-cri-in-kubernetes/).
|
||||
If it were, we wouldn’t need the shim, and this wouldn’t be a thing. But it’s
|
||||
not the end of the world, and you don’t need to panic -- you just need to change
|
||||
your container runtime from Docker to another supported container runtime.
|
||||
|
||||
One thing to note: If you are relying on the underlying docker socket
|
||||
(/var/run/docker.sock) as part of a workflow within your cluster today, moving
|
||||
to a different runtime will break your ability to use it. This pattern is often
|
||||
called Docker in Docker. There are lots of options out there for this specific
|
||||
use case including things like
|
||||
[kaniko](https://github.com/GoogleContainerTools/kaniko),
|
||||
[img](https://github.com/genuinetools/img), and
|
||||
[buildah](https://github.com/containers/buildah).
|
||||
|
||||
## What does this change mean for developers, though? Do we still write Dockerfiles? Do we still build things with Docker?
|
||||
|
||||
This change addresses a different environment than most folks use to interact
|
||||
with Docker. The Docker installation you’re using in development is unrelated to
|
||||
the Docker runtime inside your Kubernetes cluster. It’s confusing, I know. As a
|
||||
developer, Docker is still useful to you in all the ways it was before this
|
||||
change was announced. The image that Docker produces isn’t really a
|
||||
Docker-specific image -- it’s an OCI ([Open Container Initiative](https://opencontainers.org/)) image.
|
||||
Any OCI-compliant image, regardless of the tool you use to build it, will look
|
||||
the same to Kubernetes. Both [containerd](https://containerd.io/) and
|
||||
[CRI-O](https://cri-o.io/) know how to pull those images and run them. This is
|
||||
why we have a standard for what containers should look like.
|
||||
|
||||
So, this change is coming. It’s going to cause issues for some, but it isn’t
|
||||
catastrophic, and generally it’s a good thing. Depending on how you interact
|
||||
with Kubernetes, this could mean nothing to you, or it could mean a bit of work.
|
||||
In the long run, it’s going to make things easier. If this is still confusing
|
||||
for you, that’s okay -- there’s a lot going on here, Kubernetes has a lot of
|
||||
moving parts, and nobody is an expert in 100% of it. We encourage any and all
|
||||
questions regardless of experience level or complexity! Our goal is to make sure
|
||||
everyone is educated as much as possible on the upcoming changes. `<3` We hope
|
||||
this has answered most of your questions and soothed some anxieties!
|
||||
|
||||
Looking for more answers? Check out our accompanying [Dockershim Deprecation FAQ](/blog/2020/12/02/dockershim-faq/).
|
|
@ -26,10 +26,9 @@ case_study_details:
|
|||
|
||||
<p>Speed of delivery increased. Some of the legacy VM-based deployments took 45 minutes; with Kubernetes, that time was "just a few seconds to a couple of minutes," says Engineering Manager Brian Balser. Adds Li: "Teams that used to deploy on weekly schedules or had to coordinate schedules with the infrastructure team now deploy their updates independently, and can do it daily when necessary." Adopting Cloud Native Computing Foundation technologies allows for a more unified approach to deployment across the engineering staff, and portability for the company.</p>
|
||||
|
||||
{{< case-studies/quote author="Deep Kapadia, Executive Director, Engineering at The New York Times">}}
|
||||
<iframe style="padding:1%:" width="380" height="215" src="https://www.youtube.com/embed/DqS_IPw-c6o" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
|
||||
<iframe style="padding:1%:" width="380" height="215" src="https://www.youtube.com/embed/Tm4VfJtOHt8" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
|
||||
<br>
|
||||
{{< case-studies/quote author="Deep Kapadia, Executive Director, Engineering at The New York Times" >}}
|
||||
{{< youtube DqS_IPw-c6o youtube-quote-sm >}}
|
||||
{{< youtube Tm4VfJtOHt8 youtube-quote-sm >}}
|
||||
"I think once you get over the initial hump, things get a lot easier and actually a lot faster."
|
||||
{{< /case-studies/quote >}}
|
||||
|
||||
|
|
|
@ -158,6 +158,11 @@ tables to provide per-instance subnets to each host (which is limited to 50-100
|
|||
entries per VPC). In short, cni-ipvlan-vpc-k8s significantly reduces the
|
||||
network complexity required to deploy Kubernetes at scale within AWS.
|
||||
|
||||
### Coil
|
||||
|
||||
[Coil](https://github.com/cybozu-go/coil) is a CNI plugin designed for ease of integration, providing flexible egress networking.
|
||||
Coil operates with a low overhead compared to bare metal, and allows you to define arbitrary egress NAT gateways for external networks.
|
||||
|
||||
### Contiv
|
||||
|
||||
[Contiv](https://github.com/contiv/netplugin) provides configurable networking (native l3 using BGP, overlay using vxlan, classic l2, or Cisco-SDN/ACI) for various use cases. [Contiv](https://contiv.io) is all open sourced.
|
||||
|
@ -311,4 +316,4 @@ to run, and in both cases, the network provides one IP address per pod - as is s
|
|||
|
||||
The early design of the networking model and its rationale, and some future
|
||||
plans are described in more detail in the
|
||||
[networking design document](https://git.k8s.io/community/contributors/design-proposals/network/networking.md).
|
||||
[networking design document](https://git.k8s.io/community/contributors/design-proposals/network/networking.md).
|
||||
|
|
|
@ -104,7 +104,7 @@ The kubelet collects accelerator metrics through cAdvisor. To collect these metr
|
|||
|
||||
The responsibility for collecting accelerator metrics now belongs to the vendor rather than the kubelet. Vendors must provide a container that collects metrics and exposes them to the metrics service (for example, Prometheus).
|
||||
|
||||
The [`DisableAcceleratorUsageMetrics` feature gate](/docs/reference/command-line-tools-reference/feature-gates/#feature-gates-for-alpha-or-beta-features:~:text= DisableAcceleratorUsageMetrics,-false) disables metrics collected by the kubelet.
|
||||
The [`DisableAcceleratorUsageMetrics` feature gate](/docs/reference/command-line-tools-reference/feature-gates/) disables metrics collected by the kubelet, with a [timeline for enabling this feature by default](https://github.com/kubernetes/enhancements/tree/411e51027db842355bd489691af897afc1a41a5e/keps/sig-node/1867-disable-accelerator-usage-metrics#graduation-criteria).
|
||||
|
||||
## Component metrics
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ See the [ServiceAccount](/docs/tasks/configure-pod-container/configure-service-a
|
|||
documentation for more information on how service accounts work.
|
||||
You can also check the `automountServiceAccountToken` field and the
|
||||
`serviceAccountName` field of the
|
||||
[`Pod`](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#secret-v1-core)
|
||||
[`Pod`](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#pod-v1-core)
|
||||
for information on referencing service account from Pods.
|
||||
|
||||
### Docker config Secrets
|
||||
|
@ -154,7 +154,7 @@ When using this Secret type, you have to ensure the Secret `data` field
|
|||
contains a `.dockercfg` key whose value is content of a `~/.dockercfg` file
|
||||
encoded in the base64 format.
|
||||
|
||||
The `kubernetes/dockerconfigjson` type is designed for storing a serialized
|
||||
The `kubernetes.io/dockerconfigjson` type is designed for storing a serialized
|
||||
JSON that follows the same format rules as the `~/.docker/config.json` file
|
||||
which is a new format for `~/.dockercfg`.
|
||||
When using this Secret type, the `data` field of the Secret object must
|
||||
|
@ -248,7 +248,7 @@ configuration.
|
|||
|
||||
The builtin type `kubernetes.io/ssh-auth` is provided for storing data used in
|
||||
SSH authentication. When using this Secret type, you will have to specify a
|
||||
`ssh-privatekey` key-value pair in the `data` (or `stringData`) field.
|
||||
`ssh-privatekey` key-value pair in the `data` (or `stringData`) field
|
||||
as the SSH credential to use.
|
||||
|
||||
The following YAML is an example config for a SSH authentication Secret:
|
||||
|
@ -349,22 +349,21 @@ data:
|
|||
usage-bootstrap-signing: dHJ1ZQ==
|
||||
```
|
||||
|
||||
A bootstrap type has the following keys specified under `data`:
|
||||
A bootstrap type Secret has the following keys specified under `data`:
|
||||
|
||||
- `token_id`: A random 6 character string as the token identifier. Required.
|
||||
- `token-secret`: A random 16 character string as the actual token secret. Required.
|
||||
- `description1`: A human-readable string that describes what the token is
|
||||
- `description`: A human-readable string that describes what the token is
|
||||
used for. Optional.
|
||||
- `expiration`: An absolute UTC time using RFC3339 specifying when the token
|
||||
should be expired. Optional.
|
||||
- `usage-bootstrap-<usage>`: A boolean flag indicating additional usage for
|
||||
the bootstrap token.
|
||||
- `auth-extra-groups`: A comma-separated list of group names that will be
|
||||
authenticated as in addition to system:bootstrappers group.
|
||||
authenticated as in addition to the `system:bootstrappers` group.
|
||||
|
||||
The above YAML may look confusing because the values are all in base64 encoded
|
||||
strings. In fact, you can create an identical Secret using the following YAML
|
||||
which results in an identical Secret object:
|
||||
strings. In fact, you can create an identical Secret using the following YAML:
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
|
|
|
@ -84,7 +84,7 @@ Credentials can be provided in several ways:
|
|||
provider) can implement your mechanism for authenticating the node
|
||||
to the container registry.
|
||||
|
||||
These options are explaind in more detail below.
|
||||
These options are explained in more detail below.
|
||||
|
||||
### Configuring nodes to authenticate to a private registry
|
||||
|
||||
|
|
|
@ -77,19 +77,10 @@ about this format, see the [Kubernetes Protobuf serialization](https://github.co
|
|||
Interface Definition Language (IDL) files for each schema located in the Go
|
||||
packages that define the API objects.
|
||||
|
||||
## API changes
|
||||
## Persistence
|
||||
|
||||
Any system that is successful needs to grow and change as new use cases emerge or existing ones change.
|
||||
Therefore, Kubernetes has designed its features to allow the Kubernetes API to continuously change and grow.
|
||||
The Kubernetes project aims to _not_ break compatibility with existing clients, and to maintain that
|
||||
compatibility for a length of time so that other projects have an opportunity to adapt.
|
||||
|
||||
In general, new API resources and new resource fields can be added often and frequently.
|
||||
Elimination of resources or fields requires following the
|
||||
[API deprecation policy](/docs/reference/using-api/deprecation-policy/).
|
||||
|
||||
What constitutes a compatible change, and how to change the API, are detailed in
|
||||
[API changes](https://git.k8s.io/community/contributors/devel/sig-architecture/api_changes.md#readme).
|
||||
Kubernetes stores the serialized state of objects by writing them into
|
||||
{{< glossary_tooltip term_id="etcd" >}}.
|
||||
|
||||
## API groups and versioning
|
||||
|
||||
|
@ -107,17 +98,44 @@ To make it easier to evolve and to extend its API, Kubernetes implements
|
|||
[enabled or disabled](/docs/reference/using-api/#enabling-or-disabling).
|
||||
|
||||
API resources are distinguished by their API group, resource type, namespace
|
||||
(for namespaced resources), and name. The API server may serve the same
|
||||
underlying data through multiple API version and handle the conversion between
|
||||
API versions transparently. All these different versions are actually
|
||||
representations of the same resource. For example, suppose there are two
|
||||
versions `v1` and `v1beta1` for the same resource. An object created by the
|
||||
`v1beta1` version can then be read, updated, and deleted by either the
|
||||
`v1beta1` or the `v1` versions.
|
||||
(for namespaced resources), and name. The API server handles the conversion between
|
||||
API versions transparently: all the different versions are actually representations
|
||||
of the same persisted data. The API server may serve the same underlying data
|
||||
through multiple API versions.
|
||||
|
||||
For example, suppose there are two API versions, `v1` and `v1beta1`, for the same
|
||||
resource. If you originally created an object using the `v1beta1` version of its
|
||||
API, you can later read, update, or delete that object
|
||||
using either the `v1beta1` or the `v1` API version.
|
||||
|
||||
### API changes
|
||||
|
||||
Any system that is successful needs to grow and change as new use cases emerge or existing ones change.
|
||||
Therefore, Kubernetes has designed the Kubernetes API to continuously change and grow.
|
||||
The Kubernetes project aims to _not_ break compatibility with existing clients, and to maintain that
|
||||
compatibility for a length of time so that other projects have an opportunity to adapt.
|
||||
|
||||
In general, new API resources and new resource fields can be added often and frequently.
|
||||
Elimination of resources or fields requires following the
|
||||
[API deprecation policy](/docs/reference/using-api/deprecation-policy/).
|
||||
|
||||
Kubernetes makes a strong commitment to maintain compatibility for official Kubernetes APIs
|
||||
once they reach general availability (GA), typically at API version `v1`. Additionally,
|
||||
Kubernetes keeps compatibility even for _beta_ API versions wherever feasible:
|
||||
if you adopt a beta API you can continue to interact with your cluster using that API,
|
||||
even after the feature goes stable.
|
||||
|
||||
{{< note >}}
|
||||
Although Kubernetes also aims to maintain compatibility for _alpha_ APIs versions, in some
|
||||
circumstances this is not possible. If you use any alpha API versions, check the release notes
|
||||
for Kubernetes when upgrading your cluster, in case the API did change.
|
||||
{{< /note >}}
|
||||
|
||||
Refer to [API versions reference](/docs/reference/using-api/#api-versioning)
|
||||
for more details on the API version level definitions.
|
||||
|
||||
|
||||
|
||||
## API Extension
|
||||
|
||||
The Kubernetes API can be extended in one of two ways:
|
||||
|
@ -135,3 +153,5 @@ The Kubernetes API can be extended in one of two ways:
|
|||
how the cluster manages authentication and authorization for API access.
|
||||
- Learn about API endpoints, resource types and samples by reading
|
||||
[API Reference](/docs/reference/kubernetes-api/).
|
||||
- Learn about what constitutes a compatible change, and how to change the API, from
|
||||
[API changes](https://git.k8s.io/community/contributors/devel/sig-architecture/api_changes.md#readme).
|
||||
|
|
|
@ -140,10 +140,11 @@ partition
|
|||
!partition
|
||||
```
|
||||
|
||||
The first example selects all resources with key equal to `environment` and value equal to `production` or `qa`.
|
||||
The second example selects all resources with key equal to `tier` and values other than `frontend` and `backend`, and all resources with no labels with the `tier` key.
|
||||
The third example selects all resources including a label with key `partition`; no values are checked.
|
||||
The fourth example selects all resources without a label with key `partition`; no values are checked.
|
||||
* The first example selects all resources with key equal to `environment` and value equal to `production` or `qa`.
|
||||
* The second example selects all resources with key equal to `tier` and values other than `frontend` and `backend`, and all resources with no labels with the `tier` key.
|
||||
* The third example selects all resources including a label with key `partition`; no values are checked.
|
||||
* The fourth example selects all resources without a label with key `partition`; no values are checked.
|
||||
|
||||
Similarly the comma separator acts as an _AND_ operator. So filtering resources with a `partition` key (no matter the value) and with `environment` different than `qa` can be achieved using `partition,environment notin (qa)`.
|
||||
The _set-based_ label selector is a general form of equality since `environment=production` is equivalent to `environment in (production)`; similarly for `!=` and `notin`.
|
||||
|
||||
|
|
|
@ -32,15 +32,15 @@ You add a taint to a node using [kubectl taint](/docs/reference/generated/kubect
|
|||
For example,
|
||||
|
||||
```shell
|
||||
kubectl taint nodes node1 key=value:NoSchedule
|
||||
kubectl taint nodes node1 key1=value1:NoSchedule
|
||||
```
|
||||
|
||||
places a taint on node `node1`. The taint has key `key`, value `value`, and taint effect `NoSchedule`.
|
||||
places a taint on node `node1`. The taint has key `key1`, value `value1`, and taint effect `NoSchedule`.
|
||||
This means that no pod will be able to schedule onto `node1` unless it has a matching toleration.
|
||||
|
||||
To remove the taint added by the command above, you can run:
|
||||
```shell
|
||||
kubectl taint nodes node1 key=value:NoSchedule-
|
||||
kubectl taint nodes node1 key1=value1:NoSchedule-
|
||||
```
|
||||
|
||||
You specify a toleration for a pod in the PodSpec. Both of the following tolerations "match" the
|
||||
|
@ -49,15 +49,15 @@ to schedule onto `node1`:
|
|||
|
||||
```yaml
|
||||
tolerations:
|
||||
- key: "key"
|
||||
- key: "key1"
|
||||
operator: "Equal"
|
||||
value: "value"
|
||||
value: "value1"
|
||||
effect: "NoSchedule"
|
||||
```
|
||||
|
||||
```yaml
|
||||
tolerations:
|
||||
- key: "key"
|
||||
- key: "key1"
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
```
|
||||
|
@ -80,7 +80,7 @@ There are two special cases:
|
|||
An empty `key` with operator `Exists` matches all keys, values and effects which means this
|
||||
will tolerate everything.
|
||||
|
||||
An empty `effect` matches all effects with key `key`.
|
||||
An empty `effect` matches all effects with key `key1`.
|
||||
|
||||
{{< /note >}}
|
||||
|
||||
|
|
|
@ -13,9 +13,8 @@ Unlike other types of controllers which run as part of the `kube-controller-mana
|
|||
are not started automatically with a cluster. Use this page to choose the ingress controller implementation
|
||||
that best fits your cluster.
|
||||
|
||||
Kubernetes as a project currently supports and maintains [GCE](https://git.k8s.io/ingress-gce/README.md) and
|
||||
[nginx](https://git.k8s.io/ingress-nginx/README.md) controllers.
|
||||
|
||||
Kubernetes as a project supports and maintains [AWS](https://github.com/kubernetes-sigs/aws-load-balancer-controller#readme), [GCE](https://git.k8s.io/ingress-gce/README.md#readme), and
|
||||
[nginx](https://git.k8s.io/ingress-nginx/README.md#readme) ingress controllers.
|
||||
|
||||
|
||||
<!-- body -->
|
||||
|
@ -24,31 +23,31 @@ Kubernetes as a project currently supports and maintains [GCE](https://git.k8s.i
|
|||
|
||||
{{% thirdparty-content %}}
|
||||
|
||||
* [AKS Application Gateway Ingress Controller](https://github.com/Azure/application-gateway-kubernetes-ingress) is an ingress controller that enables ingress to [AKS clusters](https://docs.microsoft.com/azure/aks/kubernetes-walkthrough-portal) using the [Azure Application Gateway](https://docs.microsoft.com/azure/application-gateway/overview).
|
||||
* [Ambassador](https://www.getambassador.io/) API Gateway is an [Envoy](https://www.envoyproxy.io) based ingress
|
||||
controller with [community](https://www.getambassador.io/docs) or
|
||||
[commercial](https://www.getambassador.io/pro/) support from [Datawire](https://www.datawire.io/).
|
||||
* [AppsCode Inc.](https://appscode.com) offers support and maintenance for the most widely used [HAProxy](https://www.haproxy.org/) based ingress controller [Voyager](https://appscode.com/products/voyager).
|
||||
* [AWS ALB Ingress Controller](https://github.com/kubernetes-sigs/aws-alb-ingress-controller) enables ingress using the [AWS Application Load Balancer](https://aws.amazon.com/elasticloadbalancing/).
|
||||
* [Contour](https://projectcontour.io/) is an [Envoy](https://www.envoyproxy.io/) based ingress controller
|
||||
provided and supported by VMware.
|
||||
* Citrix provides an [Ingress Controller](https://github.com/citrix/citrix-k8s-ingress-controller) for its hardware (MPX), virtualized (VPX) and [free containerized (CPX) ADC](https://www.citrix.com/products/citrix-adc/cpx-express.html) for [baremetal](https://github.com/citrix/citrix-k8s-ingress-controller/tree/master/deployment/baremetal) and [cloud](https://github.com/citrix/citrix-k8s-ingress-controller/tree/master/deployment) deployments.
|
||||
* F5 Networks provides [support and maintenance](https://support.f5.com/csp/article/K86859508)
|
||||
for the [F5 BIG-IP Container Ingress Services for Kubernetes](https://clouddocs.f5.com/containers/latest/userguide/kubernetes/).
|
||||
* [Gloo](https://gloo.solo.io) is an open-source ingress controller based on [Envoy](https://www.envoyproxy.io) which offers API Gateway functionality with enterprise support from [solo.io](https://www.solo.io).
|
||||
* [HAProxy Ingress](https://haproxy-ingress.github.io) is a highly customizable community-driven ingress controller for HAProxy.
|
||||
* [HAProxy Technologies](https://www.haproxy.com/) offers support and maintenance for the [HAProxy Ingress Controller for Kubernetes](https://github.com/haproxytech/kubernetes-ingress). See the [official documentation](https://www.haproxy.com/documentation/hapee/1-9r1/traffic-management/kubernetes-ingress-controller/).
|
||||
* [Istio](https://istio.io/) based ingress controller
|
||||
[Control Ingress Traffic](https://istio.io/docs/tasks/traffic-management/ingress/).
|
||||
* [Kong](https://konghq.com/) offers [community](https://discuss.konghq.com/c/kubernetes) or
|
||||
[commercial](https://konghq.com/kong-enterprise/) support and maintenance for the
|
||||
[Kong Ingress Controller for Kubernetes](https://github.com/Kong/kubernetes-ingress-controller).
|
||||
* [NGINX, Inc.](https://www.nginx.com/) offers support and maintenance for the
|
||||
[NGINX Ingress Controller for Kubernetes](https://www.nginx.com/products/nginx/kubernetes-ingress-controller).
|
||||
* [Skipper](https://opensource.zalando.com/skipper/kubernetes/ingress-controller/) HTTP router and reverse proxy for service composition, including use cases like Kubernetes Ingress, designed as a library to build your custom proxy
|
||||
* [Traefik](https://github.com/traefik/traefik) is a fully featured ingress controller
|
||||
([Let's Encrypt](https://letsencrypt.org), secrets, http2, websocket), and it also comes with commercial
|
||||
support by [Traefik Labs](https://traefik.io).
|
||||
* [AKS Application Gateway Ingress Controller](https://azure.github.io/application-gateway-kubernetes-ingress/) is an ingress controller that configures the [Azure Application Gateway](https://docs.microsoft.com/azure/application-gateway/overview).
|
||||
* [Ambassador](https://www.getambassador.io/) API Gateway is an [Envoy](https://www.envoyproxy.io)-based ingress
|
||||
controller.
|
||||
* The [Citrix ingress controller](https://github.com/citrix/citrix-k8s-ingress-controller#readme) works with
|
||||
Citrix Application Delivery Controller.
|
||||
* [Contour](https://projectcontour.io/) is an [Envoy](https://www.envoyproxy.io/) based ingress controller.
|
||||
* F5 BIG-IP [Container Ingress Services for Kubernetes](https://clouddocs.f5.com/containers/latest/userguide/kubernetes/)
|
||||
lets you use an Ingress to configure F5 BIG-IP virtual servers.
|
||||
* [Gloo](https://gloo.solo.io) is an open-source ingress controller based on [Envoy](https://www.envoyproxy.io),
|
||||
which offers API gateway functionality.
|
||||
* [HAProxy Ingress](https://haproxy-ingress.github.io/) is an ingress controller for
|
||||
[HAProxy](http://www.haproxy.org/#desc).
|
||||
* The [HAProxy Ingress Controller for Kubernetes](https://github.com/haproxytech/kubernetes-ingress#readme)
|
||||
is also an ingress controller for [HAProxy](http://www.haproxy.org/#desc).
|
||||
* [Istio Ingress](https://istio.io/latest/docs/tasks/traffic-management/ingress/kubernetes-ingress/)
|
||||
is an [Istio](https://istio.io/) based ingress controller.
|
||||
* The [Kong Ingress Controller for Kubernetes](https://github.com/Kong/kubernetes-ingress-controller#readme)
|
||||
is an ingress controller driving [Kong Gateway](https://konghq.com/kong/).
|
||||
* The [NGINX Ingress Controller for Kubernetes](https://www.nginx.com/products/nginx/kubernetes-ingress-controller)
|
||||
works with the [NGINX](https://www.nginx.com/resources/glossary/nginx/) webserver (as a proxy).
|
||||
* [Skipper](https://opensource.zalando.com/skipper/kubernetes/ingress-controller/) HTTP router and reverse proxy for service composition, including use cases like Kubernetes Ingress, designed as a library to build your custom proxy.
|
||||
* The [Traefik Kubernetes Ingress provider](https://doc.traefik.io/traefik/providers/kubernetes-ingress/) is an
|
||||
ingress controller for the [Traefik](https://traefik.io/traefik/) proxy.
|
||||
* [Voyager](https://appscode.com/products/voyager) is an ingress controller for
|
||||
[HAProxy](http://www.haproxy.org/#desc).
|
||||
|
||||
## Using multiple Ingress controllers
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ different purposes:
|
|||
[downwardAPI](/docs/concepts/storage/volumes/#downwardapi),
|
||||
[secret](/docs/concepts/storage/volumes/#secret): inject different
|
||||
kinds of Kubernetes data into a Pod
|
||||
- [CSI ephemeral volumes](#csi-ephemeral-volume):
|
||||
- [CSI ephemeral volumes](#csi-ephemeral-volumes):
|
||||
similar to the previous volume kinds, but provided by special
|
||||
[CSI drivers](https://github.com/container-storage-interface/spec/blob/master/spec.md)
|
||||
which specifically [support this feature](https://kubernetes-csi.github.io/docs/drivers.html)
|
||||
|
|
|
@ -172,14 +172,18 @@ spec:
|
|||
# The pod template ends here
|
||||
```
|
||||
|
||||
Modifying the pod template or switching to a new pod template has no effect on the
|
||||
Pods that already exist. Pods do not receive template updates directly. Instead,
|
||||
a new Pod is created to match the revised pod template.
|
||||
Modifying the pod template or switching to a new pod template has no direct effect
|
||||
on the Pods that already exist. If you change the pod template for a workload
|
||||
resource, that resource needs to create replacement Pods that use the updated template.
|
||||
|
||||
For example, the deployment controller ensures that the running Pods match the current
|
||||
pod template for each Deployment object. If the template is updated, the Deployment has
|
||||
to remove the existing Pods and create new Pods based on the updated template. Each workload
|
||||
resource implements its own rules for handling changes to the Pod template.
|
||||
For example, the StatefulSet controller ensures that the running Pods match the current
|
||||
pod template for each StatefulSet object. If you edit the StatefulSet to change its pod
|
||||
template, the StatefulSet starts to create new Pods based on the updated template.
|
||||
Eventually, all of the old Pods are replaced with new Pods, and the update is complete.
|
||||
|
||||
Each workload resource implements its own rules for handling changes to the Pod template.
|
||||
If you want to read more about StatefulSet specifically, read
|
||||
[Update strategy](/docs/tutorials/stateful-application/basic-stateful-set/#updating-statefulsets) in the StatefulSet Basics tutorial.
|
||||
|
||||
On Nodes, the {{< glossary_tooltip term_id="kubelet" text="kubelet" >}} does not
|
||||
directly observe or manage any of the details around pod templates and updates; those
|
||||
|
|
|
@ -282,7 +282,33 @@ from the OAuth2 [token response](https://openid.net/specs/openid-connect-core-1_
|
|||
as a bearer token. See [above](#putting-a-bearer-token-in-a-request) for how the token
|
||||
is included in a request.
|
||||
|
||||

|
||||
{{< mermaid >}}
|
||||
sequenceDiagram
|
||||
participant user as User
|
||||
participant idp as Identity Provider
|
||||
participant kube as Kubectl
|
||||
participant api as API Server
|
||||
|
||||
user ->> idp: 1. Login to IdP
|
||||
activate idp
|
||||
idp -->> user: 2. Provide access_token,<br>id_token, and refresh_token
|
||||
deactivate idp
|
||||
activate user
|
||||
user ->> kube: 3. Call Kubectl<br>with --token being the id_token<br>OR add tokens to .kube/config
|
||||
deactivate user
|
||||
activate kube
|
||||
kube ->> api: 4. Authorization: Bearer...
|
||||
deactivate kube
|
||||
activate api
|
||||
api ->> api: 5. Is JWT signature valid?
|
||||
api ->> api: 6. Has the JWT expired? (iat+exp)
|
||||
api ->> api: 7. User authorized?
|
||||
api -->> kube: 8. Authorized: Perform<br>action and return result
|
||||
deactivate api
|
||||
activate kube
|
||||
kube --x user: 9. Return result
|
||||
deactivate kube
|
||||
{{< /mermaid >}}
|
||||
|
||||
1. Login to your identity provider
|
||||
2. Your identity provider will provide you with an `access_token`, `id_token` and a `refresh_token`
|
||||
|
@ -328,7 +354,7 @@ tokens on behalf of another.
|
|||
Kubernetes does not provide an OpenID Connect Identity Provider.
|
||||
You can use an existing public OpenID Connect Identity Provider (such as Google, or
|
||||
[others](https://connect2id.com/products/nimbus-oauth-openid-connect-sdk/openid-connect-providers)).
|
||||
Or, you can run your own Identity Provider, such as CoreOS [dex](https://github.com/coreos/dex),
|
||||
Or, you can run your own Identity Provider, such as [dex](https://dexidp.io/),
|
||||
[Keycloak](https://github.com/keycloak/keycloak),
|
||||
CloudFoundry [UAA](https://github.com/cloudfoundry/uaa), or
|
||||
Tremolo Security's [OpenUnison](https://github.com/tremolosecurity/openunison).
|
||||
|
@ -339,7 +365,7 @@ For an identity provider to work with Kubernetes it must:
|
|||
2. Run in TLS with non-obsolete ciphers
|
||||
3. Have a CA signed certificate (even if the CA is not a commercial CA or is self signed)
|
||||
|
||||
A note about requirement #3 above, requiring a CA signed certificate. If you deploy your own identity provider (as opposed to one of the cloud providers like Google or Microsoft) you MUST have your identity provider's web server certificate signed by a certificate with the `CA` flag set to `TRUE`, even if it is self signed. This is due to GoLang's TLS client implementation being very strict to the standards around certificate validation. If you don't have a CA handy, you can use [this script](https://github.com/coreos/dex/blob/1ee5920c54f5926d6468d2607c728b71cfe98092/examples/k8s/gencert.sh) from the CoreOS team to create a simple CA and a signed certificate and key pair.
|
||||
A note about requirement #3 above, requiring a CA signed certificate. If you deploy your own identity provider (as opposed to one of the cloud providers like Google or Microsoft) you MUST have your identity provider's web server certificate signed by a certificate with the `CA` flag set to `TRUE`, even if it is self signed. This is due to GoLang's TLS client implementation being very strict to the standards around certificate validation. If you don't have a CA handy, you can use [this script](https://github.com/dexidp/dex/blob/master/examples/k8s/gencert.sh) from the Dex team to create a simple CA and a signed certificate and key pair.
|
||||
Or you can use [this similar script](https://raw.githubusercontent.com/TremoloSecurity/openunison-qs-kubernetes/master/src/main/bash/makessl.sh) that generates SHA256 certs with a longer life and larger key size.
|
||||
|
||||
Setup instructions for specific systems:
|
||||
|
|
|
@ -90,6 +90,13 @@ kubectl apply -f ./my1.yaml -f ./my2.yaml # create from multiple files
|
|||
kubectl apply -f ./dir # create resource(s) in all manifest files in dir
|
||||
kubectl apply -f https://git.io/vPieo # create resource(s) from url
|
||||
kubectl create deployment nginx --image=nginx # start a single instance of nginx
|
||||
|
||||
# create a Job which prints "Hello World"
|
||||
kubectl create job hello --image=busybox -- echo "Hello World"
|
||||
|
||||
# create a CronJob that prints "Hello World" every minute
|
||||
kubectl create cronjob hello --image=busybox --schedule="*/1 * * * *" -- echo "Hello World"
|
||||
|
||||
kubectl explain pods # get the documentation for pod manifests
|
||||
|
||||
# Create multiple YAML objects from stdin
|
||||
|
|
|
@ -32,7 +32,7 @@ The cluster that `kubeadm init` and `kubeadm join` set up should be:
|
|||
- `kubeadm init`
|
||||
- `export KUBECONFIG=/etc/kubernetes/admin.conf`
|
||||
- `kubectl apply -f <network-of-choice.yaml>`
|
||||
- `kubeadm join --token <token> <master-ip>:<master-port>`
|
||||
- `kubeadm join --token <token> <endpoint>:<port>`
|
||||
- **Extendable**:
|
||||
- It should _not_ favor any particular network provider. Configuring the cluster network is out-of-scope
|
||||
- It should provide the possibility to use a config file for customizing various parameters
|
||||
|
@ -206,7 +206,7 @@ Please note that:
|
|||
|
||||
1. All images will be pulled from k8s.gcr.io by default. See [using custom images](/docs/reference/setup-tools/kubeadm/kubeadm-init/#custom-images) for customizing the image repository
|
||||
2. In case of kubeadm is executed in the `--dry-run` mode, static Pods files are written in a temporary folder
|
||||
3. Static Pod manifest generation for master components can be invoked individually with the [`kubeadm init phase control-plane all`](/docs/reference/setup-tools/kubeadm/kubeadm-init-phase/#cmd-phase-control-plane) command
|
||||
3. Static Pod manifest generation for control plane components can be invoked individually with the [`kubeadm init phase control-plane all`](/docs/reference/setup-tools/kubeadm/kubeadm-init-phase/#cmd-phase-control-plane) command
|
||||
|
||||
#### API server
|
||||
|
||||
|
@ -344,7 +344,7 @@ state and make new decisions based on that data.
|
|||
Please note that:
|
||||
|
||||
1. Before saving the ClusterConfiguration, sensitive information like the token is stripped from the configuration
|
||||
2. Upload of master configuration can be invoked individually with the [`kubeadm init phase upload-config`](/docs/reference/setup-tools/kubeadm/kubeadm-init-phase/#cmd-phase-upload-config) command
|
||||
2. Upload of control plane node configuration can be invoked individually with the [`kubeadm init phase upload-config`](/docs/reference/setup-tools/kubeadm/kubeadm-init-phase/#cmd-phase-upload-config) command
|
||||
|
||||
### Mark the node as control-plane
|
||||
|
||||
|
@ -355,7 +355,7 @@ As soon as the control plane is available, kubeadm executes following actions:
|
|||
|
||||
Please note that:
|
||||
|
||||
1. Mark control-plane phase phase can be invoked individually with the [`kubeadm init phase mark-control-plane`](/docs/reference/setup-tools/kubeadm/kubeadm-init-phase/#cmd-phase-mark-master) command
|
||||
1. Mark control-plane phase phase can be invoked individually with the [`kubeadm init phase mark-control-plane`](/docs/reference/setup-tools/kubeadm/kubeadm-init-phase/#cmd-phase-mark-control-plane) command
|
||||
|
||||
### Configure TLS-Bootstrapping for node joining
|
||||
|
||||
|
@ -415,7 +415,7 @@ Additionally it creates a Role and a RoleBinding granting access to the ConfigMa
|
|||
|
||||
Please note that:
|
||||
|
||||
1. The access to the `cluster-info` ConfigMap _is not_ rate-limited. This may or may not be a problem if you expose your master
|
||||
1. The access to the `cluster-info` ConfigMap _is not_ rate-limited. This may or may not be a problem if you expose your cluster's API server
|
||||
to the internet; worst-case scenario here is a DoS attack where an attacker uses all the in-flight requests the kube-apiserver
|
||||
can handle to serving the `cluster-info` ConfigMap.
|
||||
|
||||
|
@ -430,8 +430,8 @@ Please note that:
|
|||
|
||||
A ServiceAccount for `kube-proxy` is created in the `kube-system` namespace; then kube-proxy is deployed as a DaemonSet:
|
||||
|
||||
- The credentials (`ca.crt` and `token`) to the master come from the ServiceAccount
|
||||
- The location of the master comes from a ConfigMap
|
||||
- The credentials (`ca.crt` and `token`) to the control plane come from the ServiceAccount
|
||||
- The location (URL) of the API server comes from a ConfigMap
|
||||
- The `kube-proxy` ServiceAccount is bound to the privileges in the `system:node-proxier` ClusterRole
|
||||
|
||||
#### DNS
|
||||
|
|
|
@ -33,7 +33,7 @@ support running as a pool of interchangable resources, replicated per
|
|||
component.
|
||||
|
||||
When you deploy a cluster control plane, place replicas of
|
||||
control plane components across multple failure zones. If availability is
|
||||
control plane components across multiple failure zones. If availability is
|
||||
an important concern, select at least three failure zones and replicate
|
||||
each individual control plane component (API server, scheduler, etcd,
|
||||
cluster controller manager) across at least three failure zones.
|
||||
|
@ -111,7 +111,7 @@ see [Allowed topologies](/docs/concepts/storage/storage-classes/#allowed-topolog
|
|||
## Networking
|
||||
|
||||
By itself, Kubernetes does not include zone-aware networking. You can use a
|
||||
[network plugin](docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/)
|
||||
[network plugin](/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/)
|
||||
to configure cluster networking, and that network solution might have zone-specific
|
||||
elements. For example, if your cloud provider supports Services with
|
||||
`type=LoadBalancer`, the load balancer might only send traffic to Pods running in the
|
||||
|
@ -126,7 +126,7 @@ of different failure zones, does vary depending on exactly how your cluster is s
|
|||
## Fault recovery
|
||||
|
||||
When you set up your cluster, you might also need to consider whether and how
|
||||
your setup can restore service if all of the failure zones in a region go
|
||||
your setup can restore service if all the failure zones in a region go
|
||||
off-line at the same time. For example, do you rely on there being at least
|
||||
one node able to run Pods in a zone?
|
||||
Make sure that any cluster-critical repair work does not rely
|
||||
|
|
|
@ -68,7 +68,7 @@ spec:
|
|||
command:
|
||||
- powershell.exe
|
||||
- -command
|
||||
- "<#code used from https://gist.github.com/wagnerandrade/5424431#> ; $$listener = New-Object System.Net.HttpListener ; $$listener.Prefixes.Add('http://*:80/') ; $$listener.Start() ; $$callerCounts = @{} ; Write-Host('Listening at http://*:80/') ; while ($$listener.IsListening) { ;$$context = $$listener.GetContext() ;$$requestUrl = $$context.Request.Url ;$$clientIP = $$context.Request.RemoteEndPoint.Address ;$$response = $$context.Response ;Write-Host '' ;Write-Host('> {0}' -f $$requestUrl) ; ;$$count = 1 ;$$k=$$callerCounts.Get_Item($$clientIP) ;if ($$k -ne $$null) { $$count += $$k } ;$$callerCounts.Set_Item($$clientIP, $$count) ;$$ip=(Get-NetAdapter | Get-NetIpAddress); $$header='<html><body><H1>Windows Container Web Server</H1>' ;$$callerCountsString='' ;$$callerCounts.Keys | % { $$callerCountsString+='<p>IP {0} callerCount {1} ' -f $$ip[1].IPAddress,$$callerCounts.Item($$_) } ;$$footer='</body></html>' ;$$content='{0}{1}{2}' -f $$header,$$callerCountsString,$$footer ;Write-Output $$content ;$$buffer = [System.Text.Encoding]::UTF8.GetBytes($$content) ;$$response.ContentLength64 = $$buffer.Length ;$$response.OutputStream.Write($$buffer, 0, $$buffer.Length) ;$$response.Close() ;$$responseStatus = $$response.StatusCode ;Write-Host('< {0}' -f $$responseStatus) } ; "
|
||||
- "<#code used from https://gist.github.com/19WAS85/5424431#> ; $$listener = New-Object System.Net.HttpListener ; $$listener.Prefixes.Add('http://*:80/') ; $$listener.Start() ; $$callerCounts = @{} ; Write-Host('Listening at http://*:80/') ; while ($$listener.IsListening) { ;$$context = $$listener.GetContext() ;$$requestUrl = $$context.Request.Url ;$$clientIP = $$context.Request.RemoteEndPoint.Address ;$$response = $$context.Response ;Write-Host '' ;Write-Host('> {0}' -f $$requestUrl) ; ;$$count = 1 ;$$k=$$callerCounts.Get_Item($$clientIP) ;if ($$k -ne $$null) { $$count += $$k } ;$$callerCounts.Set_Item($$clientIP, $$count) ;$$ip=(Get-NetAdapter | Get-NetIpAddress); $$header='<html><body><H1>Windows Container Web Server</H1>' ;$$callerCountsString='' ;$$callerCounts.Keys | % { $$callerCountsString+='<p>IP {0} callerCount {1} ' -f $$ip[1].IPAddress,$$callerCounts.Item($$_) } ;$$footer='</body></html>' ;$$content='{0}{1}{2}' -f $$header,$$callerCountsString,$$footer ;Write-Output $$content ;$$buffer = [System.Text.Encoding]::UTF8.GetBytes($$content) ;$$response.ContentLength64 = $$buffer.Length ;$$response.OutputStream.Write($$buffer, 0, $$buffer.Length) ;$$response.Close() ;$$responseStatus = $$response.StatusCode ;Write-Host('< {0}' -f $$responseStatus) } ; "
|
||||
nodeSelector:
|
||||
kubernetes.io/os: windows
|
||||
```
|
||||
|
|
|
@ -330,8 +330,8 @@ seconds. Minimum value is 1.
|
|||
* `timeoutSeconds`: Number of seconds after which the probe times out. Defaults
|
||||
to 1 second. Minimum value is 1.
|
||||
* `successThreshold`: Minimum consecutive successes for the probe to be
|
||||
considered successful after having failed. Defaults to 1. Must be 1 for
|
||||
liveness. Minimum value is 1.
|
||||
considered successful after having failed. Defaults to 1. Must be 1 for liveness
|
||||
and startup Probes. Minimum value is 1.
|
||||
* `failureThreshold`: When a probe fails, Kubernetes will
|
||||
try `failureThreshold` times before giving up. Giving up in case of liveness probe means restarting the container. In case of readiness probe the Pod will be marked Unready.
|
||||
Defaults to 3. Minimum value is 1.
|
||||
|
|
|
@ -15,8 +15,9 @@ weight: 30
|
|||
|
||||
This page shows how to run a replicated stateful application using a
|
||||
[StatefulSet](/docs/concepts/workloads/controllers/statefulset/) controller.
|
||||
The example is a MySQL single-master topology with multiple slaves running
|
||||
asynchronous replication.
|
||||
This application is a replicated MySQL database. The example topology has a
|
||||
single primary server and multiple replicas, using asynchronous row-based
|
||||
replication.
|
||||
|
||||
{{< note >}}
|
||||
**This is not a production configuration**. MySQL settings remain on insecure defaults to keep the focus
|
||||
|
@ -69,9 +70,9 @@ kubectl apply -f https://k8s.io/examples/application/mysql/mysql-configmap.yaml
|
|||
```
|
||||
|
||||
This ConfigMap provides `my.cnf` overrides that let you independently control
|
||||
configuration on the MySQL master and slaves.
|
||||
In this case, you want the master to be able to serve replication logs to slaves
|
||||
and you want slaves to reject any writes that don't come via replication.
|
||||
configuration on the primary MySQL server and replicas.
|
||||
In this case, you want the primary server to be able to serve replication logs to replicas
|
||||
and you want replicas to reject any writes that don't come via replication.
|
||||
|
||||
There's nothing special about the ConfigMap itself that causes different
|
||||
portions to apply to different Pods.
|
||||
|
@ -96,12 +97,12 @@ cluster and namespace.
|
|||
|
||||
The Client Service, called `mysql-read`, is a normal Service with its own
|
||||
cluster IP that distributes connections across all MySQL Pods that report
|
||||
being Ready. The set of potential endpoints includes the MySQL master and all
|
||||
slaves.
|
||||
being Ready. The set of potential endpoints includes the primary MySQL server and all
|
||||
replicas.
|
||||
|
||||
Note that only read queries can use the load-balanced Client Service.
|
||||
Because there is only one MySQL master, clients should connect directly to the
|
||||
MySQL master Pod (through its DNS entry within the Headless Service) to execute
|
||||
Because there is only one primary MySQL server, clients should connect directly to the
|
||||
primary MySQL Pod (through its DNS entry within the Headless Service) to execute
|
||||
writes.
|
||||
|
||||
### StatefulSet
|
||||
|
@ -167,33 +168,33 @@ This translates the unique, stable identity provided by the StatefulSet
|
|||
controller into the domain of MySQL server IDs, which require the same
|
||||
properties.
|
||||
|
||||
The script in the `init-mysql` container also applies either `master.cnf` or
|
||||
`slave.cnf` from the ConfigMap by copying the contents into `conf.d`.
|
||||
Because the example topology consists of a single MySQL master and any number of
|
||||
slaves, the script simply assigns ordinal `0` to be the master, and everyone
|
||||
else to be slaves.
|
||||
The script in the `init-mysql` container also applies either `primary.cnf` or
|
||||
`replica.cnf` from the ConfigMap by copying the contents into `conf.d`.
|
||||
Because the example topology consists of a single primary MySQL server and any number of
|
||||
replicas, the script simply assigns ordinal `0` to be the primary server, and everyone
|
||||
else to be replicas.
|
||||
Combined with the StatefulSet controller's
|
||||
[deployment order guarantee](/docs/concepts/workloads/controllers/statefulset/#deployment-and-scaling-guarantees/),
|
||||
this ensures the MySQL master is Ready before creating slaves, so they can begin
|
||||
this ensures the primary MySQL server is Ready before creating replicas, so they can begin
|
||||
replicating.
|
||||
|
||||
### Cloning existing data
|
||||
|
||||
In general, when a new Pod joins the set as a slave, it must assume the MySQL
|
||||
master might already have data on it. It also must assume that the replication
|
||||
In general, when a new Pod joins the set as a replica, it must assume the primary MySQL
|
||||
server might already have data on it. It also must assume that the replication
|
||||
logs might not go all the way back to the beginning of time.
|
||||
These conservative assumptions are the key to allow a running StatefulSet
|
||||
to scale up and down over time, rather than being fixed at its initial size.
|
||||
|
||||
The second Init Container, named `clone-mysql`, performs a clone operation on
|
||||
a slave Pod the first time it starts up on an empty PersistentVolume.
|
||||
a replica Pod the first time it starts up on an empty PersistentVolume.
|
||||
That means it copies all existing data from another running Pod,
|
||||
so its local state is consistent enough to begin replicating from the master.
|
||||
so its local state is consistent enough to begin replicating from the primary server.
|
||||
|
||||
MySQL itself does not provide a mechanism to do this, so the example uses a
|
||||
popular open-source tool called Percona XtraBackup.
|
||||
During the clone, the source MySQL server might suffer reduced performance.
|
||||
To minimize impact on the MySQL master, the script instructs each Pod to clone
|
||||
To minimize impact on the primary MySQL server, the script instructs each Pod to clone
|
||||
from the Pod whose ordinal index is one lower.
|
||||
This works because the StatefulSet controller always ensures Pod `N` is
|
||||
Ready before starting Pod `N+1`.
|
||||
|
@ -206,15 +207,15 @@ server, and an `xtrabackup` container that acts as a
|
|||
[sidecar](https://kubernetes.io/blog/2015/06/the-distributed-system-toolkit-patterns).
|
||||
|
||||
The `xtrabackup` sidecar looks at the cloned data files and determines if
|
||||
it's necessary to initialize MySQL replication on the slave.
|
||||
it's necessary to initialize MySQL replication on the replica.
|
||||
If so, it waits for `mysqld` to be ready and then executes the
|
||||
`CHANGE MASTER TO` and `START SLAVE` commands with replication parameters
|
||||
extracted from the XtraBackup clone files.
|
||||
|
||||
Once a slave begins replication, it remembers its MySQL master and
|
||||
Once a replica begins replication, it remembers its primary MySQL server and
|
||||
reconnects automatically if the server restarts or the connection dies.
|
||||
Also, because slaves look for the master at its stable DNS name
|
||||
(`mysql-0.mysql`), they automatically find the master even if it gets a new
|
||||
Also, because replicas look for the primary server at its stable DNS name
|
||||
(`mysql-0.mysql`), they automatically find the primary server even if it gets a new
|
||||
Pod IP due to being rescheduled.
|
||||
|
||||
Lastly, after starting replication, the `xtrabackup` container listens for
|
||||
|
@ -224,7 +225,7 @@ case the next Pod loses its PersistentVolumeClaim and needs to redo the clone.
|
|||
|
||||
## Sending client traffic
|
||||
|
||||
You can send test queries to the MySQL master (hostname `mysql-0.mysql`)
|
||||
You can send test queries to the primary MySQL server (hostname `mysql-0.mysql`)
|
||||
by running a temporary container with the `mysql:5.7` image and running the
|
||||
`mysql` client binary.
|
||||
|
||||
|
@ -291,7 +292,7 @@ it running in another window so you can see the effects of the following steps.
|
|||
|
||||
## Simulating Pod and Node downtime
|
||||
|
||||
To demonstrate the increased availability of reading from the pool of slaves
|
||||
To demonstrate the increased availability of reading from the pool of replicas
|
||||
instead of a single server, keep the `SELECT @@server_id` loop from above
|
||||
running while you force a Pod out of the Ready state.
|
||||
|
||||
|
@ -409,9 +410,9 @@ Now uncordon the Node to return it to a normal state:
|
|||
kubectl uncordon <node-name>
|
||||
```
|
||||
|
||||
## Scaling the number of slaves
|
||||
## Scaling the number of replicas
|
||||
|
||||
With MySQL replication, you can scale your read query capacity by adding slaves.
|
||||
With MySQL replication, you can scale your read query capacity by adding replicas.
|
||||
With StatefulSet, you can do this with a single command:
|
||||
|
||||
```shell
|
||||
|
|
|
@ -11,6 +11,7 @@ spec:
|
|||
containers:
|
||||
- name: hello
|
||||
image: busybox
|
||||
imagePullPolicy: IfNotPresent
|
||||
args:
|
||||
- /bin/sh
|
||||
- -c
|
||||
|
|
|
@ -5,12 +5,12 @@ metadata:
|
|||
labels:
|
||||
app: mysql
|
||||
data:
|
||||
master.cnf: |
|
||||
# Apply this config only on the master.
|
||||
primary.cnf: |
|
||||
# Apply this config only on the primary.
|
||||
[mysqld]
|
||||
log-bin
|
||||
slave.cnf: |
|
||||
# Apply this config only on slaves.
|
||||
replica.cnf: |
|
||||
# Apply this config only on replicas.
|
||||
[mysqld]
|
||||
super-read-only
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ spec:
|
|||
app: mysql
|
||||
---
|
||||
# Client service for connecting to any MySQL instance for reads.
|
||||
# For writes, you must instead connect to the master: mysql-0.mysql.
|
||||
# For writes, you must instead connect to the primary: mysql-0.mysql.
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
|
|
|
@ -29,9 +29,9 @@ spec:
|
|||
echo server-id=$((100 + $ordinal)) >> /mnt/conf.d/server-id.cnf
|
||||
# Copy appropriate conf.d files from config-map to emptyDir.
|
||||
if [[ $ordinal -eq 0 ]]; then
|
||||
cp /mnt/config-map/master.cnf /mnt/conf.d/
|
||||
cp /mnt/config-map/primary.cnf /mnt/conf.d/
|
||||
else
|
||||
cp /mnt/config-map/slave.cnf /mnt/conf.d/
|
||||
cp /mnt/config-map/replica.cnf /mnt/conf.d/
|
||||
fi
|
||||
volumeMounts:
|
||||
- name: conf
|
||||
|
@ -47,7 +47,7 @@ spec:
|
|||
set -ex
|
||||
# Skip the clone if data already exists.
|
||||
[[ -d /var/lib/mysql/mysql ]] && exit 0
|
||||
# Skip the clone on master (ordinal index 0).
|
||||
# Skip the clone on primary (ordinal index 0).
|
||||
[[ `hostname` =~ -([0-9]+)$ ]] || exit 1
|
||||
ordinal=${BASH_REMATCH[1]}
|
||||
[[ $ordinal -eq 0 ]] && exit 0
|
||||
|
@ -108,12 +108,12 @@ spec:
|
|||
# Determine binlog position of cloned data, if any.
|
||||
if [[ -f xtrabackup_slave_info && "x$(<xtrabackup_slave_info)" != "x" ]]; then
|
||||
# XtraBackup already generated a partial "CHANGE MASTER TO" query
|
||||
# because we're cloning from an existing slave. (Need to remove the tailing semicolon!)
|
||||
# because we're cloning from an existing replica. (Need to remove the tailing semicolon!)
|
||||
cat xtrabackup_slave_info | sed -E 's/;$//g' > change_master_to.sql.in
|
||||
# Ignore xtrabackup_binlog_info in this case (it's useless).
|
||||
rm -f xtrabackup_slave_info xtrabackup_binlog_info
|
||||
elif [[ -f xtrabackup_binlog_info ]]; then
|
||||
# We're cloning directly from master. Parse binlog position.
|
||||
# We're cloning directly from primary. Parse binlog position.
|
||||
[[ `cat xtrabackup_binlog_info` =~ ^(.*?)[[:space:]]+(.*?)$ ]] || exit 1
|
||||
rm -f xtrabackup_binlog_info xtrabackup_slave_info
|
||||
echo "CHANGE MASTER TO MASTER_LOG_FILE='${BASH_REMATCH[1]}',\
|
||||
|
|
|
@ -260,7 +260,7 @@ L'utilisation des deux peut garantir que le trafic n'atteigne pas un conteneur q
|
|||
* `periodSeconds`: La fréquence (en secondes) à laquelle la probe doit être effectuée. La valeur par défaut est de 10 secondes. La valeur minimale est de 1.
|
||||
* `timeoutSeconds`: Nombre de secondes après lequel la probe time out. Valeur par défaut à 1 seconde. La valeur minimale est de 1.
|
||||
* `successThreshold`: Le minimum de succès consécutifs pour que la probe soit considérée comme réussie après avoir échoué. La valeur par défaut est 1. Doit être 1 pour la liveness probe. La valeur minimale est de 1.
|
||||
* `failureThreshold`: Quand un Pod démarre et que la probe échoue, Kubernetes va tenter pour un temps de `failureThreshold` avant d'abandonner. Abandonner en cas de liveness probe signifie le redémarrage du conteneur. En cas de readiness probe, le Pod sera marqué Unready.
|
||||
* `failureThreshold`: Quand un Pod démarre et que la probe échoue, Kubernetes va tenter `failureThreshold` fois avant d'abandonner. Abandonner en cas de liveness probe signifie le redémarrage du conteneur. En cas de readiness probe, le Pod sera marqué Unready.
|
||||
La valeur par défaut est 3, la valeur minimum est 1.
|
||||
|
||||
[HTTP probes](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#httpgetaction-v1-core)
|
||||
|
|
|
@ -46,7 +46,7 @@ kubectl get services --all-namespaces --field-selector metadata.namespace!=defa
|
|||
下記の`kubectl`コマンドは、`status.phase`が`Runnning`でなく、かつ`spec.restartPolicy`フィールドが`Always`に等しいような全てのPodを選択します。
|
||||
|
||||
```shell
|
||||
kubectl get statefulsets,services --all-namespaces --field-selector metadata.namespace!=default
|
||||
kubectl get pods --field-selector=status.phase!=Running,spec.restartPolicy=Always
|
||||
```
|
||||
|
||||
## 複数のリソースタイプ
|
||||
|
|
|
@ -65,7 +65,7 @@ spec:
|
|||
command:
|
||||
- powershell.exe
|
||||
- -command
|
||||
- "<#code used from https://gist.github.com/wagnerandrade/5424431#> ; $$listener = New-Object System.Net.HttpListener ; $$listener.Prefixes.Add('http://*:80/') ; $$listener.Start() ; $$callerCounts = @{} ; Write-Host('Listening at http://*:80/') ; while ($$listener.IsListening) { ;$$context = $$listener.GetContext() ;$$requestUrl = $$context.Request.Url ;$$clientIP = $$context.Request.RemoteEndPoint.Address ;$$response = $$context.Response ;Write-Host '' ;Write-Host('> {0}' -f $$requestUrl) ; ;$$count = 1 ;$$k=$$callerCounts.Get_Item($$clientIP) ;if ($$k -ne $$null) { $$count = $$k } ;$$callerCounts.Set_Item($$clientIP, $$count) ;$$ip=(Get-NetAdapter | Get-NetIpAddress); $$header='<html><body><H1>Windows Container Web Server</H1>' ;$$callerCountsString='' ;$$callerCounts.Keys | % { $$callerCountsString='<p>IP {0} callerCount {1} ' -f $$ip[1].IPAddress,$$callerCounts.Item($$_) } ;$$footer='</body></html>' ;$$content='{0}{1}{2}' -f $$header,$$callerCountsString,$$footer ;Write-Output $$content ;$$buffer = [System.Text.Encoding]::UTF8.GetBytes($$content) ;$$response.ContentLength64 = $$buffer.Length ;$$response.OutputStream.Write($$buffer, 0, $$buffer.Length) ;$$response.Close() ;$$responseStatus = $$response.StatusCode ;Write-Host('< {0}' -f $$responseStatus) } ; "
|
||||
- "<#code used from https://gist.github.com/19WAS85/5424431#> ; $$listener = New-Object System.Net.HttpListener ; $$listener.Prefixes.Add('http://*:80/') ; $$listener.Start() ; $$callerCounts = @{} ; Write-Host('Listening at http://*:80/') ; while ($$listener.IsListening) { ;$$context = $$listener.GetContext() ;$$requestUrl = $$context.Request.Url ;$$clientIP = $$context.Request.RemoteEndPoint.Address ;$$response = $$context.Response ;Write-Host '' ;Write-Host('> {0}' -f $$requestUrl) ; ;$$count = 1 ;$$k=$$callerCounts.Get_Item($$clientIP) ;if ($$k -ne $$null) { $$count = $$k } ;$$callerCounts.Set_Item($$clientIP, $$count) ;$$ip=(Get-NetAdapter | Get-NetIpAddress); $$header='<html><body><H1>Windows Container Web Server</H1>' ;$$callerCountsString='' ;$$callerCounts.Keys | % { $$callerCountsString='<p>IP {0} callerCount {1} ' -f $$ip[1].IPAddress,$$callerCounts.Item($$_) } ;$$footer='</body></html>' ;$$content='{0}{1}{2}' -f $$header,$$callerCountsString,$$footer ;Write-Output $$content ;$$buffer = [System.Text.Encoding]::UTF8.GetBytes($$content) ;$$response.ContentLength64 = $$buffer.Length ;$$response.OutputStream.Write($$buffer, 0, $$buffer.Length) ;$$response.Close() ;$$responseStatus = $$response.StatusCode ;Write-Host('< {0}' -f $$responseStatus) } ; "
|
||||
nodeSelector:
|
||||
kubernetes.io/os: windows
|
||||
```
|
||||
|
|
|
@ -96,7 +96,17 @@ weight: 30
|
|||
컨트롤러가 있다.
|
||||
[클러스터 오토스케일링](/ko/docs/tasks/administer-cluster/cluster-management/#클러스터-오토스케일링)을 본다.)
|
||||
|
||||
## 원하는 상태와 현재 상태 {#desired-vs-current}
|
||||
여기서 중요한 점은 컨트롤러가 의도한 상태를 가져오기 위해 약간의 변화를 주고,
|
||||
현재 상태를 클러스터의 API 서버에 다시 보고한다는 것이다.
|
||||
다른 컨트롤 루프는 보고된 데이터를 관찰하고 자체 조치를 할 수 있다.
|
||||
|
||||
온도 조절기 예에서 방이 매우 추우면 다른 컨트롤러가
|
||||
서리 방지 히터를 켤 수도 있다. 쿠버네티스 클러스터에서는
|
||||
[쿠버네티스 확장](/ko/docs/concepts/extend-kubernetes/)을 통해
|
||||
IP 주소 관리 도구, 스토리지 서비스, 클라우드 제공자 APIS 및
|
||||
기타 서비스 등과 간접적으로 연동하여 이를 구현한다.
|
||||
|
||||
## 의도한 상태와 현재 상태 {#desired-vs-current}
|
||||
|
||||
쿠버네티스는 클라우드-네이티브 관점에서 시스템을 관찰하며, 지속적인
|
||||
변화에 대응할 수 있다.
|
||||
|
|
|
@ -47,7 +47,7 @@ no_list: true
|
|||
|
||||
* [쿠버네티스 컨테이너 환경](/ko/docs/concepts/containers/container-environment/)은 쿠버네티스 노드에서 Kubelet으로 관리하는 컨테이너에 대한 환경을 설명한다.
|
||||
|
||||
* [쿠버네티스 API에 대한 접근 제어](/ko/docs/reference/access-authn-authz/controlling-access/)는 사용자와 서비스 어카운트에 대한 권한을 설정하는 방법을 설명한다.
|
||||
* [쿠버네티스 API에 대한 접근 제어](/ko/docs/concepts/security/controlling-access)는 쿠버네티스가 자체 API에 대한 접근 제어를 구현하는 방법을 설명한다.
|
||||
|
||||
* [인증](/docs/reference/access-authn-authz/authentication/)은 다양한 인증 옵션을 포함한 쿠버네티스에서의 인증에 대해 설명한다.
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ weight: 60
|
|||
이 섹션에서는, 쿠버네티스에서 표준 출력 스트림으로 데이터를
|
||||
출력하는 기본 로깅의 예시를 볼 수 있다. 이 데모에서는
|
||||
일부 텍스트를 초당 한 번씩 표준 출력에 쓰는 컨테이너와 함께
|
||||
[파드 명세](/examples/debug/counter-pod.yaml)를 사용한다.
|
||||
파드 명세를 사용한다.
|
||||
|
||||
{{< codenew file="debug/counter-pod.yaml" >}}
|
||||
|
||||
|
|
|
@ -122,6 +122,10 @@ Azure CNI는 [Azure 쿠버네티스 서비스(Azure Kubernetes Service, AKS)](ht
|
|||
|
||||
가트너는 최신의 [매직 쿼드런트(Magic Quadrant)](https://go.bigswitch.com/17GatedDocuments-MagicQuadrantforDataCenterNetworking_Reg.html)에서 BCF를 비저너리(Visionary)로 인정했다. BCF 쿠버네티스 온-프레미스 디플로이먼트 중 하나(지리적으로 다른 리전에 걸쳐 여러 DC에서 실행되는 쿠버네티스, DC/OS 및 VMware 포함)도 [여기](https://portworx.com/architects-corner-kubernetes-satya-komala-nio/)에서 사례로 참조된다.
|
||||
|
||||
### 캘리코
|
||||
|
||||
[캘리코](https://docs.projectcalico.org/)는 컨테이너, 가상 시스템 및 기본 호스트 기반 워크로드를 위한 오픈소스 네트워킹 및 네트워크 보안 솔루션이다. 캘리코는 순수 리눅스 eBPF 데이터플레인, 표준 리눅스 네트워킹 데이터플레인, 윈도우 HNS 데이터플레인을 포함한 여러 데이터플레인을 지원한다. 캘리코는 완전한 네트워킹 스택을 제공하지만, [클라우드 제공자 CNI](https://docs.projectcalico.org/networking/determine-best-networking#calico-compatible-cni-plugins-and-cloud-provider-integrations)와 함께 사용하여 네트워크 정책 시행을 제공할 수도 있다.
|
||||
|
||||
### 실리움(Cilium)
|
||||
|
||||
[실리움](https://github.com/cilium/cilium)은 애플리케이션 컨테이너 간에
|
||||
|
@ -289,14 +293,6 @@ OVN은 Open vSwitch 커뮤니티에서 개발한 오픈소스 네트워크
|
|||
[ovn-kubernetes](https://github.com/openvswitch/ovn-kubernetes)에
|
||||
특정 쿠버네티스 플러그인 및 문서가 있다.
|
||||
|
||||
### 프로젝트 캘리코
|
||||
|
||||
[프로젝트 캘리코](https://docs.projectcalico.org/)는 오픈소스 컨테이너 네트워킹 공급자 및 네트워크 정책 엔진이다.
|
||||
|
||||
캘리코는 리눅스(오픈소스)와 윈도우(독점 - [Tigera](https://www.tigera.io/essentials/)에서 사용 가능) 모두에서 인터넷과 동일한 IP 네트워킹 원칙을 기반으로 쿠버네티스 파드를 연결하기 위한 확장성이 뛰어난 네트워킹 및 네트워크 정책 솔루션을 제공한다. 캘리코는 캡슐화나 오버레이 없이 구축되어 고성능의 대규모 데이터센터 네트워킹을 제공할 수 있다. 또한 캘리코는 분산 방화벽을 통해 쿠버네티스 파드에 대해 세분화된 의도기반의 네트워크 보안 정책을 제공한다.
|
||||
|
||||
캘리코는 플라넬, 일명 [canal](https://github.com/tigera/canal) 또는 네이티브 GCE, AWS나 Azure 네트워킹과 같은 다른 네트워킹 솔루션과 함께 정책 적용 모드로 실행될 수도 있다.
|
||||
|
||||
### 로마나
|
||||
|
||||
[로마나](https://romana.io)는 오버레이 네트워크 없이 쿠버네티스를 배포할 수 있는 오픈소스 네트워크 및 보안 자동화 솔루션이다. 로마나는 쿠버네티스 [네트워크 폴리시](/ko/docs/concepts/services-networking/network-policies/)를 지원하여 네트워크 네임스페이스에서 격리를 제공한다.
|
||||
|
|
|
@ -97,6 +97,14 @@ some_counter 0
|
|||
|
||||
릴리스 `1.12` 에서 `1.13` 으로 업그레이드 중이지만, `1.12` 에서 사용 중단된 메트릭 `A` 를 사용하고 있다면, 커맨드 라인에서 `--show-hidden-metrics=1.12` 플래그로 히든 메트릭을 설정해야 하고, `1.14` 로 업그레이드하기 전에 이 메트릭을 사용하지 않도록 의존성을 제거하는 것을 기억해야 한다.
|
||||
|
||||
## 액셀러레이터 메트릭 비활성화
|
||||
|
||||
kubelet은 cAdvisor를 통해 액셀러레이터 메트릭을 수집한다. NVIDIA GPU와 같은 액셀러레이터의 경우, 이러한 메트릭을 수집하기 위해 kubelet은 드라이버에 열린 핸들을 가진다. 이는 인프라 변경(예: 드라이버 업데이트)을 수행하기 위해 클러스터 관리자가 kubelet 에이전트를 중지해야 함을 의미한다.
|
||||
|
||||
액셀러레이터 메트릭을 수집하는 책임은 이제 kubelet이 아닌 공급 업체에 있다. 공급 업체는 메트릭을 수집하여 메트릭 서비스(예: 프로메테우스)에 노출할 컨테이너를 제공해야 한다.
|
||||
|
||||
[`DisableAcceleratorUsageMetrics` 기능 게이트](/ko/docs/reference/command-line-tools-reference/feature-gates/#알파-또는-베타-기능을-위한-기능-게이트:~:text= DisableAcceleratorUsageMetrics,-false)는 [이 기능을 기본적으로 사용하도록 설정하는 타임라인](https://github.com/kubernetes/enhancements/tree/411e51027db842355bd489691af897afc1a41a5e/keps/sig-node/1867-disable-accelerator-usage-metrics#graduation-criteria)를 사용하여 kubelet에서 수집한 메트릭을 비활성화한다.
|
||||
|
||||
## 컴포넌트 메트릭
|
||||
|
||||
### kube-controller-manager 메트릭
|
||||
|
|
|
@ -12,51 +12,380 @@ weight: 30
|
|||
|
||||
쿠버네티스 시크릿을 사용하면 비밀번호, OAuth 토큰, ssh 키와 같은
|
||||
민감한 정보를 저장하고 관리할 수 있다. 기밀 정보를 시크릿에 저장하는 것이
|
||||
{{< glossary_tooltip term_id="pod" text="파드" >}} 정의나
|
||||
{{< glossary_tooltip text="컨테이너 이미지" term_id="image" >}} 내에 그대로 두는 것보다 안전하고 유연하다. 자세한 내용은 [시크릿 디자인 문서](https://git.k8s.io/community/contributors/design-proposals/auth/secrets.md)를 참고한다.
|
||||
|
||||
{{< glossary_tooltip term_id="pod" >}} 정의나
|
||||
{{< glossary_tooltip text="컨테이너 이미지" term_id="image" >}}
|
||||
내에 그대로 두는 것보다 안전하고 유연하다.
|
||||
자세한 내용은 [시크릿 디자인 문서](https://git.k8s.io/community/contributors/design-proposals/auth/secrets.md)를 참고한다.
|
||||
|
||||
시크릿은 암호, 토큰 또는 키와 같은 소량의 중요한 데이터를
|
||||
포함하는 오브젝트이다. 그렇지 않으면 이러한 정보가 파드
|
||||
명세나 이미지에 포함될 수 있다. 사용자는 시크릿을 만들 수 있고 시스템도
|
||||
일부 시크릿을 만들 수 있다.
|
||||
|
||||
<!-- body -->
|
||||
|
||||
## 시크릿 개요
|
||||
|
||||
시크릿은 비밀번호, 토큰 또는 키와 같은 소량의
|
||||
민감한 데이터를 포함하는 오브젝트이다. 그렇지 않으면 이러한 정보가
|
||||
파드 명세 또는 이미지에 포함될 수 있다. 사용자는 시크릿을 생성할 수 있으며 시스템도
|
||||
일부 시크릿을 생성한다.
|
||||
|
||||
시크릿을 사용하려면, 파드가 시크릿을 참조해야 한다.
|
||||
시크릿은 세 가지 방법으로 파드와 함께 사용할 수 있다.
|
||||
|
||||
- 하나 이상의 컨테이너에 마운트된
|
||||
{{< glossary_tooltip text="볼륨" term_id="volume" >}} 내의
|
||||
[파일](#시크릿을-파드의-파일로-사용하기)로써 사용.
|
||||
{{< glossary_tooltip text="볼륨" term_id="volume" >}} 내의
|
||||
[파일](#시크릿을-파드의-파일로-사용하기)로써 사용.
|
||||
- [컨테이너 환경 변수](#시크릿을-환경-변수로-사용하기)로써 사용.
|
||||
- 파드의 [이미지를 가져올 때 kubelet](#imagepullsecrets-사용하기)에 의해 사용.
|
||||
|
||||
시크릿 오브젝트의 이름은 유효한
|
||||
[DNS 서브도메인 이름](/docs/concepts/overview/working-with-objects/names#dns-subdomain-names)이어야 한다.
|
||||
사용자는 시크릿을 위한 파일을 구성할 때 `data` 및 (또는) `stringData` 필드를
|
||||
명시할 수 있다. 해당 `data` 와 `stringData` 필드는 선택적으로 명시할 수 있다.
|
||||
`data` 필드의 모든 키(key)에 해당하는 값(value)은 base64로 인코딩된 문자열이어야 한다.
|
||||
만약 사용자에게 base64로의 문자열 변환이 적합하지 않다면,
|
||||
임의의 문자열을 값으로 받는 `stringData` 필드를 대신 사용할 수 있다.
|
||||
|
||||
`data` 와 `stringData` 의 키는 영숫자 및 `-`, `_` 또는 `.` 으로
|
||||
구성되어야 한다.
|
||||
`data` 및 `stringData`의 키는 영숫자 문자,
|
||||
`-`, `_`, 또는 `.` 으로 구성되어야 한다. `stringData` 필드의 모든 키-값 쌍은 의도적으로
|
||||
`data` 필드로 합쳐진다. 만약 키가 `data` 와 `stringData` 필드 모두에 정의되어
|
||||
있으면, `stringData` 필드에 지정된 값이
|
||||
우선적으로 사용된다.
|
||||
|
||||
### 빌트인 시크릿
|
||||
## 시크릿 타입 {#secret-types}
|
||||
|
||||
#### 서비스 어카운트는 API 자격 증명으로 시크릿을 자동으로 생성하고 연결함
|
||||
시크릿을 생성할 때, [`Secret`](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#secret-v1-core)
|
||||
리소스의 `type` 필드를 사용하거나, (활용 가능하다면) `kubectl` 의
|
||||
유사한 특정 커맨드라인 플래그를 사용하여 시크릿의 타입을 명시할 수 있다.
|
||||
시크릿 타입은 시크릿 데이터의 프로그래믹 처리를 촉진시키기 위해 사용된다.
|
||||
|
||||
쿠버네티스는 API 접근을 위한 자격 증명이 포함된
|
||||
시크릿을 자동으로 생성하고 이러한 유형의 시크릿을 사용하도록 파드를 자동으로
|
||||
수정한다.
|
||||
쿠버네티스는 일반적인 사용 시나리오를 위해 몇 가지 빌트인 타입을 제공한다.
|
||||
이 타입은 쿠버네티스가 부과하여 수행되는 검증 및 제약에
|
||||
따라 달라진다.
|
||||
|
||||
원하는 경우 API 자격 증명의 자동 생성 및 사용을 비활성화하거나
|
||||
오버라이드할 수 있다. 그러나, API 서버에 안전하게 접근하기만 하면 되는 경우,
|
||||
자동 생성 및 사용이 권장되는 워크플로이다.
|
||||
| 빌트인 타입 | 사용처 |
|
||||
|--------------|-------|
|
||||
| `Opaque` | 임의의 사용자 정의 데이터 |
|
||||
| `kubernetes.io/service-account-token` | 서비스 어카운트 토큰 |
|
||||
| `kubernetes.io/dockercfg` | 직렬화 된(serialized) `~/.dockercfg` 파일 |
|
||||
| `kubernetes.io/dockerconfigjson` | 직렬화 된 `~/.docker/config.json` 파일 |
|
||||
| `kubernetes.io/basic-auth` | 기본 인증을 위한 자격 증명(credential) |
|
||||
| `kubernetes.io/ssh-auth` | SSH를 위한 자격 증명 |
|
||||
| `kubernetes.io/tls` | TLS 클라이언트나 서버를 위한 데이터 |
|
||||
| `bootstrap.kubernetes.io/token` | 부트스트랩 토큰 데이터 |
|
||||
|
||||
서비스 어카운트 작동 방식에 대한 자세한 내용은
|
||||
[서비스어카운트(ServiceAccount)](/docs/tasks/configure-pod-container/configure-service-account/) 문서를 참고한다.
|
||||
사용자는 시크릿 오브젝트의 `type` 값에 비어 있지 않은 문자열을 할당하여 자신만의 시크릿
|
||||
타입을 정의하고 사용할 수 있다. 비어 있는 문자열은 `Opaque` 타입으로 인식된다.
|
||||
쿠버네티스는 타입 명칭에 제약을 부과하지는 않는다. 그러나 만약
|
||||
빌트인 타입 중 하나를 사용한다면, 해당 타입에 정의된 모든 요구 사항을
|
||||
만족시켜야 한다.
|
||||
|
||||
### 시크릿 생성하기
|
||||
### 불투명(Opaque) 시크릿
|
||||
|
||||
`Opaque` 은 시크릿 구성 파일에서 누락된 경우의 기본 시크릿 타입이다.
|
||||
`kubectl` 을 사용하여 시크릿을 생성할 때 `Opaque` 시크릿 타입을 나타내기
|
||||
위해서는 `generic` 하위 커맨드를 사용할 것이다. 예를 들어, 다음 커맨드는
|
||||
타입 `Opaque` 의 비어 있는 시크릿을 생성한다.
|
||||
|
||||
```shell
|
||||
kubectl create secret generic empty-secret
|
||||
kubectl get secret empty-secret
|
||||
```
|
||||
|
||||
출력은 다음과 같다.
|
||||
|
||||
```
|
||||
NAME TYPE DATA AGE
|
||||
empty-secret Opaque 0 2m6s
|
||||
```
|
||||
|
||||
해당 `DATA` 열은 시크릿에 저장된 데이터 아이템의 수를 보여준다.
|
||||
이 경우, `0` 은 비어 있는 시크릿을 방금 하나 생성하였다는 것을 의미한다.
|
||||
|
||||
### 서비스 어카운트 토큰 시크릿
|
||||
|
||||
`kubernetes.io/service-account-token` 시크릿 타입은 서비스 어카운트를 확인하는 토큰을 저장하기 위해서 사용한다. 이 시크릿 타입을 사용할 때는,
|
||||
`kubernetes.io/service-account.name` 어노테이션이 존재하는 서비스
|
||||
어카운트 이름으로 설정되도록 해야 한다. 쿠버네티스 컨트롤러는
|
||||
`kubernetes.io/service-account.uid` 및 실제 토큰
|
||||
콘텐츠로 설정된 `data` 필드의 `token` 키와 같은,
|
||||
몇 가지 다른 필드들을 채운다.
|
||||
|
||||
다음은 서비스 어카운트 토큰 시크릿의 구성 예시이다.
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: secret-sa-sample
|
||||
annotations:
|
||||
kubernetes.io/service-account.name: "sa-name"
|
||||
type: kubernetes.io/service-account-token
|
||||
data:
|
||||
# 사용자는 불투명 시크릿을 사용하므로 추가적인 키 값 쌍을 포함할 수 있다.
|
||||
extra: YmFyCg==
|
||||
```
|
||||
|
||||
`Pod` 를 생성할 때, 쿠버네티스는 자동으로 서비스 어카운트 시크릿을
|
||||
생성하고 자동으로 파드가 해당 시크릿을 사용하도록 수정한다. 해당 서비스
|
||||
어카운트 토큰 시크릿은 API 접속을 위한 자격 증명을 포함한다.
|
||||
|
||||
이러한 API 자격 증명의 자동 생성과 사용은 원하는 경우 해제하거나
|
||||
기각할 수 있다. 그러나 만약 사용자가 API 서버에 안전하게 접근하는 것만
|
||||
필요하다면, 이것이 권장되는 워크플로우이다.
|
||||
|
||||
[서비스 어카운트](/docs/tasks/configure-pod-container/configure-service-account/) 문서를 보면
|
||||
서비스 어카운트가 동작하는 방법에 대한 더 자세한 정보를 얻을 수 있다.
|
||||
또한 파드에서 서비스 어카운트를 참조하는 방법을
|
||||
[`Pod`](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#secret-v1-core)의
|
||||
`automountServiceAccountToken` 필드와 `serviceAccountName`
|
||||
필드를 통해 확인할 수 있다.
|
||||
|
||||
### 도커 컨피그 시크릿
|
||||
|
||||
이미지에 대한 도커 레지스트리 접속 자격 증명을 저장하기 위한
|
||||
시크릿을 생성하기 위해서 다음의 `type` 값 중 하나를 사용할 수 있다.
|
||||
|
||||
- `kubernetes.io/dockercfg`
|
||||
- `kubernetes.io/dockerconfigjson`
|
||||
|
||||
`kubernetes.io/dockercfg` 는 직렬화 된 도커 커맨드라인 구성을
|
||||
위한 기존(legacy) 포맷 `~/.dockercfg` 를 저장하기 위해 할당된 타입이다.
|
||||
시크릿 타입을 사용할 때는, `data` 필드가 base64 포맷으로
|
||||
인코딩된 `~/.dockercfg` 파일의 콘텐츠를 값으로 가지는 `.dockercfg` 키를 포함하고 있는지
|
||||
확실히 확인해야 한다.
|
||||
|
||||
`kubernetes/dockerconfigjson` 타입은 `~/.dockercfg` 의
|
||||
새로운 포맷인 `~/.docker/config.json` 파일과 동일한 포맷 법칙을
|
||||
따르는 직렬화 된 JSON의 저장을 위해 디자인되었다.
|
||||
이 시크릿 타입을 사용할 때는, 시크릿 오브젝트의 `data` 필드가 `.dockerconfigjson` 키를
|
||||
꼭 포함해야 한다. `~/.docker/config.json` 파일을 위한 콘텐츠는
|
||||
base64로 인코딩된 문자열으로 제공되어야 한다.
|
||||
|
||||
아래는 시크릿의 `kubernetes.io/dockercfg` 타입 예시이다.
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: secret-dockercfg
|
||||
type: kubernetes.io/dockercfg
|
||||
data:
|
||||
.dockercfg: |
|
||||
"<base64 encoded ~/.dockercfg file>"
|
||||
```
|
||||
|
||||
{{< note >}}
|
||||
만약 base64 인코딩 수행을 원하지 않는다면, 그 대신 `stringData` 필드의
|
||||
사용을 선택할 수 있다.
|
||||
{{< /note >}}
|
||||
|
||||
이러한 타입들을 매니페스트를 사용하여 생성하는 경우, API
|
||||
서버는 해당 `data` 필드에 기대하는 키가 존재하는지 확인하고,
|
||||
제공된 값이 유효한 JSON으로 파싱될 수 있는지 검증한다. API
|
||||
서버가 해당 JSON이 실제 도커 컨피그 파일인지를 검증하지는 않는다.
|
||||
|
||||
도커 컨피그 파일을 가지고 있지 않거나 도커 레지스트리 시크릿을 생성하기
|
||||
위해 `kubectl` 을 사용하고 싶은 경우, 다음과 같이 처리할 수 있다.
|
||||
|
||||
```shell
|
||||
kubectl create secret docker-registry secret-tiger-docker \
|
||||
--docker-username=tiger \
|
||||
--docker-password=pass113 \
|
||||
--docker-email=tiger@acme.com
|
||||
```
|
||||
|
||||
이 커맨드는 `kubernetes.io/dockerconfigjson` 타입의 시크릿을 생성한다.
|
||||
만약 `data` 필드로부터 `.dockerconfigjson` 콘텐츠를 복사(dump)해오면,
|
||||
다음과 같이 유효한 도커 JSON 콘텐츠를
|
||||
즉석에서 얻게 될 것이다.
|
||||
|
||||
```json
|
||||
{
|
||||
"auths": {
|
||||
"https://index.docker.io/v1/": {
|
||||
"username": "tiger",
|
||||
"password": "pass113",
|
||||
"email": "tiger@acme.com",
|
||||
"auth": "dGlnZXI6cGFzczExMw=="
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 기본 인증 시크릿
|
||||
|
||||
`kubernetes.io/basic-auth` 타입은 기본 인증을 위한 자격 증명을 저장하기
|
||||
위해 제공된다. 이 시크릿 타입을 사용할 때는 시크릿의 `data` 필드가
|
||||
다음의 두 키를 포함해야 한다.
|
||||
|
||||
- `username`: 인증을 위한 사용자 이름
|
||||
- `password`: 인증을 위한 암호나 토큰
|
||||
|
||||
위의 두 키에 대한 두 값은 모두 base64로 인코딩된 문자열이다. 물론,
|
||||
시크릿 생성 시 `stringData` 를 사용하여 평문 텍스트 콘텐츠(clear text content)를 제공할
|
||||
수도 있다.
|
||||
|
||||
다음의 YAML은 기본 인증 시크릿을 위한 구성 예시이다.
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: secret-basic-auth
|
||||
type: kubernetes.io/basic-auth
|
||||
stringData:
|
||||
username: admin
|
||||
password: t0p-Secret
|
||||
```
|
||||
|
||||
이 기본 인증 시크릿 타입은 사용자 편의만을 위해서 제공된다.
|
||||
사용자는 기본 인증에서 사용되는 자격 증명을 위한 `Opaque` 를 생성할 수도 있다.
|
||||
그러나, 빌트인 시크릿 타입을 사용하는 것은 사용자의 자격 증명들의 포맷을 통합하는 데 도움이 되고,
|
||||
API 서버는 요구되는 키가 시크릿 구성에서 제공되고 있는지
|
||||
검증도 한다.
|
||||
|
||||
### SSH 인증 시크릿
|
||||
|
||||
이 빌트인 타입 `kubernetes.io/ssh-auth` 는 SSH 인증에 사용되는 데이터를
|
||||
저장하기 위해서 제공된다. 이 시크릿 타입을 사용할 때는 `ssh-privatekey`
|
||||
키-값 쌍을 사용할 SSH 자격 증명으로 `data` (또는 `stringData`)
|
||||
필드에 명시해야 할 것이다.
|
||||
|
||||
다음 YAML은 SSH 인증 시크릿의 구성 예시이다.
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: secret-ssh-auth
|
||||
type: kubernetes.io/ssh-auth
|
||||
data:
|
||||
# 본 예시를 위해 축약된 데이터임
|
||||
ssh-privatekey: |
|
||||
MIIEpQIBAAKCAQEAulqb/Y ...
|
||||
```
|
||||
|
||||
SSH 인증 시크릿 타입은 사용자 편의만을 위해서 제공된다.
|
||||
사용자는 SSH 인증에서 사용되는 자격 증명을 위한 `Opaque` 를 생성할 수도 있다.
|
||||
그러나, 빌트인 시크릿 타입을 사용하는 것은 사용자의 자격 증명들의 포맷을 통합하는 데 도움이 되고,
|
||||
API 서버는 요구되는 키가 시크릿 구성에서 제공되고 있는지
|
||||
검증도 한다.
|
||||
|
||||
### TLS 시크릿
|
||||
|
||||
쿠버네티스는 보통 TLS를 위해 사용되는 인증서와 관련된 키를 저장하기 위해서
|
||||
빌트인 시크릿 타입 `kubernetes.io/tls` 를 제공한다.
|
||||
이 데이터는 인그레스 리소스의 TLS 종료에 주로 사용되지만, 다른
|
||||
리소스나 워크로드에 의해 직접적으로 사용될 수도 있다.
|
||||
이 타입의 시크릿을 사용할 때는 `tls.key` 와 `tls.crt` 키가 시크릿 구성의
|
||||
`data` (또는 `stringData`) 필드에서 제공되어야 한다. 그러나, API
|
||||
서버가 각 키에 대한 값이 유효한지 실제로 검증하지는 않는다.
|
||||
|
||||
다음 YAML은 TLS 시크릿을 위한 구성 예시를 포함한다.
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: secret-tls
|
||||
type: kubernetes.io/tls
|
||||
data:
|
||||
# 본 예시를 위해 축약된 데이터임
|
||||
tls.crt: |
|
||||
MIIC2DCCAcCgAwIBAgIBATANBgkqh ...
|
||||
tls.key: |
|
||||
MIIEpgIBAAKCAQEA7yn3bRHQ5FHMQ ...
|
||||
```
|
||||
|
||||
TLS 시크릿 타입은 사용자 편의만을 위해서 제공된다. 사용자는 TLS 서버 및/또는
|
||||
클라이언트를 위해 사용되는 자격 증명을 위한 `Opaque` 를 생성할 수도 있다. 그러나, 빌트인
|
||||
시크릿 타입을 사용하는 것은 사용자의 자격 증명들의 포맷을 통합하는 데 도움이 되고,
|
||||
API 서버는 요구되는 키가 시크릿 구성에서 제공되고 있는지 검증도 한다.
|
||||
|
||||
`kubectl` 를 사용하여 TLS 시크릿을 생성할 때, `tls` 하위 커맨드를
|
||||
다음 예시와 같이 사용할 수 있다.
|
||||
|
||||
```shell
|
||||
kubectl create secret tls my-tls-secret \
|
||||
--cert=path/to/cert/file \
|
||||
--key=path/to/key/file
|
||||
```
|
||||
|
||||
공개/개인 키 쌍은 사전에 존재해야 한다. `--cert` 를 위한 공개 키 인증서는
|
||||
.PEM 으로 인코딩(Base64로 인코딩된 DER 포맷)되어야 하며, `--key` 를 위해 주어진
|
||||
개인 키에 맞아야 한다.
|
||||
개인 키는 일반적으로 PEM 개인 키 포맷이라고 하는,
|
||||
암호화되지 않은 형태(unencrypted)이어야 한다. 두 가지 방식 모두에 대해서, PEM의
|
||||
시작과 끝 라인(예를 들면, 인증서의 `--------BEGIN CERTIFICATE-----` 및 `-------END CERTIFICATE----`)
|
||||
은 포함되면 *안* 된다.
|
||||
|
||||
### 부트스트랩 토큰 시크릿
|
||||
|
||||
부트스트랩 토큰 시크릿은 시크릿 `type` 을 `bootstrap.kubernetes.io/token` 으로
|
||||
명확하게 지정하면 생성할 수 있다. 이 타입의 시크릿은 노드 부트스트랩 과정 중에 사용되는
|
||||
토큰을 위해 디자인되었다. 이것은 잘 알려진 컨피그맵에 서명하는 데 사용되는
|
||||
토큰을 저장한다.
|
||||
|
||||
부트스트랩 토큰 시크릿은 보통 `kube-system` 네임스페이스에 생성되며
|
||||
`<token-id>` 가 해당 토큰 ID의 6개 문자의 문자열으로 구성된 `bootstrap-token-<token-id>` 형태로
|
||||
이름이 지정된다.
|
||||
|
||||
쿠버네티스 매니페스트로서, 부트스트렙 토큰 시크릿은 다음과 유사할
|
||||
것이다.
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: bootstrap-token-5emitj
|
||||
namespace: kube-system
|
||||
type: bootstrap.kubernetes.io/token
|
||||
data:
|
||||
auth-extra-groups: c3lzdGVtOmJvb3RzdHJhcHBlcnM6a3ViZWFkbTpkZWZhdWx0LW5vZGUtdG9rZW4=
|
||||
expiration: MjAyMC0wOS0xM1QwNDozOToxMFo=
|
||||
token-id: NWVtaXRq
|
||||
token-secret: a3E0Z2lodnN6emduMXAwcg==
|
||||
usage-bootstrap-authentication: dHJ1ZQ==
|
||||
usage-bootstrap-signing: dHJ1ZQ==
|
||||
```
|
||||
|
||||
부트스트랩 타입은 `data` 아래 명시된 다음의 키들을 가진다.
|
||||
|
||||
- `token_id`: 토큰 식별자로 임의의 6개 문자의 문자열. 필수 사항.
|
||||
- `token-secret`: 실제 토큰 시크릿으로 임의의 16개 문자의 문자열. 필수 사항.
|
||||
- `description1`: 토큰의 사용처를 설명하는 사람이 읽을 수 있는
|
||||
문자열. 선택 사항.
|
||||
- `expiration`: 토큰이 만료되어야 하는 시기를 명시한 RFC3339를
|
||||
사용하는 절대 UTC 시간. 선택 사항.
|
||||
- `usage-bootstrap-<usage>`: 부트스트랩 토큰의 추가적인 사용처를 나타내는
|
||||
불리언(boolean) 플래그.
|
||||
- `auth-extra-groups`: system:bootstrappers 그룹에 추가로 인증될
|
||||
쉼표로 구분된 그룹 이름 목록.
|
||||
|
||||
위의 YAML은 모두 base64로 인코딩된 문자열 값이므로 혼란스러워 보일
|
||||
수 있다. 사실은 다음 YAML을 사용하여 동일한 시크릿 오브젝트 결과를 만드는
|
||||
동일한 시크릿을 생성할 수 있다.
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
# 시크릿 이름이 어떻게 지정되었는지 확인
|
||||
name: bootstrap-token-5emitj
|
||||
# 부트스트랩 토큰 시크릿은 일반적으로 kube-system 네임스페이스에 포함
|
||||
namespace: kube-system
|
||||
type: bootstrap.kubernetes.io/token
|
||||
stringData:
|
||||
auth-extra-groups: "system:bootstrappers:kubeadm:default-node-token"
|
||||
expiration: "2020-09-13T04:39:10Z"
|
||||
# 이 토큰 ID는 이름에 사용됨
|
||||
token-id: "5emitj"
|
||||
token-secret: "kq4gihvszzgn1p0r"
|
||||
# 이 토큰은 인증을 위해서 사용될 수 있음
|
||||
usage-bootstrap-authentication: "true"
|
||||
# 또한 서명(signing)에도 사용될 수 있음
|
||||
usage-bootstrap-signing: "true"
|
||||
```
|
||||
|
||||
## 시크릿 생성하기
|
||||
|
||||
시크릿을 생성하기 위한 몇 가지 옵션이 있다.
|
||||
|
||||
|
@ -64,7 +393,7 @@ weight: 30
|
|||
- [구성 파일로 시크릿 생성하기](/docs/tasks/configmap-secret/managing-secret-using-config-file/)
|
||||
- [kustomize를 사용하여 시크릿 생성하기](/docs/tasks/configmap-secret/managing-secret-using-kustomize/)
|
||||
|
||||
### 시크릿 편집하기
|
||||
## 시크릿 편집하기
|
||||
|
||||
기존 시크릿은 다음 명령을 사용하여 편집할 수 있다.
|
||||
|
||||
|
@ -791,11 +1120,11 @@ spec:
|
|||
HTTP 요청을 처리하고, 복잡한 비즈니스 로직을 수행한 다음, HMAC이 있는 일부 메시지에
|
||||
서명해야 하는 프로그램을 고려한다. 애플리케이션 로직이
|
||||
복잡하기 때문에, 서버에서 눈에 띄지 않는 원격 파일 읽기 공격이
|
||||
있을 수 있으며, 이로 인해 프라이빗 키가 공격자에게 노출될 수 있다.
|
||||
있을 수 있으며, 이로 인해 개인 키가 공격자에게 노출될 수 있다.
|
||||
|
||||
이는 두 개의 컨테이너의 두 개 프로세스로 나눌 수 있다. 사용자 상호 작용과
|
||||
비즈니스 로직을 처리하지만, 프라이빗 키를 볼 수 없는 프론트엔드 컨테이너와
|
||||
프라이빗 키를 볼 수 있고, 프론트엔드의 간단한 서명 요청(예를 들어, localhost 네트워킹을 통해)에
|
||||
비즈니스 로직을 처리하지만, 개인 키를 볼 수 없는 프론트엔드 컨테이너와
|
||||
개인 키를 볼 수 있고, 프론트엔드의 간단한 서명 요청(예를 들어, localhost 네트워킹을 통해)에
|
||||
응답하는 서명자 컨테이너로 나눌 수 있다.
|
||||
|
||||
이 분할된 접근 방식을 사용하면, 공격자는 이제 애플리케이션 서버를 속여서
|
||||
|
|
|
@ -61,9 +61,9 @@ weight: 10
|
|||
|
||||
`imagePullPolicy` 가 특정값 없이 정의되면, `Always` 로 설정된다.
|
||||
|
||||
## 매니페스트가 있는 다중 아키텍처 이미지
|
||||
## 이미지 인덱스가 있는 다중 아키텍처 이미지
|
||||
|
||||
바이너리 이미지를 제공할 뿐만 아니라, 컨테이너 레지스트리는 컨테이너 [이미지 매니페스트](https://github.com/opencontainers/image-spec/blob/master/manifest.md)를 제공할 수도 있다. 매니페스트는 아키텍처별 버전의 컨테이너에 대한 이미지 매니페스트를 참조할 수 있다. 아이디어는 이미지의 이름(예를 들어, `pause`, `example/mycontainer`, `kube-apiserver`)을 가질 수 있다는 것이다. 그래서 다른 시스템들이 사용하고 있는 컴퓨터 아키텍처에 적합한 바이너리 이미지를 가져올 수 있다.
|
||||
바이너리 이미지를 제공할 뿐만 아니라, 컨테이너 레지스트리는 [컨테이너 이미지 인덱스](https://github.com/opencontainers/image-spec/blob/master/image-index.md)를 제공할 수도 있다. 이미지 인덱스는 컨테이너의 아키텍처별 버전에 대한 여러 [이미지 매니페스트](https://github.com/opencontainers/image-spec/blob/master/manifest.md)를 가리킬 수 있다. 아이디어는 이미지의 이름(예를 들어, `pause`, `example/mycontainer`, `kube-apiserver`)을 가질 수 있다는 것이다. 그래서 다른 시스템들이 사용하고 있는 컴퓨터 아키텍처에 적합한 바이너리 이미지를 가져올 수 있다.
|
||||
|
||||
쿠버네티스 자체는 일반적으로 `-$(ARCH)` 접미사로 컨테이너 이미지의 이름을 지정한다. 이전 버전과의 호환성을 위해, 접미사가 있는 오래된 이미지를 생성한다. 아이디어는 모든 아키텍처에 대한 매니페스트가 있는 `pause` 이미지와 이전 구성 또는 이전에 접미사로 이미지를 하드 코딩한 YAML 파일과 호환되는 `pause-amd64` 라고 하는 이미지를 생성한다.
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ API를 추가해도 기존 API(예: 파드)의 동작에 직접 영향을 미치
|
|||
|
||||
### API 접근 익스텐션
|
||||
|
||||
요청이 쿠버네티스 API 서버에 도달하면 먼저 인증이 되고, 그런 다음 승인된 후 다양한 유형의 어드미션 컨트롤이 적용된다. 이 흐름에 대한 자세한 내용은 [쿠버네티스 API에 대한 접근 제어](/ko/docs/reference/access-authn-authz/controlling-access/)를 참고하길 바란다.
|
||||
요청이 쿠버네티스 API 서버에 도달하면 먼저 인증이 되고, 그런 다음 승인된 후 다양한 유형의 어드미션 컨트롤이 적용된다. 이 흐름에 대한 자세한 내용은 [쿠버네티스 API에 대한 접근 제어](/ko/docs/concepts/security/controlling-access/)를 참고하길 바란다.
|
||||
|
||||
이러한 각 단계는 익스텐션 포인트를 제공한다.
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ weight: 10
|
|||
<!-- body -->
|
||||
## 커스텀 리소스
|
||||
|
||||
*리소스* 는 [쿠버네티스 API](/ko/docs/reference/using-api/api-overview/)에서 특정 종류의
|
||||
*리소스* 는 [쿠버네티스 API](/ko/docs/concepts/overview/kubernetes-api/)에서 특정 종류의
|
||||
[API 오브젝트](/ko/docs/concepts/overview/working-with-objects/kubernetes-objects/) 모음을 저장하는 엔드포인트이다. 예를 들어 빌트인 *파드* 리소스에는 파드 오브젝트 모음이 포함되어 있다.
|
||||
|
||||
*커스텀 리소스* 는 쿠버네티스 API의 익스텐션으로, 기본 쿠버네티스 설치에서 반드시
|
||||
|
|
|
@ -127,7 +127,7 @@ API를 추가해도 기존 API(예: 파드)의 동작에 직접 영향을 미치
|
|||
|
||||
### API 접근 익스텐션
|
||||
|
||||
요청이 쿠버네티스 API 서버에 도달하면 먼저 인증이 되고, 그런 다음 승인된 후 다양한 유형의 어드미션 컨트롤이 적용된다. 이 흐름에 대한 자세한 내용은 [쿠버네티스 API에 대한 접근 제어](/ko/docs/reference/access-authn-authz/controlling-access/)를 참고하길 바란다.
|
||||
요청이 쿠버네티스 API 서버에 도달하면 먼저 인증이 되고, 그런 다음 승인된 후 다양한 유형의 어드미션 컨트롤이 적용된다. 이 흐름에 대한 자세한 내용은 [쿠버네티스 API에 대한 접근 제어](/ko/docs/concepts/security/controlling-access/)를 참고하길 바란다.
|
||||
|
||||
이러한 각 단계는 익스텐션 포인트를 제공한다.
|
||||
|
||||
|
|
|
@ -227,7 +227,7 @@ spec:
|
|||
|
||||
* 만약 당신이 {{< glossary_tooltip text="Helm Charts" term_id="helm-chart" >}}에 익숙하다면, 당신의 쿠버네티스 클러스터에 [Helm을 이용하여 서비스 카탈로그를 설치](/docs/tasks/service-catalog/install-service-catalog-using-helm/)할 수 있다. 다른 방법으로 [SC tool을 이용하여 서비스 카탈로그를 설치](/docs/tasks/service-catalog/install-service-catalog-using-sc/)할 수 있다.
|
||||
* [샘플 서비스 브로커](https://github.com/openservicebrokerapi/servicebroker/blob/master/gettingStarted.md#sample-service-brokers) 살펴보기
|
||||
* [kubernetes-incubator/service-catalog](https://github.com/kubernetes-incubator/service-catalog) 프로젝트 탐색
|
||||
* [kubernetes-sigs/service-catalog](https://github.com/kubernetes-sigs/service-catalog) 프로젝트 탐색
|
||||
* [svc-cat.io](https://svc-cat.io/docs/) 살펴보기
|
||||
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ card:
|
|||
|
||||
대부분의 작업은 [kubectl](/docs/reference/kubectl/overview/)
|
||||
커맨드 라인 인터페이스 또는 API를 사용하는
|
||||
[kubeadm](/docs/reference/setup-tools/kubeadm/kubeadm/)과
|
||||
[kubeadm](/ko/docs/reference/setup-tools/kubeadm/)과
|
||||
같은 다른 커맨드 라인 도구를 통해 수행할 수 있다.
|
||||
그러나, REST 호출을 사용하여 API에 직접 접근할 수도 있다.
|
||||
|
||||
|
@ -101,8 +101,20 @@ API가 시스템 리소스 및 동작에 대한 명확하고 일관된 보기를
|
|||
제어할 수 있도록 한다.
|
||||
|
||||
보다 쉽게 발전하고 API를 확장하기 위해, 쿠버네티스는
|
||||
[활성화 또는 비활성화](/ko/docs/reference/using-api/api-overview/#api-그룹-활성화-또는-비활성화-하기)가
|
||||
가능한 [API 그룹](/ko/docs/reference/using-api/api-overview/#api-그룹)을 구현한다.
|
||||
[활성화 또는 비활성화](/ko/docs/reference/using-api/#api-그룹-활성화-또는-비활성화)가
|
||||
가능한 [API 그룹](/ko/docs/reference/using-api/#api-그룹)을 구현한다.
|
||||
|
||||
API 리소스는 API 그룹, 리소스 유형, 네임스페이스
|
||||
(네임스페이스 리소스용) 및 이름으로 구분된다. API 서버는
|
||||
여러 API 버전을 통해 동일한 기본 데이터를 제공하고 API 버전 간의
|
||||
변환을 투명하게 처리할 수 있다. 이 모든 다른 버전은 실제로
|
||||
같은 리소스의 표현이다. 예를 들어 동일한 리소스에 대해
|
||||
두 가지 버전 `v1`과 `v1beta1`이 있다고 가정해 보자.
|
||||
`v1beta1` 버전에서 생성된 오브젝트를 `v1beta1` 또는 `v1` 버전에서
|
||||
읽기, 업데이트 및 삭제할 수 있다.
|
||||
|
||||
API 버전 수준 정의에 대한 자세한 내용은
|
||||
[API 버전 레퍼런스](/ko/docs/reference/using-api/#api-버전-규칙)를 참조한다.
|
||||
|
||||
API 리소스는 해당 API 그룹, 리소스 유형, 네임스페이스
|
||||
(네임스페이스 리소스용) 및 이름으로 구분된다. API 서버는 여러 API 버전을 통해 동일한
|
||||
|
@ -129,7 +141,7 @@ API 버전 수준 정의에 대한 자세한 내용은
|
|||
|
||||
- 자체 [CustomResourceDefinition](/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/)을
|
||||
추가하여 쿠버네티스 API를 확장하는 방법에 대해 배우기.
|
||||
- [API 접근 제어하기](/ko/docs/reference/access-authn-authz/controlling-access/)는
|
||||
- [쿠버네티스 API 접근 제어하기](/ko/docs/concepts/security/controlling-access/)는
|
||||
클러스터가 API 접근을 위한 인증 및 권한을 관리하는 방법을 설명한다.
|
||||
- [API 레퍼런스](/docs/reference/kubernetes-api/)를
|
||||
읽고 API 엔드포인트, 리소스 유형 및 샘플에 대해 배우기.
|
||||
|
|
|
@ -35,7 +35,7 @@ sitemap:
|
|||
|
||||
각 VM은 가상화된 하드웨어 상에서 자체 운영체제를 포함한 모든 구성 요소를 실행하는 하나의 완전한 머신이다.
|
||||
|
||||
**컨테이너 개발 시대:** 컨테이너는 VM과 유사하지만 격리 속성을 완화하여 애플리케이션 간에 운영체제(OS)를 공유한다. 그러므로 컨테이너는 가볍다고 여겨진다. VM과 마찬가지로 컨테이너에는 자체 파일 시스템, CPU, 메모리, 프로세스 공간 등이 있다. 기본 인프라와의 종속성을 끊었기 때문에, 클라우드나 OS 배포본에 모두 이식할 수 있다.
|
||||
**컨테이너 개발 시대:** 컨테이너는 VM과 유사하지만 격리 속성을 완화하여 애플리케이션 간에 운영체제(OS)를 공유한다. 그러므로 컨테이너는 가볍다고 여겨진다. VM과 마찬가지로 컨테이너에는 자체 파일 시스템, CPU 점유율, 메모리, 프로세스 공간 등이 있다. 기본 인프라와의 종속성을 끊었기 때문에, 클라우드나 OS 배포본에 모두 이식할 수 있다.
|
||||
|
||||
컨테이너는 다음과 같은 추가적인 혜택을 제공하기 때문에 인기가 있다.
|
||||
|
||||
|
|
|
@ -91,6 +91,7 @@ deployment.apps/nginx-deployment created
|
|||
|
||||
## {{% heading "whatsnext" %}}
|
||||
|
||||
* API 개념의 더 많은 설명은 [Kubernetes API 개요](/ko/docs/reference/using-api/api-overview/)를 본다.
|
||||
|
||||
* [파드](/ko/docs/concepts/workloads/pods/)와 같이, 가장 중요하고 기본적인 쿠버네티스 오브젝트에 대해 배운다.
|
||||
* 쿠버네티스의 [컨트롤러](/ko/docs/concepts/architecture/controller/)에 대해 배운다.
|
||||
* API 개념의 더 많은 설명은 [쿠버네티스 API 사용](/ko/docs/reference/using-api/)을 본다.
|
||||
|
|
|
@ -185,7 +185,7 @@ kubectl get pods -l 'environment,environment notin (frontend)'
|
|||
[`services`](/ko/docs/concepts/services-networking/service/) 와
|
||||
[`replicationcontrollers`](/ko/docs/concepts/workloads/controllers/replicationcontroller/)와 같은
|
||||
일부 쿠버네티스 오브젝트는 레이블 셀렉터를 사용해서
|
||||
[파드](/ko/docs/concepts/workloads/pods/pod/)와 같은 다른 리소스 집합을 선택한다.
|
||||
[파드](/ko/docs/concepts/workloads/pods/)와 같은 다른 리소스 집합을 선택한다.
|
||||
|
||||
#### 서비스와 레플리케이션 컨트롤러
|
||||
|
||||
|
|
|
@ -138,12 +138,16 @@ RBAC 바인딩에 대한 자세한 예는,
|
|||
### 문제 해결
|
||||
|
||||
- [컨트롤러 관리자](/docs/reference/command-line-tools-reference/kube-controller-manager/)는
|
||||
[보안 API 포트](/ko/docs/reference/access-authn-authz/controlling-access/)에 대해 실행해야 하며,
|
||||
슈퍼유저 권한이 없어야 한다. 그렇지 않으면 요청이 인증 및 권한 부여 모듈을 우회하고,
|
||||
모든 파드시큐리티폴리시 오브젝트가 허용되며
|
||||
사용자는 특권있는 컨테이너를 만들 수 있다. 컨트롤러 관리자 권한 구성에 대한 자세한
|
||||
내용은 [컨트롤러 역할](/docs/reference/access-authn-authz/rbac/#controller-roles)을
|
||||
참고하길 바란다.
|
||||
보안 API 포트에 대해 실행되어야 하며 수퍼유저 권한이 없어야 한다.
|
||||
API 서버 접근 제어에 대한 자세한 내용은
|
||||
[쿠버네티스 API에 대한 접근 제어](/ko/docs/concepts/security/controlling-access)를 참고하길 바란다.
|
||||
컨트롤러 관리자가 신뢰할 수 있는 API 포트(`localhost` 리스너라고도 함)를
|
||||
통해 연결된 경우, 요청이 인증 및 권한 부여 모듈을 우회하고,
|
||||
모든 파드시큐리티폴리시 오브젝트가 허용되며 사용자는 특권을 가진 컨테이너를
|
||||
만들 수 있는 권한을 부여할 수 있다.
|
||||
|
||||
컨트롤러 관리자 권한 구성에 대한 자세한 내용은
|
||||
[컨트롤러 역할](/docs/reference/access-authn-authz/rbac/#controller-roles)을 참고하기 바란다.
|
||||
|
||||
## 정책 순서
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ weight: 10
|
|||
|
||||
`ResourceQuota` 오브젝트로 정의된 리소스 쿼터는 네임스페이스별 총 리소스 사용을 제한하는
|
||||
제약 조건을 제공한다. 유형별로 네임스페이스에서 만들 수 있는 오브젝트 수와
|
||||
해당 프로젝트의 리소스가 사용할 수 있는 총 컴퓨트 리소스의 양을
|
||||
해당 네임스페이스의 리소스가 사용할 수 있는 총 컴퓨트 리소스의 양을
|
||||
제한할 수 있다.
|
||||
|
||||
리소스 쿼터는 다음과 같이 작동한다.
|
||||
|
@ -23,10 +23,10 @@ weight: 10
|
|||
- 다른 팀은 다른 네임스페이스에서 작동한다. 현재 이것은 자발적이지만 ACL을 통해 이 필수 사항을
|
||||
적용하기 위한 지원이 계획되어 있다.
|
||||
|
||||
- 관리자는 각 네임스페이스에 대해 하나의 `ResourceQuota`를 생성한다.
|
||||
- 관리자는 각 네임스페이스에 대해 하나의 리소스쿼터를 생성한다.
|
||||
|
||||
- 사용자는 네임스페이스에서 리소스(파드, 서비스 등)를 생성하고 쿼터 시스템은
|
||||
사용량을 추적하여 `ResourceQuota`에 정의된 하드(hard) 리소스 제한을 초과하지 않도록 한다.
|
||||
사용량을 추적하여 리소스쿼터에 정의된 하드(hard) 리소스 제한을 초과하지 않도록 한다.
|
||||
|
||||
- 리소스를 생성하거나 업데이트할 때 쿼터 제약 조건을 위반하면 위반된 제약 조건을 설명하는
|
||||
메시지와 함께 HTTP 상태 코드 `403 FORBIDDEN`으로 요청이 실패한다.
|
||||
|
@ -38,7 +38,7 @@ weight: 10
|
|||
이 문제를 회피하는 방법에 대한 예제는
|
||||
[연습](/ko/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/)을 참고하길 바란다.
|
||||
|
||||
`ResourceQuota` 오브젝트의 이름은 유효한
|
||||
리소스쿼터 오브젝트의 이름은 유효한
|
||||
[DNS 서브도메인 이름](/ko/docs/concepts/overview/working-with-objects/names#dns-서브도메인-이름)이어야 한다.
|
||||
|
||||
네임스페이스와 쿼터를 사용하여 만들 수 있는 정책의 예는 다음과 같다.
|
||||
|
@ -59,7 +59,7 @@ weight: 10
|
|||
API 서버 `--enable-admission-plugins=` 플래그의 인수 중 하나로
|
||||
`ResourceQuota`가 있는 경우 활성화된다.
|
||||
|
||||
해당 네임스페이스에 `ResourceQuota`가 있는 경우 특정 네임스페이스에
|
||||
해당 네임스페이스에 리소스쿼터가 있는 경우 특정 네임스페이스에
|
||||
리소스 쿼터가 적용된다.
|
||||
|
||||
## 컴퓨트 리소스 쿼터
|
||||
|
@ -70,10 +70,14 @@ API 서버 `--enable-admission-plugins=` 플래그의 인수 중 하나로
|
|||
|
||||
| 리소스 이름 | 설명 |
|
||||
| --------------------- | ----------------------------------------------------------- |
|
||||
| `limits.cpu` | 터미널이 아닌 상태의 모든 파드에서 CPU 제한의 합은 이 값을 초과할 수 없음 |
|
||||
| `limits.memory` | 터미널이 아닌 상태의 모든 파드에서 메모리 제한의 합은 이 값을 초과할 수 없음 |
|
||||
| `requests.cpu` | 터미널이 아닌 상태의 모든 파드에서 CPU 요청의 합은 이 값을 초과할 수 없음 |
|
||||
| `requests.memory` | 터미널이 아닌 상태의 모든 파드에서 메모리 요청의 합은 이 값을 초과할 수 없음 |
|
||||
| `limits.cpu` | 터미널이 아닌 상태의 모든 파드에서 CPU 제한의 합은 이 값을 초과할 수 없음. |
|
||||
| `limits.memory` | 터미널이 아닌 상태의 모든 파드에서 메모리 제한의 합은 이 값을 초과할 수 없음. |
|
||||
| `requests.cpu` | 터미널이 아닌 상태의 모든 파드에서 CPU 요청의 합은 이 값을 초과할 수 없음. |
|
||||
| `requests.memory` | 터미널이 아닌 상태의 모든 파드에서 메모리 요청의 합은 이 값을 초과할 수 없음. |
|
||||
| `hugepages-<size>` | 터미널 상태가 아닌 모든 파드에 걸쳐서, 지정된 사이즈의
|
||||
휴즈 페이지 요청은 이 값을 초과하지 못함. |
|
||||
| `cpu` | `requests.cpu` 와 같음. |
|
||||
| `memory` | `requests.memory` 와 같음. |
|
||||
|
||||
### 확장된 리소스에 대한 리소스 쿼터
|
||||
|
||||
|
@ -103,7 +107,7 @@ GPU 리소스를 다음과 같이 쿼터를 정의할 수 있다.
|
|||
| `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/#퍼시스턴트볼륨클레임) 수 |
|
||||
| `<storage-class-name>.storageclass.storage.k8s.io/persistentvolumeclaims` | `<storage-class-name>` 과 관련된 모든 퍼시스턴트 볼륨 클레임에서 네임스페이스에 존재할 수 있는 총 [퍼시스턴트 볼륨 클레임](/ko/docs/concepts/storage/persistent-volumes/#퍼시스턴트볼륨클레임) 수 |
|
||||
|
||||
예를 들어, 운영자가 `bronze` 스토리지 클래스와 별도로 `gold` 스토리지 클래스를 사용하여 스토리지에 쿼터를 지정하려는 경우 운영자는 다음과 같이
|
||||
쿼터를 정의할 수 있다.
|
||||
|
@ -115,14 +119,17 @@ GPU 리소스를 다음과 같이 쿼터를 정의할 수 있다.
|
|||
|
||||
| 리소스 이름 | 설명 |
|
||||
| ------------------------------- |----------------------------------------------------------- |
|
||||
| `requests.ephemeral-storage` | 네임스페이스의 모든 파드에서 로컬 임시 스토리지 요청의 합은 이 값을 초과할 수 없음 |
|
||||
| `limits.ephemeral-storage` | 네임스페이스의 모든 파드에서 로컬 임시 스토리지 제한의 합은 이 값을 초과할 수 없음 |
|
||||
| `requests.ephemeral-storage` | 네임스페이스의 모든 파드에서 로컬 임시 스토리지 요청의 합은 이 값을 초과할 수 없음. |
|
||||
| `limits.ephemeral-storage` | 네임스페이스의 모든 파드에서 로컬 임시 스토리지 제한의 합은 이 값을 초과할 수 없음. |
|
||||
| `ephemeral-storage` | `requests.ephemeral-storage` 와 같음. |
|
||||
|
||||
## 오브젝트 수 쿼터
|
||||
|
||||
1.9 릴리스는 다음 구문을 사용하여 모든 표준 네임스페이스 리소스 유형에 쿼터를 지정하는 지원을 추가했다.
|
||||
다음 구문을 사용하여 모든 표준 네임스페이스 처리된(namespaced) 리소스 유형에 대한
|
||||
특정 리소스 전체 수에 대하여 쿼터를 지정할 수 있다.
|
||||
|
||||
* `count/<resource>.<group>`
|
||||
* 코어 그룹이 아닌(non-core) 리소스를 위한 `count/<resource>.<group>`
|
||||
* 코어 그룹의 리소스를 위한 `count/<resource>`
|
||||
|
||||
다음은 사용자가 오브젝트 수 쿼터 아래에 배치하려는 리소스 셋의 예이다.
|
||||
|
||||
|
@ -136,32 +143,29 @@ GPU 리소스를 다음과 같이 쿼터를 정의할 수 있다.
|
|||
* `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 릴리스 이전에는 제한된 리소스 셋에서 일반 오브젝트 수 쿼터를 적용할 수 있었다.
|
||||
또한, 특정 리소스에 대한 쿼터를 유형별로 추가로 제한할 수 있다.
|
||||
컨트롤러가 시작되지 않을 수 있다. 잘못 구성된 크론 잡으로부터의 보호를 위해
|
||||
잡의 쿼터를 설정할 수 있다. 네임스페이스 내에서 너무 많은 잡을 생성하는 크론 잡은 서비스 거부를 유발할 수 있다.
|
||||
|
||||
또한 제한된 리소스 셋에 대해서 일반 오브젝트 수(generic object count) 쿼터를 적용하는 것도 가능하다.
|
||||
다음 유형이 지원된다.
|
||||
|
||||
| 리소스 이름 | 설명 |
|
||||
| ------------------------------- | ------------------------------------------------- |
|
||||
| `configmaps` | 네임스페이스에 존재할 수 있는 총 구성 맵 수 |
|
||||
| `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) 수 |
|
||||
| `replicationcontrollers` | 네임스페이스에 존재할 수 있는 총 레플리케이션컨트롤러 수 |
|
||||
| `resourcequotas` | 네임스페이스에 존재할 수 있는 총 리소스쿼터 수 |
|
||||
| `services` | 네임스페이스에 존재할 수 있는 총 서비스 수 |
|
||||
| `services.loadbalancers` | 네임스페이스에 존재할 수 있는 로드 밸런서 유형의 총 서비스 수 |
|
||||
| `services.nodeports` | 네임스페이스에 존재할 수 있는 노드 포트 유형의 총 서비스 수 |
|
||||
| `services.loadbalancers` | 네임스페이스에 존재할 수 있는 `LoadBalancer` 유형의 총 서비스 수 |
|
||||
| `services.nodeports` | 네임스페이스에 존재할 수 있는 `NodePort` 유형의 총 서비스 수 |
|
||||
| `secrets` | 네임스페이스에 존재할 수 있는 총 시크릿 수 |
|
||||
|
||||
예를 들어, `pods` 쿼터는 터미널이 아닌 단일 네임스페이스에서 생성된 `pods` 수를
|
||||
|
@ -171,7 +175,7 @@ GPU 리소스를 다음과 같이 쿼터를 정의할 수 있다.
|
|||
|
||||
## 쿼터 범위
|
||||
|
||||
각 쿼터에는 연결된 범위 셋이 있을 수 있다. 쿼터는 열거된 범위의 교차 부분과 일치하는 경우에만
|
||||
각 쿼터에는 연결된 `scopes` 셋이 있을 수 있다. 쿼터는 열거된 범위의 교차 부분과 일치하는 경우에만
|
||||
리소스 사용량을 측정한다.
|
||||
|
||||
범위가 쿼터에 추가되면 해당 범위와 관련된 리소스를 지원하는 리소스 수가 제한된다.
|
||||
|
@ -183,22 +187,60 @@ GPU 리소스를 다음과 같이 쿼터를 정의할 수 있다.
|
|||
| `NotTerminating` | `.spec.activeDeadlineSeconds is nil`에 일치하는 파드 |
|
||||
| `BestEffort` | 최상의 서비스 품질을 제공하는 파드 |
|
||||
| `NotBestEffort` | 서비스 품질이 나쁜 파드 |
|
||||
| `PriorityClass` | 지정된 [프라이올리티 클래스](/docs/concepts/configuration/pod-priority-preemption)를 참조하여 일치하는 파드. |
|
||||
|
||||
`BestEffort` 범위는 다음의 리소스(파드)를 추적하도록 쿼터를 제한한다.
|
||||
`BestEffort` 범위는 다음의 리소스를 추적하도록 쿼터를 제한한다.
|
||||
|
||||
`Terminating`, `NotTerminating` 및 `NotBestEffort` 범위는 쿼터를 제한하여 다음의 리소스를 추적한다.
|
||||
|
||||
* `cpu`
|
||||
* `limits.cpu`
|
||||
* `limits.memory`
|
||||
* `memory`
|
||||
* `pods`
|
||||
|
||||
`Terminating`, `NotTerminating`, `NotBestEffort` 및 `PriorityClass`
|
||||
범위는 쿼터를 제한하여 다음의 리소스를 추적한다.
|
||||
|
||||
* `pods`
|
||||
* `cpu`
|
||||
* `memory`
|
||||
* `requests.cpu`
|
||||
* `requests.memory`
|
||||
* `limits.cpu`
|
||||
* `limits.memory`
|
||||
|
||||
`Terminating` 과 `NotTerminating` 범위를 동일한 쿼터 내에 모두
|
||||
명시하지는 못하며, 마찬가지로 `BestEffort` 와
|
||||
`NotBestEffort` 범위도 동일한 쿼터 내에서 모두 명시하지는 못한다.
|
||||
|
||||
`scopeSelector` 는 `operator` 필드에 다음의 값을 지원한다.
|
||||
|
||||
* `In`
|
||||
* `NotIn`
|
||||
* `Exists`
|
||||
* `DoesNotExist`
|
||||
|
||||
`scopeSelector` 를 정의할 때, `scopeName` 으로 다음의 값 중 하나를 사용하는
|
||||
경우, `operator` 는 `Exists` 이어야 한다.
|
||||
|
||||
* `Terminating`
|
||||
* `NotTerminating`
|
||||
* `BestEffort`
|
||||
* `NotBestEffort`
|
||||
|
||||
만약 `operator` 가 `In` 또는 `NotIn` 인 경우, `values` 필드는 적어도 하나의 값은
|
||||
가져야 한다. 예를 들면 다음과 같다.
|
||||
|
||||
```yaml
|
||||
scopeSelector:
|
||||
matchExpressions:
|
||||
- scopeName: PriorityClass
|
||||
operator: In
|
||||
values:
|
||||
- middle
|
||||
```
|
||||
|
||||
만약 `operator` 가 `Exists` 또는 `DoesNotExist` 이라면, `values` 필드는 명시되면
|
||||
*안된다*.
|
||||
|
||||
### PriorityClass별 리소스 쿼터
|
||||
|
||||
{{< feature-state for_k8s_version="v1.12" state="beta" >}}
|
||||
{{< feature-state for_k8s_version="v1.17" state="stable" >}}
|
||||
|
||||
특정 [우선 순위](/ko/docs/concepts/configuration/pod-priority-preemption/#파드-우선순위)로 파드를 생성할 수 있다.
|
||||
쿼터 스펙의 `scopeSelector` 필드를 사용하여 파드의 우선 순위에 따라 파드의 시스템 리소스 사용을
|
||||
|
@ -281,7 +323,7 @@ items:
|
|||
kubectl create -f ./quota.yml
|
||||
```
|
||||
|
||||
```shell
|
||||
```
|
||||
resourcequota/pods-high created
|
||||
resourcequota/pods-medium created
|
||||
resourcequota/pods-low created
|
||||
|
@ -293,7 +335,7 @@ resourcequota/pods-low created
|
|||
kubectl describe quota
|
||||
```
|
||||
|
||||
```shell
|
||||
```
|
||||
Name: pods-high
|
||||
Namespace: default
|
||||
Resource Used Hard
|
||||
|
@ -358,7 +400,7 @@ kubectl create -f ./high-priority-pod.yml
|
|||
kubectl describe quota
|
||||
```
|
||||
|
||||
```shell
|
||||
```
|
||||
Name: pods-high
|
||||
Namespace: default
|
||||
Resource Used Hard
|
||||
|
@ -386,13 +428,6 @@ memory 0 20Gi
|
|||
pods 0 10
|
||||
```
|
||||
|
||||
`scopeSelector`는 `operator` 필드에서 다음 값을 지원한다.
|
||||
|
||||
* `In`
|
||||
* `NotIn`
|
||||
* `Exist`
|
||||
* `DoesNotExist`
|
||||
|
||||
## 요청과 제한의 비교 {#requests-vs-limits}
|
||||
|
||||
컴퓨트 리소스를 할당할 때 각 컨테이너는 CPU 또는 메모리에 대한 요청과 제한값을 지정할 수 있다.
|
||||
|
@ -456,7 +491,7 @@ kubectl create -f ./object-counts.yaml --namespace=myspace
|
|||
kubectl get quota --namespace=myspace
|
||||
```
|
||||
|
||||
```shell
|
||||
```
|
||||
NAME AGE
|
||||
compute-resources 30s
|
||||
object-counts 32s
|
||||
|
@ -466,7 +501,7 @@ object-counts 32s
|
|||
kubectl describe quota compute-resources --namespace=myspace
|
||||
```
|
||||
|
||||
```shell
|
||||
```
|
||||
Name: compute-resources
|
||||
Namespace: myspace
|
||||
Resource Used Hard
|
||||
|
@ -482,7 +517,7 @@ requests.nvidia.com/gpu 0 4
|
|||
kubectl describe quota object-counts --namespace=myspace
|
||||
```
|
||||
|
||||
```shell
|
||||
```
|
||||
Name: object-counts
|
||||
Namespace: myspace
|
||||
Resource Used Hard
|
||||
|
@ -504,7 +539,7 @@ 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
|
||||
kubectl create quota test --hard=count/deployments.apps=2,count/replicasets.apps=4,count/pods=3,count/secrets=4 --namespace=myspace
|
||||
```
|
||||
|
||||
```shell
|
||||
|
@ -515,29 +550,29 @@ kubectl create deployment nginx --image=nginx --namespace=myspace --replicas=2
|
|||
kubectl describe quota --namespace=myspace
|
||||
```
|
||||
|
||||
```shell
|
||||
```
|
||||
Name: test
|
||||
Namespace: myspace
|
||||
Resource Used Hard
|
||||
-------- ---- ----
|
||||
count/deployments.extensions 1 2
|
||||
count/deployments.apps 1 2
|
||||
count/pods 2 3
|
||||
count/replicasets.extensions 1 4
|
||||
count/replicasets.apps 1 4
|
||||
count/secrets 1 4
|
||||
```
|
||||
|
||||
## 쿼터 및 클러스터 용량
|
||||
|
||||
`ResourceQuotas`는 클러스터 용량과 무관하다. 그것들은 절대 단위로 표현된다.
|
||||
리소스쿼터는 클러스터 용량과 무관하다. 그것들은 절대 단위로 표현된다.
|
||||
따라서 클러스터에 노드를 추가해도 각 네임스페이스에 더 많은 리소스를
|
||||
사용할 수 있는 기능이 자동으로 부여되지는 *않는다*.
|
||||
|
||||
가끔 다음과 같은 보다 복잡한 정책이 필요할 수 있다.
|
||||
|
||||
- 여러 팀으로 전체 클러스터 리소스를 비례적으로 나눈다.
|
||||
- 각 테넌트가 필요에 따라 리소스 사용량을 늘릴 수 있지만, 실수로 리소스가 고갈되는 것을
|
||||
막기 위한 충분한 제한이 있다.
|
||||
- 하나의 네임스페이스에서 요구를 감지하고 노드를 추가하며 쿼터를 늘린다.
|
||||
- 여러 팀으로 전체 클러스터 리소스를 비례적으로 나눈다.
|
||||
- 각 테넌트가 필요에 따라 리소스 사용량을 늘릴 수 있지만, 실수로 리소스가 고갈되는 것을
|
||||
막기 위한 충분한 제한이 있다.
|
||||
- 하나의 네임스페이스에서 요구를 감지하고 노드를 추가하며 쿼터를 늘린다.
|
||||
|
||||
이러한 정책은 쿼터 사용을 감시하고 다른 신호에 따라 각 네임스페이스의 쿼터 하드 제한을
|
||||
조정하는 "컨트롤러"를 작성하여 `ResourceQuotas`를 구성 요소로
|
||||
|
@ -548,14 +583,16 @@ count/secrets 1 4
|
|||
|
||||
## 기본적으로 우선 순위 클래스 소비 제한
|
||||
|
||||
파드가 특정 우선 순위, 예를 들어 일치하는 쿼터 오브젝트가 존재하는 경우에만 "cluster-services"가 네임스페이스에 허용되어야 힌다.
|
||||
파드가 특정 우선 순위, 예를 들어 일치하는 쿼터 오브젝트가 존재하는
|
||||
경우에만 "cluster-services"가 네임스페이스에 허용되어야 한다.
|
||||
|
||||
이 메커니즘을 통해 운영자는 특정 우선 순위가 높은 클래스의 사용을 제한된 수의 네임스페이스로 제한할 수 있으며 모든 네임스페이스가 기본적으로 이러한 우선 순위 클래스를 사용할 수 있는 것은 아니다.
|
||||
이 메커니즘을 통해 운영자는 특정 우선 순위가 높은 클래스의 사용을
|
||||
제한된 수의 네임스페이스로 제한할 수 있으며 모든 네임스페이스가
|
||||
기본적으로 이러한 우선 순위 클래스를 사용할 수 있는 것은 아니다.
|
||||
|
||||
이를 적용하려면 kube-apiserver 플래그 `--admission-control-config-file`을 사용하여 다음 구성 파일의 경로를 전달해야 한다.
|
||||
이를 적용하려면 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
|
||||
|
@ -571,30 +608,10 @@ plugins:
|
|||
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:
|
||||
|
@ -603,12 +620,9 @@ plugins:
|
|||
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/)를 참고하길 바란다.
|
||||
|
||||
## {{% heading "whatsnext" %}}
|
||||
|
||||
- 자세한 내용은 [리소스쿼터 디자인 문서](https://git.k8s.io/community/contributors/design-proposals/resource-management/admission_control_resource_quota.md)를 참고하길 바란다.
|
||||
- 자세한 내용은 [리소스쿼터 디자인 문서](https://git.k8s.io/community/contributors/design-proposals/resource-management/admission_control_resource_quota.md)를 참고한다.
|
||||
- [리소스 쿼터를 사용하는 방법에 대한 자세한 예](/docs/tasks/administer-cluster/quota-api-object/)를 참고한다.
|
||||
- [우선 순위 클래스에 대한 쿼터 지원 디자인 문서](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/scheduling/pod-priority-resourcequota.md)를 읽는다.
|
||||
- [제한된 자원](https://github.com/kubernetes/kubernetes/pull/36765)을 참고한다.
|
||||
|
|
|
@ -78,7 +78,7 @@ _스코어링_ 단계에서 스케줄러는 목록에 남아있는 노드의 순
|
|||
방법이 있다.
|
||||
|
||||
1. [스케줄링 정책](/docs/reference/scheduling/config/#profiles)을 사용하면 필터링을 위한 _단정(Predicates)_ 및 스코어링을 위한 _우선순위(Priorities)_ 를 구성할 수 있다.
|
||||
1. [스케줄링 프로파일](/docs/reference/scheduling/profiles)을 사용하면 `QueueSort`, `Filter`, `Score`, `Bind`, `Reserve`, `Permit` 등의 다른 스케줄링 단계를 구현하는 플러그인을 구성할 수 있다. 다른 프로파일을 실행하도록 kube-scheduler를 구성할 수도 있다.
|
||||
1. [스케줄링 프로파일](/docs/reference/scheduling/config/#profiles)을 사용하면 `QueueSort`, `Filter`, `Score`, `Bind`, `Reserve`, `Permit` 등의 다른 스케줄링 단계를 구현하는 플러그인을 구성할 수 있다. 다른 프로파일을 실행하도록 kube-scheduler를 구성할 수도 있다.
|
||||
|
||||
|
||||
## {{% heading "whatsnext" %}}
|
||||
|
@ -88,8 +88,8 @@ _스코어링_ 단계에서 스케줄러는 목록에 남아있는 노드의 순
|
|||
* kube-scheduler의 [레퍼런스 문서](/docs/reference/command-line-tools-reference/kube-scheduler/) 읽기
|
||||
* [멀티 스케줄러 구성하기](/docs/tasks/extend-kubernetes/configure-multiple-schedulers/)에 대해 배우기
|
||||
* [토폴로지 관리 정책](/docs/tasks/administer-cluster/topology-manager/)에 대해 배우기
|
||||
* [파드 오버헤드](/ko/docs/concepts/configuration/pod-overhead/)에 대해 배우기
|
||||
* 볼륨을 사용하느 파드의 스케줄링에 대해 배우기
|
||||
* [파드 오버헤드](/ko/docs/concepts/scheduling-eviction/pod-overhead/)에 대해 배우기
|
||||
* 볼륨을 사용하는 파드의 스케줄링에 대해 배우기
|
||||
* [볼륨 토폴리지 지원](/ko/docs/concepts/storage/storage-classes/#볼륨-바인딩-모드)
|
||||
* [스토리지 용량 추적](/docs/concepts/storage/storage-capacity/)
|
||||
* [노드별 볼륨 한도](/ko/docs/concepts/storage/storage-limits/)
|
||||
|
|
|
@ -102,7 +102,7 @@ etcd 암호화 | 가능한 한 모든 드라이브를 암호화하는 것이 좋
|
|||
워크로드 보안에서 고려할 영역 | 추천 |
|
||||
------------------------------ | ------------ |
|
||||
RBAC 인증(쿠버네티스 API에 대한 접근) | https://kubernetes.io/docs/reference/access-authn-authz/rbac/
|
||||
인증 | https://kubernetes.io/docs/reference/access-authn-authz/controlling-access/
|
||||
인증 | https://kubernetes.io/ko/docs/concepts/security/controlling-access/
|
||||
애플리케이션 시크릿 관리(및 유휴 상태에서의 etcd 암호화 등) | https://kubernetes.io/docs/concepts/configuration/secret/ <br> https://kubernetes.io/docs/tasks/administer-cluster/encrypt-data/
|
||||
파드 보안 정책 | https://kubernetes.io/docs/concepts/policy/pod-security-policy/
|
||||
서비스 품질(및 클러스터 리소스 관리) | https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod/
|
||||
|
@ -146,8 +146,8 @@ TLS를 통한 접근 | 코드가 TCP를 통해 통신해야 한다면, 미리
|
|||
|
||||
* [파드 보안 표준](/docs/concepts/security/pod-security-standards/)
|
||||
* [파드에 대한 네트워크 정책](/ko/docs/concepts/services-networking/network-policies/)
|
||||
* [쿠버네티스 API 접근 제어하기](/ko/docs/concepts/security/controlling-access)
|
||||
* [클러스터 보안](/docs/tasks/administer-cluster/securing-a-cluster/)
|
||||
* [API 접근 통제](/ko/docs/reference/access-authn-authz/controlling-access/)
|
||||
* 컨트롤 플레인을 위한 [전송 데이터 암호화](/docs/tasks/tls/managing-tls-in-a-cluster/)
|
||||
* [Rest에서 데이터 암호화](/docs/tasks/administer-cluster/encrypt-data/)
|
||||
* [쿠버네티스 시크릿](/ko/docs/concepts/configuration/secret/)
|
||||
|
|
|
@ -94,7 +94,7 @@ IPv6가 활성화된 외부 로드 밸런서를 지원하는 클라우드 공급
|
|||
|
||||
## 이그레스 트래픽
|
||||
|
||||
근본적으로 {{< glossary_tooltip text="CNI" term_id="cni" >}} 공급자가 전송을 구현할 수 있는 경우 공개적으로 라우팅 하거나 비공개 라우팅만 가능한 IPv6 주소 블록의 사용은 허용된다. 만약 비공개 라우팅만 가능한 IPv6를 사용하는 파드가 있고, 해당 파드가 오프 클러스터 목적지(예: 공용 인터넷)에 도달하기를 원하는 경우에는 이그레스 트래픽과 모든 응답을 위한 마스커레이딩 IP를 설정해야 한다. [ip-masq-agent](https://github.com/kubernetes-incubator/ip-masq-agent) 는 이중 스택을 인식하기에, 이중 스택 클러스터에서 마스커레이딩 IP에 ip-masq-agent 를 사용할 수 있다.
|
||||
근본적으로 {{< glossary_tooltip text="CNI" term_id="cni" >}} 공급자가 전송을 구현할 수 있는 경우 공개적으로 라우팅 하거나 비공개 라우팅만 가능한 IPv6 주소 블록의 사용은 허용된다. 만약 비공개 라우팅만 가능한 IPv6를 사용하는 파드가 있고, 해당 파드가 오프 클러스터 목적지(예: 공용 인터넷)에 도달하기를 원하는 경우에는 이그레스 트래픽과 모든 응답을 위한 마스커레이딩 IP를 설정해야 한다. [ip-masq-agent](https://github.com/kubernetes-sigs/ip-masq-agent)는 이중 스택을 인식하기에, 이중 스택 클러스터에서 마스커레이딩 IP에 ip-masq-agent를 사용할 수 있다.
|
||||
|
||||
## 알려진 이슈들
|
||||
|
||||
|
|
|
@ -411,6 +411,13 @@ type: kubernetes.io/tls
|
|||
TLS 시크릿이 `https-example.foo.com` 의 정규화 된 도메인 이름(FQDN)이라고
|
||||
하는 일반 이름(CN)을 포함하는 인증서에서 온 것인지 확인해야 한다.
|
||||
|
||||
{{< note >}}
|
||||
가능한 모든 하위 도메인에 대해 인증서가 발급되어야 하기 때문에
|
||||
TLS는 기본 규칙에서 작동하지 않는다. 따라서
|
||||
`tls` 섹션의 `hosts`는 `rules`섹션의 `host`와 명시적으로 일치해야
|
||||
한다.
|
||||
{{< /note >}}
|
||||
|
||||
{{< codenew file="service/networking/tls-example-ingress.yaml" >}}
|
||||
|
||||
{{< note >}}
|
||||
|
|
|
@ -177,27 +177,29 @@ spec:
|
|||
퍼시스턴트볼륨이 존재하고 `claimRef` 필드를 통해 퍼시스턴트볼륨클레임을 예약하지 않은 경우, 퍼시스턴트볼륨 및 퍼시스턴트볼륨클레임이 바인딩된다.
|
||||
|
||||
바인딩은 노드 선호도(affinity)를 포함하여 일부 볼륨 일치(matching) 기준과 관계없이 발생한다.
|
||||
컨트롤 플레인은 여전히 [스토리지 클래스](https://kubernetes.io/ko/docs/concepts/storage/storage-classes/), 접근 모드 및 요청된 스토리지 크기가 유효한지 확인한다.
|
||||
컨트롤 플레인은 여전히 [스토리지 클래스](/ko/docs/concepts/storage/storage-classes/), 접근 모드 및 요청된 스토리지 크기가 유효한지 확인한다.
|
||||
|
||||
```
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: foo-pvc
|
||||
namespace: foo
|
||||
spec:
|
||||
storageClassName: "" # 빈 문자열은 명시적으로 설정해야 하며 그렇지 않으면 기본 스토리지클래스가 설정됨
|
||||
volumeName: foo-pv
|
||||
...
|
||||
```
|
||||
|
||||
이 메서드는 퍼시스턴트볼륨에 대한 바인딩 권한을 보장하지 않는다. 다른 퍼시스턴트볼륨클레임에서 지정한 PV를 사용할 수 있는 경우, 먼저 해당 스토리지 볼륨을 예약해야 한다. PV의 `claimRef` 필드에 관련 퍼시스턴트볼륨클레임을 지정하여 다른 PVC가 바인딩할 수 없도록 한다.
|
||||
|
||||
```
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: foo-pv
|
||||
spec:
|
||||
storageClassName: ""
|
||||
claimRef:
|
||||
name: foo-pvc
|
||||
namespace: foo
|
||||
|
|
|
@ -89,7 +89,7 @@ volumeBindingMode: Immediate
|
|||
등에 대한 완전한 재량권을 가진다. [kubernetes-sigs/sig-storage-lib-external-provisioner](https://github.com/kubernetes-sigs/sig-storage-lib-external-provisioner)
|
||||
리포지터리에는 대량의 사양을 구현하는 외부 프로비저너를 작성하기
|
||||
위한 라이브러리가 있다. 일부 외부 프로비저너의 목록은
|
||||
[kubernetes-incubator/external-storage](https://github.com/kubernetes-incubator/external-storage) 리포지터리에 있다.
|
||||
[kubernetes-sigs/external-storage](https://github.com/kubernetes-sigs/external-dns) 리포지터리에 있다.
|
||||
|
||||
예를 들어, NFS는 내부 프로비저너를 제공하지 않지만, 외부
|
||||
프로비저너를 사용할 수 있다. 타사 스토리지 업체가 자체 외부
|
||||
|
|
|
@ -24,6 +24,8 @@ API 리소스 `PersistentVolume` 및 `PersistentVolumeClaim` 가 사용자 및
|
|||
|
||||
`VolumeSnapshotClass` 을 사용하면 `VolumeSnapshot` 에 속한 다른 속성을 지정할 수 있다. 이러한 속성은 스토리지 시스템에의 동일한 볼륨에서 가져온 스냅샷마다 다를 수 있으므로 `PersistentVolumeClaim` 의 `StorageClass` 를 사용하여 표현할 수는 없다.
|
||||
|
||||
볼륨 스냅샷은 쿠버네티스 사용자에게 완전히 새로운 볼륨을 생성하지 않고도 특정 시점에 볼륨의 콘텐츠를 복사하는 표준화된 방법을 제공한다. 예를 들어, 데이터베이스 관리자는 이 기능을 사용하여 수정 사항을 편집 또는 삭제하기 전에 데이터베이스를 백업할 수 있다.
|
||||
|
||||
사용자는 이 기능을 사용할 때 다음 사항을 알고 있어야 한다.
|
||||
|
||||
* API 객체인 `VolumeSnapshot`, `VolumeSnapshotContent`, `VolumeSnapshotClass` 는 핵심 API가 아닌, {{< glossary_tooltip term_id="CustomResourceDefinition" text="CRDs" >}}이다.
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -32,7 +32,7 @@ no_list: true
|
|||
파드를 실행하기 위한 [데몬셋(DaemonSet)](/ko/docs/concepts/workloads/controllers/daemonset/)
|
||||
* 완료될 때까지 실행되는 작업에 대한
|
||||
[잡(Job)](/ko/docs/concepts/workloads/controllers/job/) 및
|
||||
[크론잡(CronJob)](/ko/docs/concepts/workloads/controllers/cronjob/)
|
||||
[크론잡(CronJob)](/ko/docs/concepts/workloads/controllers/cron-jobs/)
|
||||
|
||||
관련성을 찾을 수 있는 두 가지 지원 개념도 있다.
|
||||
* [가비지(Garbage) 수집](/ko/docs/concepts/workloads/controllers/garbage-collection/)은 _소유하는 리소스_ 가
|
||||
|
|
|
@ -229,7 +229,7 @@ API 버전에 대해서는 `frontend.yaml` 예제의 첫 번째 줄을 참고한
|
|||
|
||||
### 파드 템플릿
|
||||
|
||||
`.spec.template`은 레이블을 붙이도록 되어있는 [파드 템플릿](/ko/docs/concepts/workloads/pods/pod-overview/#파드-템플릿)이다.
|
||||
`.spec.template`은 레이블을 붙이도록 되어있는 [파드 템플릿](/ko/docs/concepts/workloads/pods/#파드-템플릿)이다.
|
||||
우리는 `frontend.yaml` 예제에서 `tier: frontend`이라는 레이블을 하나 가지고 있다.
|
||||
이 파드를 다른 컨트롤러가 취하지 않도록 다른 컨트롤러의 셀렉터와 겹치지 않도록 주의해야 한다.
|
||||
|
||||
|
|
|
@ -77,13 +77,13 @@ UID로 정의된 특정 파드는 다른 노드로 절대 "다시 스케줄"되
|
|||
|
||||
`phase`에 가능한 값은 다음과 같다.
|
||||
|
||||
값 | 의미
|
||||
:-----|:-----------
|
||||
`Pending` | 파드가 쿠버네티스 클러스터에서 승인되었지만, 하나 이상의 컨테이너가 설정되지 않았고 실행할 준비가 되지 않았다. 여기에는 파드가 스케줄되기 이전까지의 시간 뿐만 아니라 네트워크를 통한 컨테이너 이미지 다운로드 시간도 포함된다.
|
||||
`Running` | 파드가 노드에 바인딩되었고, 모든 컨테이너가 생성되었다. 적어도 하나의 컨테이너가 아직 실행 중이거나, 시작 또는 재시작 중에 있다.
|
||||
값 | 의미
|
||||
:-----------|:-----------
|
||||
`Pending` | 파드가 쿠버네티스 클러스터에서 승인되었지만, 하나 이상의 컨테이너가 설정되지 않았고 실행할 준비가 되지 않았다. 여기에는 파드가 스케줄되기 이전까지의 시간 뿐만 아니라 네트워크를 통한 컨테이너 이미지 다운로드 시간도 포함된다.
|
||||
`Running` | 파드가 노드에 바인딩되었고, 모든 컨테이너가 생성되었다. 적어도 하나의 컨테이너가 아직 실행 중이거나, 시작 또는 재시작 중에 있다.
|
||||
`Succeeded` | 파드에 있는 모든 컨테이너들이 성공적으로 종료되었고, 재시작되지 않을 것이다.
|
||||
`Failed` | 파드에 있는 모든 컨테이너가 종료되었고, 적어도 하나 이상의 컨테이너가 실패로 종료되었다. 즉, 해당 컨테이너는 non-zero 상태로 빠져나왔거나(exited) 시스템에 의해서 종료(terminated)되었다.
|
||||
`Unknown` | 어떤 이유에 의해서 파드의 상태를 얻을 수 없다. 이 단계는 일반적으로 파드가 실행되어야 하는 노드와의 통신 오류로 인해 발생한다.
|
||||
`Failed` | 파드에 있는 모든 컨테이너가 종료되었고, 적어도 하나 이상의 컨테이너가 실패로 종료되었다. 즉, 해당 컨테이너는 non-zero 상태로 빠져나왔거나(exited) 시스템에 의해서 종료(terminated)되었다.
|
||||
`Unknown` | 어떤 이유에 의해서 파드의 상태를 얻을 수 없다. 이 단계는 일반적으로 파드가 실행되어야 하는 노드와의 통신 오류로 인해 발생한다.
|
||||
|
||||
노드가 죽거나 클러스터의 나머지와의 연결이 끊어지면, 쿠버네티스는
|
||||
손실된 노드의 모든 파드의 `phase` 를 Failed로 설정하는 정책을 적용한다.
|
||||
|
@ -229,7 +229,8 @@ kubelet은 파드의 [조건](#파드의-조건)을 `ContainerReady` 로 설정
|
|||
## 컨테이너 프로브(probe)
|
||||
|
||||
[프로브](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#probe-v1-core)는
|
||||
컨테이너에서 [kubelet](/docs/admin/kubelet/)에 의해 주기적으로 수행되는 진단(diagnostic)이다.
|
||||
컨테이너에서 [kubelet](/docs/reference/command-line-tools-reference/kubelet/)에 의해
|
||||
주기적으로 수행되는 진단(diagnostic)이다.
|
||||
진단을 수행하기 위해서,
|
||||
kubelet은 컨테이너에 의해서 구현된
|
||||
[핸들러](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#handler-v1-core)를 호출한다.
|
||||
|
|
|
@ -4,11 +4,21 @@ content_type: concept
|
|||
weight: 40
|
||||
---
|
||||
|
||||
{{< feature-state for_k8s_version="v1.19" state="stable" >}}
|
||||
<!-- leave this shortcode in place until the note about EvenPodsSpread is
|
||||
obsolete -->
|
||||
|
||||
<!-- overview -->
|
||||
|
||||
사용자는 _토폴로지 분배 제약 조건_ 을 사용해서 지역, 영역, 노드 그리고 기타 사용자-정의 토폴로지 도메인과 같이 장애-도메인으로 설정된 클러스터에 걸쳐 파드가 분산되는 방식을 제어할 수 있다. 이를 통해 고가용성뿐만 아니라, 효율적인 리소스 활용의 목적을 이루는 데 도움이 된다.
|
||||
|
||||
|
||||
{{< note >}}
|
||||
v1.19 이전 버전의 쿠버네티스에서는 파드 토폴로지 분배 제약조건을 사용하려면
|
||||
[API 서버](/ko/docs/concepts/overview/components/#kube-apiserver)와
|
||||
[스케줄러](/docs/reference/generated/kube-scheduler/)에서
|
||||
`EvenPodsSpread`[기능 게이트](/ko/docs/reference/command-line-tools-reference/feature-gates/)를
|
||||
활성화해야 한다
|
||||
{{< /note >}}
|
||||
|
||||
<!-- body -->
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ weight: 20
|
|||
|
||||
<!-- overview -->
|
||||
|
||||
SIG Docs [승인자](/ko/docs/contribute/participating/roles-and-responsibilites/#승인자)는 리포지터리에 대해 일주일 동안 교대로 [풀 리퀘스트 관리](https://github.com/kubernetes/website/wiki/PR-Wranglers)를 수행한다.
|
||||
SIG Docs [승인자](/ko/docs/contribute/participate/roles-and-responsibilities/#승인자)는 리포지터리에 대해 일주일 동안 교대로 [풀 리퀘스트 관리](https://github.com/kubernetes/website/wiki/PR-Wranglers)를 수행한다.
|
||||
|
||||
이 섹션은 PR 랭글러의 의무에 대해 다룬다. 좋은 리뷰 제공에 대한 자세한 내용은 [Reviewing changes](/ko/docs/contribute/review/)를 참고한다.
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@ content_type: concept
|
|||
|
||||
## API 레퍼런스
|
||||
|
||||
* [쿠버네티스 API 개요](/ko/docs/reference/using-api/api-overview/) - 쿠버네티스 API에 대한 개요
|
||||
* [Kubernetes API 레퍼런스 {{< latest-version >}}](/docs/reference/generated/kubernetes-api/{{< latest-version >}}/)
|
||||
* [쿠버네티스 API 레퍼런스 {{< latest-version >}}](/docs/reference/generated/kubernetes-api/{{< latest-version >}}/)
|
||||
* [쿠버네티스 API 사용](/ko/docs/reference/using-api/) - 쿠버네티스 API에 대한 개요
|
||||
|
||||
## API 클라이언트 라이브러리
|
||||
|
||||
|
@ -34,7 +34,7 @@ content_type: concept
|
|||
|
||||
* [kubectl](/ko/docs/reference/kubectl/overview/) - 명령어를 실행하거나 쿠버네티스 클러스터를 관리하기 위해 사용하는 주된 CLI 도구.
|
||||
* [JSONPath](/docs/reference/kubectl/jsonpath/) - kubectl에서 [JSONPath 표현](https://goessner.net/articles/JsonPath/)을 사용하기 위한 문법 가이드.
|
||||
* [kubeadm](/docs/reference/setup-tools/kubeadm/kubeadm/) - 안정적인 쿠버네티스 클러스터를 쉽게 프로비전하기 위한 CLI 도구.
|
||||
* [kubeadm](/ko/docs/reference/setup-tools/kubeadm/) - 안정적인 쿠버네티스 클러스터를 쉽게 프로비전하기 위한 CLI 도구.
|
||||
|
||||
## 컴포넌트 레퍼런스
|
||||
|
||||
|
|
|
@ -1,4 +1,26 @@
|
|||
---
|
||||
title: API 접근하기
|
||||
title: API 접근 제어
|
||||
weight: 20
|
||||
---
|
||||
no_list: true
|
||||
---
|
||||
|
||||
쿠버네티스가 API 접근을 구현 및 제어하는 방법에 대한 자세한 내용은
|
||||
[쿠버네티스 API에 대한 접근 제어](/ko/docs/concepts/security/controlling-access/)를 참고한다.
|
||||
|
||||
참조 문헌
|
||||
|
||||
- [인증](/docs/reference/access-authn-authz/authentication/)
|
||||
- [부트스트랩 토큰 인증](/docs/reference/access-authn-authz/bootstrap-tokens/)
|
||||
- [승인 컨트롤러](/docs/reference/access-authn-authz/admission-controllers/)
|
||||
- [동적 승인 제어](/docs/reference/access-authn-authz/extensible-admission-controllers/)
|
||||
- [인가](/ko/docs/reference/access-authn-authz/authorization/)
|
||||
- [역할 기반 접근 제어](/docs/reference/access-authn-authz/rbac/)
|
||||
- [속성 기반 접근 제어](/docs/reference/access-authn-authz/abac/)
|
||||
- [노드 인가](/docs/reference/access-authn-authz/node/)
|
||||
- [웹훅 인가](/docs/reference/access-authn-authz/webhook/)
|
||||
- [인증서 서명 요청](/docs/reference/access-authn-authz/certificate-signing-requests/)
|
||||
- [CSR 승인](/docs/reference/access-authn-authz/certificate-signing-requests/#approval-rejection)과
|
||||
[인증서 서명](/docs/reference/access-authn-authz/certificate-signing-requests/#signing)을 포함함
|
||||
- 서비스 어카운트
|
||||
- [개발자 가이드](/docs/tasks/configure-pod-container/configure-service-account/)
|
||||
- [관리](/ko/docs/reference/access-authn-authz/service-accounts-admin/)
|
||||
|
|
|
@ -11,7 +11,7 @@ weight: 60
|
|||
|
||||
<!-- body -->
|
||||
쿠버네티스에서는 사용자의 요청이 인가(접근 권한을 부여) 받기 전에 사용자가 인증(로그인)되어야 한다.
|
||||
인증에 대한 자세한 내용은 [쿠버네티스 API 접근 제어하기](/ko/docs/reference/access-authn-authz/controlling-access/)를
|
||||
인증에 대한 자세한 내용은 [쿠버네티스 API 접근 제어하기](/ko/docs/concepts/security/controlling-access/)를
|
||||
참고한다.
|
||||
|
||||
쿠버네티스는 REST API 요청에 공통적인 속성을 요구한다.
|
||||
|
@ -47,7 +47,7 @@ weight: 60
|
|||
* **Resource** - 접근 중인 리소스의 ID 또는 이름(리소스 요청만 해당) -- `get`, `update`, `patch`, `delete` 동사를 사용하는 리소스 요청의 경우 리소스 이름을 지정해야 한다.
|
||||
* **Subresource** - 접근 중인 하위 리소스(리소스 요청만 해당).
|
||||
* **Namespace** - 접근 중인 오브젝트의 네임스페이스(네임스페이스에 할당된 리소스 요청만 해당)
|
||||
* **API group** - 접근 중인 {{< glossary_tooltip text="API 그룹" term_id="api-group" >}}(리소스 요청에만 해당). 빈 문자열은 [핵심(core) API 그룹](/ko/docs/reference/using-api/api-overview/#api-그룹)을 지정한다.
|
||||
* **API group** - 접근 중인 {{< glossary_tooltip text="API 그룹" term_id="api-group" >}}(리소스 요청에만 해당). 빈 문자열은 _핵심(core)_ [API 그룹](/ko/docs/reference/using-api/#api-그룹)을 지정한다.
|
||||
|
||||
## 요청 동사 결정
|
||||
|
||||
|
@ -197,5 +197,5 @@ status:
|
|||
|
||||
## {{% heading "whatsnext" %}}
|
||||
|
||||
* 인증에 대한 자세한 내용은 [쿠버네티스 API 접근 제어하기](/ko/docs/reference/access-authn-authz/controlling-access/)에서 **인증**을 참조한다.
|
||||
* 인증에 대한 자세한 내용은 [쿠버네티스 API 접근 제어하기](/ko/docs/concepts/security/controlling-access/)에서 **인증** 을 참조한다.
|
||||
* 어드미션 제어에 대한 자세한 내용은 [어드미션 컨트롤러 사용하기](/docs/reference/access-authn-authz/admission-controllers/)를 참조한다.
|
||||
|
|
|
@ -485,7 +485,7 @@ kubelet과 같은 컴포넌트의 기능 게이트를 설정하려면, 기능
|
|||
- `PersistentLocalVolumes`: 파드에서 `local` 볼륨 유형의 사용을 활성화한다.
|
||||
`local` 볼륨을 요청하는 경우 파드 어피니티를 지정해야 한다.
|
||||
- `PodDisruptionBudget`: [PodDisruptionBudget](/docs/tasks/run-application/configure-pdb/) 기능을 활성화한다.
|
||||
- `PodOverhead`: 파드 오버헤드를 판단하기 위해 [파드오버헤드(PodOverhead)](/ko/docs/concepts/configuration/pod-overhead/) 기능을 활성화한다.
|
||||
- `PodOverhead`: 파드 오버헤드를 판단하기 위해 [파드오버헤드(PodOverhead)](/ko/docs/concepts/scheduling-eviction/pod-overhead/) 기능을 활성화한다.
|
||||
- `PodPriority`: [우선 순위](/ko/docs/concepts/configuration/pod-priority-preemption/)를 기반으로 파드의 스케줄링 취소와 선점을 활성화한다.
|
||||
- `PodReadinessGates`: 파드 준비성 평가를 확장하기 위해
|
||||
`PodReadinessGate` 필드 설정을 활성화한다. 자세한 내용은 [파드의 준비성 게이트](/ko/docs/concepts/workloads/pods/pod-lifecycle/#pod-readiness-gate)를
|
||||
|
@ -511,7 +511,7 @@ kubelet과 같은 컴포넌트의 기능 게이트를 설정하려면, 기능
|
|||
- `RuntimeClass`: 컨테이너 런타임 구성을 선택하기 위해 [런타임클래스(RuntimeClass)](/ko/docs/concepts/containers/runtime-class/) 기능을 활성화한다.
|
||||
- `ScheduleDaemonSetPods`: 데몬셋(DaemonSet) 컨트롤러 대신 기본 스케줄러로 데몬셋 파드를 스케줄링할 수 있다.
|
||||
- `SCTPSupport`: 파드, 서비스, 엔드포인트, 엔드포인트슬라이스 및 네트워크폴리시 정의에서 _SCTP_ `protocol` 값을 활성화한다.
|
||||
- `ServerSideApply`: API 서버에서 [SSA(Sever Side Apply)](/docs/reference/using-api/api-concepts/#server-side-apply) 경로를 활성화한다.
|
||||
- `ServerSideApply`: API 서버에서 [SSA(Sever Side Apply)](/docs/reference/using-api/server-side-apply/) 경로를 활성화한다.
|
||||
- `ServiceAccountIssuerDiscovery`: API 서버에서 서비스 어카운트 발행자에 대해 OIDC 디스커버리 엔드포인트(발급자 및 JWKS URL)를 활성화한다. 자세한 내용은 [파드의 서비스 어카운트 구성](/docs/tasks/configure-pod-container/configure-service-account/#service-account-issuer-discovery)을 참고한다.
|
||||
- `ServiceAppProtocol`: 서비스와 엔드포인트에서 `AppProtocol` 필드를 활성화한다.
|
||||
- `ServiceLoadBalancerFinalizer`: 서비스 로드 밸런서에 대한 Finalizer 보호를 활성화한다.
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -5,7 +5,7 @@ title: Kubelet 인증/인가
|
|||
|
||||
## 개요
|
||||
|
||||
kubelet의 HTTPS 엔드포인트는 다양한 민감도의 데이터에 대한 접근을 노출시키며,
|
||||
kubelet의 HTTPS 엔드포인트는 다양한 민감도의 데이터에 대한 접근을 제공하는 API를 노출하며,
|
||||
노드와 컨테이너 내에서 다양한 수준의 권한으로 작업을 수행할 수 있도록 허용한다.
|
||||
|
||||
이 문서는 kubelet의 HTTPS 엔드포인트에 대한 접근을 인증하고 인가하는 방법을 설명한다.
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
---
|
||||
title: 컨테이너 라이프사이클 훅(Container Lifecycle Hooks)
|
||||
id: container-lifecycle-hooks
|
||||
date: 2018-10-08
|
||||
full_link: /ko/docs/concepts/containers/container-lifecycle-hooks/
|
||||
short_description: >
|
||||
라이프사이클 훅은 컨테이너 관리 라이프사이클에 이벤트를 노출하고 이벤트가 발생할 때 사용자가 코드를 실행할 수 있도록 한다.
|
||||
|
||||
aka:
|
||||
tags:
|
||||
- extension
|
||||
---
|
||||
라이프사이클 훅은 {{< glossary_tooltip text="컨테이너" term_id="container" >}} 관리 라이프사이클에 이벤트를 노출하고 이벤트가 발생할 때 사용자가 코드를 실행할 수 있도록 한다.
|
||||
|
||||
<!--more-->
|
||||
|
||||
컨테이너에는 두 개의 훅(컨테이너가 생성된 직후에 실행되는 PostStart와 컨테이너가 종료되기 직전에 차단되고 호출되는 PreStop)이 노출된다.
|
|
@ -2,7 +2,7 @@
|
|||
title: 컨테이너(Container)
|
||||
id: container
|
||||
date: 2018-04-12
|
||||
full_link: /ko/docs/concepts/overview/what-is-kubernetes/#왜-컨테이너인가
|
||||
full_link: /ko/docs/concepts/containers/
|
||||
short_description: >
|
||||
소프트웨어와 그것에 종속된 모든 것을 포함한 가볍고 휴대성이 높은 실행 가능 이미지.
|
||||
|
||||
|
|
|
@ -0,0 +1,113 @@
|
|||
---
|
||||
title: JSONPath 지원
|
||||
content_type: concept
|
||||
weight: 25
|
||||
---
|
||||
|
||||
<!-- overview -->
|
||||
Kubectl은 JSONPath 템플릿을 지원한다.
|
||||
|
||||
|
||||
<!-- body -->
|
||||
|
||||
JSONPath 템플릿은 중괄호 {}로 둘러싸인 JSONPath 표현식으로 구성된다.
|
||||
Kubectl은 JSONPath 표현식을 사용하여 JSON 오브젝트의 특정 필드를 필터링하고 출력 형식을 지정한다.
|
||||
원본 JSONPath 템플릿 구문 외에도 다음과 같은 기능과 구문이 유효하다.
|
||||
|
||||
1. 큰따옴표를 사용하여 JSONPath 표현식 내부의 텍스트를 인용한다.
|
||||
2. 목록을 반복하려면 `range`, `end` 오퍼레이터를 사용한다.
|
||||
3. 목록에서 뒤로 이동하려면 negative slice 인덱스를 사용한다. negative 인덱스는 목록을 "순환(wrap around)" 하지 않으며, `-index + listLength >= 0` 인 한 유효하다.
|
||||
|
||||
{{< note >}}
|
||||
|
||||
- 표현식은 항상 루트 오브젝트에서 시작하므로 `$` 오퍼레이터는 선택 사항이다.
|
||||
|
||||
- 결과 오브젝트는 String() 함수로 출력된다.
|
||||
|
||||
{{< /note >}}
|
||||
|
||||
JSON 입력 시 다음과 같다.
|
||||
|
||||
```json
|
||||
{
|
||||
"kind": "List",
|
||||
"items":[
|
||||
{
|
||||
"kind":"None",
|
||||
"metadata":{"name":"127.0.0.1"},
|
||||
"status":{
|
||||
"capacity":{"cpu":"4"},
|
||||
"addresses":[{"type": "LegacyHostIP", "address":"127.0.0.1"}]
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind":"None",
|
||||
"metadata":{"name":"127.0.0.2"},
|
||||
"status":{
|
||||
"capacity":{"cpu":"8"},
|
||||
"addresses":[
|
||||
{"type": "LegacyHostIP", "address":"127.0.0.2"},
|
||||
{"type": "another", "address":"127.0.0.3"}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"users":[
|
||||
{
|
||||
"name": "myself",
|
||||
"user": {}
|
||||
},
|
||||
{
|
||||
"name": "e2e",
|
||||
"user": {"username": "admin", "password": "secret"}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Function | Description | Example | Result
|
||||
--------------------|---------------------------|-----------------------------------------------------------------|------------------
|
||||
`text` | 일반 텍스트 | `kind is {.kind}` | `kind is List`
|
||||
`@` | 현재 오브젝트 | `{@}` | 입력과 동일
|
||||
`.` or `[]` | 자식 오퍼레이터 | `{.kind}`, `{['kind']}` or `{['name\.type']}` | `List`
|
||||
`..` | 재귀 하향(recursive descent)| `{..name}` | `127.0.0.1 127.0.0.2 myself e2e`
|
||||
`*` | 와일드 카드. 모든 오브젝트 가져오기 | `{.items[*].metadata.name}` | `[127.0.0.1 127.0.0.2]`
|
||||
`[start:end:step]` | 아래 첨자 오퍼레이터 | `{.users[0].name}` | `myself`
|
||||
`[,]` | 조합 오퍼레이터 | `{.items[*]['metadata.name', 'status.capacity']}` | `127.0.0.1 127.0.0.2 map[cpu:4] map[cpu:8]`
|
||||
`?()` | 필터 | `{.users[?(@.name=="e2e")].user.password}` | `secret`
|
||||
`range`, `end` | 반복 목록 | `{range .items[*]}[{.metadata.name}, {.status.capacity}] {end}` | `[127.0.0.1, map[cpu:4]] [127.0.0.2, map[cpu:8]]`
|
||||
`''` | 해석된 문자열 인용 | `{range .items[*]}{.metadata.name}{'\t'}{end}` | `127.0.0.1 127.0.0.2`
|
||||
|
||||
`kubectl` 및 JSONPath 표현식을 사용하는 예는 다음과 같다.
|
||||
|
||||
```shell
|
||||
kubectl get pods -o json
|
||||
kubectl get pods -o=jsonpath='{@}'
|
||||
kubectl get pods -o=jsonpath='{.items[0]}'
|
||||
kubectl get pods -o=jsonpath='{.items[0].metadata.name}'
|
||||
kubectl get pods -o=jsonpath="{.items[*]['metadata.name', 'status.capacity']}"
|
||||
kubectl get pods -o=jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.startTime}{"\n"}{end}'
|
||||
```
|
||||
|
||||
{{< note >}}
|
||||
윈도우에서 공백이 포함된 JSONPath 템플릿을 큰따옴표(위의 bash에 표시된 작은따옴표가 아님)로 묶어야 한다. 즉, 템플릿의 모든 문자 주변에 작은따옴표 또는 이스케이프된 큰따옴표를 사용해야 한다. 예를 들면, 다음과 같다.
|
||||
|
||||
```cmd
|
||||
kubectl get pods -o=jsonpath="{range .items[*]}{.metadata.name}{'\t'}{.status.startTime}{'\n'}{end}"
|
||||
kubectl get pods -o=jsonpath="{range .items[*]}{.metadata.name}{\"\t\"}{.status.startTime}{\"\n\"}{end}"
|
||||
```
|
||||
{{< /note >}}
|
||||
|
||||
{{< note >}}
|
||||
|
||||
JSONPath 정규식은 지원되지 않는다. 정규 표현식을 이용해 매치하려면 `jq`와 같은 도구를 사용하면 된다.
|
||||
|
||||
```shell
|
||||
# kubectl은 JSONPath 출력에 대한 정규 표현식을 지원하지 않는다.
|
||||
# 다음 커맨드는 작동하지 않는다.
|
||||
kubectl get pods -o jsonpath='{.items[?(@.metadata.name=~/^test$/)].metadata.name}'
|
||||
|
||||
# 다음 커맨드는 원하는 결과를 얻는다.
|
||||
kubectl get pods -o json | jq -r '.items[] | select(.metadata.name | test("test-")).spec.containers[].image'
|
||||
```
|
||||
{{< /note >}}
|
|
@ -0,0 +1,253 @@
|
|||
---
|
||||
title: 스케줄러 구성
|
||||
content_type: concept
|
||||
weight: 20
|
||||
---
|
||||
|
||||
{{< feature-state for_k8s_version="v1.19" state="beta" >}}
|
||||
|
||||
구성 파일을 작성하고 해당 경로를 커맨드 라인 인수로 전달하여
|
||||
`kube-scheduler` 의 동작을 사용자 정의할 수 있다.
|
||||
|
||||
<!-- overview -->
|
||||
|
||||
<!-- body -->
|
||||
|
||||
스케줄링 프로파일(Profile)을 사용하면 {{< glossary_tooltip text="kube-scheduler" term_id="kube-scheduler" >}}에서
|
||||
여러 단계의 스케줄링을 구성할 수 있다.
|
||||
각 단계는 익스텐션 포인트(extension point)를 통해 노출된다. 플러그인은 이러한
|
||||
익스텐션 포인트 중 하나 이상을 구현하여 스케줄링 동작을 제공한다.
|
||||
|
||||
컴포넌트 구성 API([`v1alpha1`](https://pkg.go.dev/k8s.io/kube-scheduler@v0.18.0/config/v1alpha1?tab=doc#KubeSchedulerConfiguration)
|
||||
또는 [`v1alpha2`](https://pkg.go.dev/k8s.io/kube-scheduler@v0.18.0/config/v1alpha2?tab=doc#KubeSchedulerConfiguration))를
|
||||
사용하고, `kube-scheduler --config <filename>`을 실행하여
|
||||
스케줄링 프로파일을 지정할 수 있다.
|
||||
`v1alpha2` API를 사용하면 [여러 프로파일](#여러-프로파일)을
|
||||
실행하도록 kube-scheduler를 구성할 수 있다.
|
||||
|
||||
최소 구성은 다음과 같다.
|
||||
|
||||
```yaml
|
||||
apiVersion: kubescheduler.config.k8s.io/v1beta1
|
||||
kind: KubeSchedulerConfiguration
|
||||
clientConnection:
|
||||
kubeconfig: /etc/srv/kubernetes/kube-scheduler/kubeconfig
|
||||
```
|
||||
|
||||
## 프로파일
|
||||
|
||||
스케줄링 프로파일을 사용하면 {{< glossary_tooltip text="kube-scheduler" term_id="kube-scheduler" >}}에서
|
||||
여러 단계의 스케줄링을 구성할 수 있다.
|
||||
각 단계는 [익스텐션 포인트](#익스텐션-포인트)에 노출된다.
|
||||
[플러그인](#스케줄링-플러그인)은 이러한 익스텐션 포인트 중
|
||||
하나 이상을 구현하여 스케줄링 동작을 제공한다.
|
||||
|
||||
`kube-scheduler` 의 단일 인스턴스를 구성하여
|
||||
[여러 프로파일](#여러-프로파일)을 실행할 수 있다.
|
||||
|
||||
### 익스텐션 포인트
|
||||
|
||||
스케줄링은 다음 익스텐션 포인트를 통해 노출되는 일련의 단계에서
|
||||
발생한다.
|
||||
|
||||
1. `QueueSort`: 이 플러그인은 스케줄링 대기열에서 보류 중인 파드를
|
||||
정렬하는 데 사용되는 정렬 기능을 제공한다. 대기열 정렬 플러그인은 한 번에 단 하나만 활성화될 수 있다.
|
||||
사용할 수 있다.
|
||||
1. `PreFilter`: 이 플러그인은 필터링하기 전에 파드 또는 클러스터에 대한 정보를
|
||||
사전 처리하거나 확인하는 데 사용된다. 이 플러그인은 파드를 unschedulable로
|
||||
표시할 수 있다.
|
||||
1. `Filter`: 이 플러그인은 스케줄링 정책의 단정(Predicates)과 동일하며
|
||||
파드를 실행할 수 없는 노드를 필터링하는 데 사용된다. 필터는
|
||||
구성된 순서대로 호출된다. 노드가 모든 필터를 통과하지 않으면 파드는 unschedulable로
|
||||
표시된다.
|
||||
1. `PreScore`: 이것은 사전 스코어링 작업을 수행하는 데 사용할 수 있는
|
||||
정보성 익스텐션 포인트이다.
|
||||
1. `Score`: 이 플러그인은 필터링 단계를 통과한 각 노드에 점수를
|
||||
제공한다. 그런 다음 스케줄러는 가중치 합계가 가장 높은
|
||||
노드를 선택한다.
|
||||
1. `Reserve`: 지정된 파드에 리소스가 예약된 경우 플러그인에
|
||||
알리는 정보성 익스텐션 포인트이다. 플러그인은 또한
|
||||
`Reserve` 도중 또는 이후에 실패한 경우 호출 되는 `Unreserve` 호출을
|
||||
구현한다.
|
||||
1. `Permit`: 이 플러그인은 파드 바인딩을 방지하거나 지연시킬 수 있다.
|
||||
1. `PreBind`: 이 플러그인은 파드가 바인딩되기 전에 필요한 모든 작업을 수행한다.
|
||||
1. `Bind`: 플러그인은 파드를 노드에 바인딩한다. Bind 플러그인은 순서대로 호출되며
|
||||
일단 바인딩이 완료되면 나머지 플러그인은 건너뛴다. Bind
|
||||
플러그인은 적어도 하나 이상 필요하다.
|
||||
1. `PostBind`: 파드가 바인드된 후 호출되는
|
||||
정보성 익스텐션 포인트이다.
|
||||
|
||||
각 익스텐션 포인트에 대해 특정 [기본 플러그인](#스케줄링-플러그인)을 비활성화하거나
|
||||
자체 플러그인을 활성화할 수 있다. 예를 들면, 다음과 같다.
|
||||
|
||||
```yaml
|
||||
apiVersion: kubescheduler.config.k8s.io/v1beta1
|
||||
kind: KubeSchedulerConfiguration
|
||||
profiles:
|
||||
- plugins:
|
||||
score:
|
||||
disabled:
|
||||
- name: NodeResourcesLeastAllocated
|
||||
enabled:
|
||||
- name: MyCustomPluginA
|
||||
weight: 2
|
||||
- name: MyCustomPluginB
|
||||
weight: 1
|
||||
```
|
||||
|
||||
비활성화된 배열의 이름으로 `*` 를 사용하여 해당 익스텐션 포인트에 대한
|
||||
모든 기본 플러그인을 비활성화할 수 있다. 원하는 경우, 플러그인 순서를 재정렬하는 데
|
||||
사용할 수도 있다.
|
||||
|
||||
### 스케줄링 플러그인
|
||||
|
||||
1. `UnReserve`: 파드가 예약된 후 거부되고 `Permit` 플러그인에 의해 보류된 경우
|
||||
호출되는 정보성 익스텐션 포인트이다.
|
||||
|
||||
## 스케줄링 플러그인
|
||||
|
||||
기본적으로 활성화된 다음의 플러그인은 이들 익스텐션 포인트 중
|
||||
하나 이상을 구현한다.
|
||||
|
||||
- `SelectorSpread`: {{< glossary_tooltip text="서비스" term_id="service" >}},
|
||||
{{< glossary_tooltip text="레플리카셋(ReplicaSets)" term_id="replica-set" >}} 및
|
||||
{{< glossary_tooltip text="스테이트풀셋(StatefulSets)" term_id="statefulset" >}}에
|
||||
속하는 파드에 대해 노드 간 분산을 선호한다.
|
||||
익스텐션 포인트: `PreScore`, `Score`.
|
||||
- `ImageLocality`: 파드가 실행하는 컨테이너 이미지가 이미 있는 노드를
|
||||
선호한다.
|
||||
익스텐션 포인트: `Score`.
|
||||
- `TaintToleration`: [테인트(taint)와 톨러레이션(toleration)](/ko/docs/concepts/scheduling-eviction/taint-and-toleration/)을
|
||||
구현한다.
|
||||
익스텐션 포인트 구현: `Filter`, `Prescore`, `Score`.
|
||||
- `NodeName`: 파드 명세 노드 이름이 현재 노드와 일치하는지 확인한다.
|
||||
익스텐션 포인트: `Filter`.
|
||||
- `NodePorts`: 노드에 요청된 파드 포트에 대해 사용 가능한 포트가 있는지 확인한다.
|
||||
익스텐션 포인트: `PreFilter`, `Filter`.
|
||||
- `NodePreferAvoidPods`: 노드 {{< glossary_tooltip text="어노테이션" term_id="annotation" >}}
|
||||
`scheduler.alpha.kubernetes.io/preferAvoidPods` 에 따라
|
||||
노드 점수를 매긴다.
|
||||
익스텐션 포인트: `Score`.
|
||||
- `NodeAffinity`: [노드 셀렉터](/ko/docs/concepts/scheduling-eviction/assign-pod-node/#노드-셀렉터-nodeselector)와
|
||||
[노드 어피니티](/ko/docs/concepts/scheduling-eviction/assign-pod-node/#노드-어피니티)를
|
||||
구현한다.
|
||||
익스텐션 포인트: `Filter`, `Score`.
|
||||
- `PodTopologySpread`: [파드 토폴로지 분배](/ko/docs/concepts/workloads/pods/pod-topology-spread-constraints/)를
|
||||
구현한다.
|
||||
익스텐션 포인트: `PreFilter`, `Filter`, `PreScore`, `Score`.
|
||||
- `NodeUnschedulable`: `.spec.unschedulable` 이 true로 설정된 노드를
|
||||
필터링한다.
|
||||
익스텐션 포인트: `Filter`.
|
||||
- `NodeResourcesFit`: 노드에 파드가 요청하는 모든 리소스가 있는지
|
||||
확인한다.
|
||||
익스텐션 포인트: `PreFilter`, `Filter`.
|
||||
- `NodeResourcesBalancedAllocation`: 파드가 스케줄된 경우, 보다 균형잡힌 리소스 사용량을
|
||||
얻을 수 있는 노드를 선호한다.
|
||||
익스텐션 포인트: `Score`.
|
||||
- `NodeResourcesLeastAllocated`: 리소스 할당이 적은 노드를
|
||||
선호한다.
|
||||
익스텐션 포인트: `Score`.
|
||||
- `VolumeBinding`: 노드에 요청된 {{< glossary_tooltip text="볼륨" term_id="volume" >}}이 있는지
|
||||
또는 바인딩할 수 있는지 확인한다.
|
||||
익스텐션 포인트: `PreFilter`, `Filter`, `Reserve`, `PreBind`.
|
||||
- `VolumeRestrictions`: 노드에 마운트된 볼륨이 볼륨 제공자에 특정한
|
||||
제한 사항을 충족하는지 확인한다.
|
||||
익스텐션 포인트: `Filter`.
|
||||
- `VolumeZone`: 요청된 볼륨이 가질 수 있는 영역 요구 사항을 충족하는지
|
||||
확인한다.
|
||||
익스텐션 포인트: `Filter`.
|
||||
- `NodeVolumeLimits`: 노드에 대해 CSI 볼륨 제한을 충족할 수 있는지
|
||||
확인한다.
|
||||
익스텐션 포인트: `Filter`.
|
||||
- `EBSLimits`: 노드에 대해 AWS EBS 볼륨 제한을 충족할 수 있는지 확인한다.
|
||||
익스텐션 포인트: `Filter`.
|
||||
- `GCEPDLimits`: 노드에 대해 GCP-PD 볼륨 제한을 충족할 수 있는지 확인한다.
|
||||
익스텐션 포인트: `Filter`.
|
||||
- `AzureDiskLimits`: 노드에 대해 Azure 디스크 볼륨 제한을 충족할 수 있는지
|
||||
확인한다.
|
||||
익스텐션 포인트: `Filter`.
|
||||
- `InterPodAffinity`: [파드 간 어피니티 및 안티-어피니티](/ko/docs/concepts/scheduling-eviction/assign-pod-node/#파드간-어피니티와-안티-어피니티)를
|
||||
구현한다.
|
||||
익스텐션 포인트: `PreFilter`, `Filter`, `PreScore`, `Score`.
|
||||
- `PrioritySort`: 기본 우선 순위 기반 정렬을 제공한다.
|
||||
익스텐션 포인트: `QueueSort`.
|
||||
- `DefaultBinder`: 기본 바인딩 메커니즘을 제공한다.
|
||||
익스텐션 포인트: `Bind`.
|
||||
- `DefaultPreemption`: 기본 선점 메커니즘을 제공한다.
|
||||
익스텐션 포인트: `PostFilter`.
|
||||
|
||||
기본으로 활성화되지 않는 다음의 플러그인을
|
||||
컴포넌트 구성 API를 통해 활성화할 수도 있다.
|
||||
|
||||
- `NodeResourcesMostAllocated`: 리소스 할당이 많은 노드를
|
||||
선호한다.
|
||||
익스텐션 포인트: `Score`.
|
||||
- `RequestedToCapacityRatio`: 할당된 리소스의 구성된 기능에 따라 노드를
|
||||
선호한다.
|
||||
익스텐션 포인트: `Score`.
|
||||
- `NodeResourceLimits`: 파드 리소스 제한을 충족하는 노드를 선호한다.
|
||||
익스텐션 포인트: `PreScore`, `Score`.
|
||||
- `CinderVolume`: 노드에 대해 OpenStack Cinder 볼륨 제한을 충족할 수 있는지
|
||||
확인한다.
|
||||
익스텐션 포인트: `Filter`.
|
||||
- `NodeLabel`: Filters and / or scores a node according to configured
|
||||
{{< glossary_tooltip text="label(s)" term_id="label" >}}.
|
||||
익스텐션 포인트: `Filter`, `Score`.
|
||||
- `ServiceAffinity`: {{< glossary_tooltip text="서비스" term_id="service" >}}에
|
||||
속한 파드가 구성된 레이블로 정의된 노드 집합에 맞는지
|
||||
확인한다. 이 플러그인은 또한 서비스에 속한 파드를 노드 간에
|
||||
분산하는 것을 선호한다.
|
||||
익스텐션 포인트: `PreFilter`, `Filter`, `Score`.
|
||||
|
||||
### 여러 프로파일
|
||||
|
||||
둘 이상의 프로파일을 실행하도록 `kube-scheduler` 를 구성할 수 있다.
|
||||
각 프로파일에는 연관된 스케줄러 이름이 있으며 [익스텐션 포인트](#익스텐션-포인트)에 구성된
|
||||
다른 플러그인 세트를 가질 수 있다.
|
||||
|
||||
다음의 샘플 구성을 사용하면, 스케줄러는 기본 플러그인이 있는
|
||||
프로파일과 모든 스코어링 플러그인이 비활성화된 프로파일의 두 가지 프로파일로
|
||||
실행된다.
|
||||
|
||||
```yaml
|
||||
apiVersion: kubescheduler.config.k8s.io/v1beta1
|
||||
kind: KubeSchedulerConfiguration
|
||||
profiles:
|
||||
- schedulerName: default-scheduler
|
||||
- schedulerName: no-scoring-scheduler
|
||||
plugins:
|
||||
preScore:
|
||||
disabled:
|
||||
- name: '*'
|
||||
score:
|
||||
disabled:
|
||||
- name: '*'
|
||||
```
|
||||
|
||||
특정 프로파일에 따라 스케줄하려는 파드는
|
||||
`.spec.schedulerName` 에 해당 스케줄러 이름을 포함할 수 있다.
|
||||
|
||||
기본적으로, 스케줄러 이름 `default-scheduler` 를 가진 하나의 프로파일이 생성된다.
|
||||
이 프로파일에는 위에서 설명한 기본 플러그인이 포함되어 있다. 둘 이상의
|
||||
프로파일을 선언할 때, 각각에 대한 고유한 스케줄러 이름이 필요하다.
|
||||
|
||||
파드가 스케줄러 이름을 지정하지 않으면, kube-apiserver는 이를 `default-scheduler` 로
|
||||
설정한다. 따라서, 해당 파드를 스케줄하려면 이 스케줄러 이름을 가진 프로파일이
|
||||
있어야 한다.
|
||||
|
||||
{{< note >}}
|
||||
파드의 스케줄링 이벤트에는 ReportingController로 `.spec.schedulerName` 이 있다.
|
||||
리더 선출을 위한 이벤트는 목록에서 첫 번째 프로파일의 스케줄러 이름을
|
||||
사용한다.
|
||||
{{< /note >}}
|
||||
|
||||
{{< note >}}
|
||||
모든 프로파일은 QueueSort 익스텐션 포인트에서 동일한 플러그인을 사용해야 하며
|
||||
동일한 구성 파라미터(해당하는 경우)를 가져야 한다. 그 이유는 스케줄러가 보류 중 상태인 파드 대기열을
|
||||
단 하나만 가질 수 있기 때문이다.
|
||||
{{< /note >}}
|
||||
|
||||
## {{% heading "whatsnext" %}}
|
||||
|
||||
* [kube-scheduler 레퍼런스](https://kubernetes.io/docs/reference/command-line-tools-reference/kube-scheduler/) 읽어보기
|
||||
* [스케줄링](/ko/docs/concepts/scheduling-eviction/kube-scheduler/)에 대해 알아보기
|
|
@ -20,7 +20,7 @@ content_type: concept
|
|||
|
||||
## Minikube
|
||||
|
||||
[`minikube`](/ko/docs/tasks/tools/install-minikube/)는 개발과 테스팅 목적으로 하는
|
||||
[`minikube`](https://minikube.sigs.k8s.io/docs/)는 개발과 테스팅 목적으로 하는
|
||||
단일 노드 쿠버네티스 클러스터를 로컬 워크스테이션에서
|
||||
쉽게 구동시키는 도구이다.
|
||||
|
||||
|
@ -44,7 +44,7 @@ Helm의 용도
|
|||
|
||||
## Kompose
|
||||
|
||||
[`Kompose`](https://github.com/kubernetes-incubator/kompose)는 도커 컴포즈 유저들이 쿠버네티스로 이동하는데 도움이 되는 도구이다.
|
||||
[`Kompose`](https://github.com/kubernetes/kompose)는 도커 컴포즈 유저들이 쿠버네티스로 이동하는데 도움이 되는 도구이다.
|
||||
|
||||
Kompose의 용도
|
||||
|
||||
|
|
|
@ -1,4 +1,121 @@
|
|||
---
|
||||
title: 쿠버네티스 API 사용하기
|
||||
title: 쿠버네티스 API 개요
|
||||
content_type: concept
|
||||
weight: 10
|
||||
card:
|
||||
name: 레퍼런스
|
||||
weight: 50
|
||||
title: API 개요
|
||||
---
|
||||
|
||||
<!-- overview -->
|
||||
|
||||
이 섹션은 쿠버네티스 API에 대한 참조 정보를 제공한다.
|
||||
|
||||
REST API는 쿠버네티스의 근본적인 구조이다. 모든 조작,
|
||||
컴포넌트 간의 통신과 외부 사용자의 명령은 API 서버에서 처리할 수 있는
|
||||
REST API 호출이다. 따라서, 쿠버네티스 플랫폼 안의 모든 것은
|
||||
API 오브젝트로 취급되고,
|
||||
[API](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/)에 상응하는 항목이 있다.
|
||||
|
||||
[쿠버네티스 API 참조](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/)는
|
||||
쿠버네티스 버전 {{< param "version" >}}에 대한 API가 나열되어 있다.
|
||||
|
||||
일반적인 배경 정보를 보려면,
|
||||
[쿠버네티스 API](/ko/docs/concepts/overview/kubernetes-api/)를 참고한다.
|
||||
[쿠버네티스 API에 대한 접근 제어](/ko/docs/concepts/security/controlling-access/)는
|
||||
클라이언트가 쿠버네티스 API 서버에 인증하는 방법과
|
||||
요청이 승인되는 방법을 설명한다.
|
||||
|
||||
|
||||
## API 버전 규칙
|
||||
|
||||
JSON과 Protobuf 직렬화 스키마 모두 스키마 변경에 대해서
|
||||
동일한 가이드라인을 따른다. 이후 설명에서는 이 형식 모두를 다룬다.
|
||||
|
||||
API 버전 규칙과 소프트웨어 버전 규칙은 간접적으로 연관된다.
|
||||
[API와 릴리스 버전 부여에 관한 제안](https://git.k8s.io/community/contributors/design-proposals/release/versioning.md)에는
|
||||
API 버전 규칙과 소프트웨어 버전 규칙 간의 관계가 기술되어 있다.
|
||||
|
||||
API 버전의 차이는 수준의 안정성과 지원의 차이를 나타낸다.
|
||||
[API 변경 문서](https://git.k8s.io/community/contributors/devel/sig-architecture/api_changes.md#alpha-beta-and-stable-versions)에서
|
||||
각 수준의 기준에 대한 더 많은 정보를 찾을 수 있다.
|
||||
|
||||
아래는 각 수준의 기준에 대한 요약이다.
|
||||
|
||||
- 알파(Alpha):
|
||||
- 버전 이름에 `alpha`가 포함된다(예: `v1alpha1`).
|
||||
- 버그가 있을 수도 있다. 이 기능을 활성화하면 버그에 노출될 수 있다.
|
||||
기본적으로 비활성화되어 있다.
|
||||
- 기능에 대한 기술 지원이 언제든 공지 없이 중단될 수 있다.
|
||||
- 다음 소프트웨어를 릴리스할 때 공지 없이 API의 호환성이 깨지는 방식으로 변경될 수 있다.
|
||||
- 버그에 대한 위험이 높고 장기간 지원되지 않으므로
|
||||
단기간 테스트 용도의 클러스터에서만 사용하기를 권장한다.
|
||||
|
||||
- 베타(Beta):
|
||||
- 버전 이름에 `beta`가 포함된다(예: `v2beta3`).
|
||||
- 코드가 잘 테스트 되었다. 이 기능을 활성화해도 안전하다.
|
||||
기본적으로 활성화되어 있다.
|
||||
- 구체적인 내용이 바뀔 수는 있지만, 전반적인 기능에 대한 기술 지원이 중단되지 않는다.
|
||||
|
||||
- 오브젝트에 대한 스키마나 문법이 다음 베타 또는 안정화 릴리스에서
|
||||
호환되지 않는 방식으로 바뀔 수도 있다. 이런 경우, 다음 버전으로
|
||||
이관할 수 있는 가이드가 제공된다. 스키마 변경은 API 오브젝트의 삭제, 편집 또는 재생성이
|
||||
필요할 수도 있다. 편집 절차는 좀 생각해볼 필요가 있다.
|
||||
이 기능에 의존하고 있는 애플리케이션은 다운타임이 필요할 수도 있다.
|
||||
- 이 소프트웨어는 프로덕션 용도로 권장하지 않는다. 이후 여러 버전에서
|
||||
호환되지 않는 변경 사항이 적용될 수 있다. 복수의 클러스터를 가지고 있어서
|
||||
독립적으로 업그레이드할 수 있다면, 이런 제약에서 벗어날 수도 있다.
|
||||
|
||||
{{< note >}}
|
||||
베타 기능을 사용해보고 피드백을 제공하자. 기능이 베타 수준을 벗어난 이후에는
|
||||
실질적으로 더 많은 변경이 어렵다.
|
||||
{{< /note >}}
|
||||
|
||||
- 안정화(Stable):
|
||||
- 버전 이름이 `vX`이고 `X` 는 정수다.
|
||||
- 안정화 버전의 기능은 이후 여러 버전에 걸쳐서 소프트웨어 릴리스에 포함된다.
|
||||
|
||||
## API 그룹
|
||||
|
||||
[API 그룹](https://git.k8s.io/community/contributors/design-proposals/api-machinery/api-group.md)은
|
||||
쿠버네티스 API를 더 쉽게 확장하게 해준다.
|
||||
API 그룹은 REST 경로와 직렬화된 오브젝트의 `apiVersion` 필드에
|
||||
명시된다.
|
||||
|
||||
쿠버네티스에는 다음과 같은 다양한 API 그룹이 있다.
|
||||
|
||||
* *핵심* (또는 *레거시* 라고 불리는) 그룹은 REST 경로 `/api/v1`에 있다.
|
||||
핵심 그룹은 `apiVersion` 필드의 일부로 명시되지 않는다. 예를
|
||||
들어, `apiVersion: v1` 과 같다.
|
||||
* 이름이 있는 그룹은 REST 경로 `/apis/$GROUP_NAME/$VERSION`에 있으며
|
||||
`apiVersion: $GROUP_NAME/$VERSION`을 사용한다(예를 들어, `apiVersion: batch/v1`).
|
||||
지원되는 API 그룹 전체의 목록은
|
||||
[쿠버네티스 API 참조 문서](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#-strong-api-groups-strong-)에서 확인할 수 있다.
|
||||
|
||||
## API 그룹 활성화 또는 비활성화
|
||||
|
||||
특정 리소스 및 API 그룹은 기본적으로 활성화된다. API 서버에서
|
||||
`--runtime-config` 를 설정하여 활성화 또는 비활성화할 수 있다.
|
||||
`--runtime-config` 플래그는 API 서버의 런타임 구성을 설명하는
|
||||
쉼표로 구분된 `<key>=<value>` 쌍을 허용한다. 만약 `=<value>`
|
||||
부분을 생략하면, `=true` 가 명시된 것처럼 취급한다. 예를 들면, 다음과 같다.
|
||||
|
||||
- `batch/v1` 을 비활성화하려면, `--runtime-config=batch/v1=false` 로 설정
|
||||
- `batch/v2alpha1` 을 활성화하려면, `--runtime-config=batch/v2alpha1` 으로 설정
|
||||
|
||||
{{< note >}}
|
||||
그룹이나 리소스를 활성화 또는 비활성화하려면, apiserver와 controller-manager를 재시작하여
|
||||
`--runtime-config` 변경을 반영해야 한다.
|
||||
{{< /note >}}
|
||||
|
||||
## 지속성
|
||||
|
||||
쿠버네티스는 {{< glossary_tooltip term_id="etcd" >}}에 기록하여 API 리소스 측면에서
|
||||
직렬화된 상태를 저장한다.
|
||||
|
||||
## {{% heading "whatsnext" %}}
|
||||
|
||||
- [API 규칙](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#api-conventions)에 대해 자세히 알아보기
|
||||
- [애그리게이터(aggregator)](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/aggregated-api-servers.md)에
|
||||
대한 디자인 문서 읽기
|
||||
|
|
|
@ -1,113 +0,0 @@
|
|||
---
|
||||
title: 쿠버네티스 API 개요
|
||||
content_type: concept
|
||||
weight: 10
|
||||
card:
|
||||
name: 레퍼런스
|
||||
weight: 50
|
||||
title: API 개요
|
||||
---
|
||||
|
||||
<!-- overview -->
|
||||
|
||||
이 페이지는 쿠버네티스 API에 대한 개요를 제공한다.
|
||||
|
||||
|
||||
<!-- body -->
|
||||
|
||||
REST API는 쿠버네티스의 근본적인 구조이다. 모든 조작,
|
||||
컴포넌트 간의 통신과 외부 사용자의 명령은 API 서버에서 처리할 수 있는
|
||||
REST API 호출이다. 따라서, 쿠버네티스 플랫폼 안의 모든 것은
|
||||
API 오브젝트로 취급되고,
|
||||
[API](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/)에 상응하는 항목이 있다.
|
||||
|
||||
## API 버전 규칙
|
||||
|
||||
JSON과 Protobuf 직렬화 스키마 모두 스키마 변경에 대해서
|
||||
동일한 가이드라인을 따른다. 이후 설명에서는 이 형식 모두를 다룬다.
|
||||
|
||||
API 버전 규칙과 소프트웨어 버전 규칙은 간접적으로 연관된다.
|
||||
[API와 릴리스 버전 부여에 관한 제안](https://git.k8s.io/community/contributors/design-proposals/release/versioning.md)에는
|
||||
API 버전 규칙과 소프트웨어 버전 규칙 간의 관계가 기술되어 있다.
|
||||
|
||||
API 버전의 차이는 수준의 안정성과 지원의 차이를 나타낸다.
|
||||
[API 변경 문서](https://git.k8s.io/community/contributors/devel/sig-architecture/api_changes.md#alpha-beta-and-stable-versions)에서
|
||||
각 수준의 기준에 대한 더 많은 정보를 찾을 수 있다.
|
||||
|
||||
아래는 각 수준의 기준에 대한 요약이다.
|
||||
|
||||
- 알파(Alpha) 수준:
|
||||
- 버전 이름에 `alpha`가 포함된다. (예: `v1alpha1`)
|
||||
- 버그가 있을 수도 있다. 이 기능을 활성화하면 버그가 노출될 수 있다.
|
||||
기본적으로 비활성화되어 있다.
|
||||
- 기능에 대한 기술 지원이 언제든 공지 없이 중단될 수 있다.
|
||||
- 다음 소프트웨어를 릴리스할 때 공지 없이 API의 호환성이 깨지는 방식으로 변경될 수 있다.
|
||||
- 버그의 위험이 높고 장기간 지원되지 않으므로
|
||||
단기간 테스트 용도의 클러스터에서만 사용하기를 권장한다.
|
||||
|
||||
- 베타(Beta) 수준:
|
||||
- 버전 이름에 `beta`가 포함된다. (예: `v2beta3`).
|
||||
- 코드가 잘 테스트되었다. 이 기능을 활성화 시켜도 안전하다.
|
||||
기본적으로 활성화되어 있다.
|
||||
- 구체적인 내용이 바뀔 수는 있지만, 전반적인 기능에 대한 기술 지원이 중단되지 않는다.
|
||||
|
||||
- 오브젝트에 대한 스키마나 문법이 다음 베타 또는 안정화 릴리스에서
|
||||
호환되지 않는 방식으로 바뀔 수도 있다. 이런 경우, 다음 버전으로
|
||||
이관할 수 있는 가이드가 제공된다. 스키마 변경은 API 오브젝트의 삭제, 편집 또는 재생성이
|
||||
필요할 수도 있다. 편집 절차는 좀 생각해볼 필요가 있다.
|
||||
이 기능에 의존하고 있는 애플리케이션은 다운타임이 필요할 수도 있다.
|
||||
- 이 소프트웨어는 프로덕션 용도로 권장되지 않는다. 이후 여러 버전에서
|
||||
호환되지 않는 변경 사항이 적용될 수 있다. 복수의 클러스터를 가지고 있어서
|
||||
독립적으로 업그레이드할 수 있다면, 이런 제약에서 벗어날 수도 있다.
|
||||
|
||||
{{< note >}}
|
||||
베타 기능을 사용해보고 피드백을 제공하자. 기능이 베타 수준을 벗어난 이후에는
|
||||
실질적으로 더 많은 변경이 어렵다.
|
||||
{{< /note >}}
|
||||
|
||||
- 안정화(stable) 수준:
|
||||
- 버전 이름이 `vX`이고 `X` 는 정수다.
|
||||
- 안정화 버전의 기능은 이후 여러 버전에 걸쳐서 소프트웨어 릴리스에 포함된다.
|
||||
|
||||
## API 그룹
|
||||
|
||||
[API 그룹](https://git.k8s.io/community/contributors/design-proposals/api-machinery/api-group.md)은
|
||||
쿠버네티스 API를 더 쉽게 확장하게 해준다.
|
||||
API 그룹은 REST 경로와 직렬화된 객체의 `apiVersion` 필드에
|
||||
명시된다.
|
||||
|
||||
현재 다음과 같은 다양한 API 그룹이 사용되고 있다.
|
||||
|
||||
* *핵심* (또는 *레거시* 라고 불리는) 그룹은 REST 경로 `/api/v1`에 있다.
|
||||
핵심 그룹은 `apiVersion` 필드의 일부로 명시되지 않는다. 예를
|
||||
들어, `apiVersion: v1` 와 같다.
|
||||
* 이름이 있는 그룹은 REST 경로 `/apis/$GROUP_NAME/$VERSION`에 있으며
|
||||
`apiVersion: $GROUP_NAME/$VERSION`을 사용한다(예를 들어, `apiVersion: batch/v1`).
|
||||
지원되는 API 그룹 전체의 목록은
|
||||
[쿠버네티스 API 참조 문서](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/)에서 확인할 수 있다.
|
||||
|
||||
## API 그룹 활성화 또는 비활성화 {#enabling-or-disabling}
|
||||
|
||||
특정 리소스 및 API 그룹은 기본적으로 활성화된다. API 서버에서
|
||||
`--runtime-config` 를 설정하여 활성화 또는 비활성화할 수 있다.
|
||||
`--runtime-config` 플래그는 API 서버의 런타임 구성을 설명하는
|
||||
쉼표로 구분된 `<key>=<value>` 쌍을 허용한다. 예를 들면, 다음과 같다.
|
||||
|
||||
- `batch/v1` 을 비활성화하려면, `--runtime-config=batch/v1=false` 로 설정
|
||||
- `batch/v2alpha1` 을 활성화하려면, `--runtime-config=batch/v2alpha1` 으로 설정
|
||||
|
||||
{{< note >}}
|
||||
그룹이나 리소스를 활성화 또는 비활성화하려면, apiserver와 controller-manager를 재시작하여
|
||||
`--runtime-config` 변경을 반영해야 한다.
|
||||
{{< /note >}}
|
||||
|
||||
## 지속성
|
||||
|
||||
쿠버네티스는 {{< glossary_tooltip term_id="etcd" >}}에 기록하여 API 리소스 측면에서
|
||||
직렬화된 상태를 저장한다.
|
||||
|
||||
## {{% heading "whatsnext" %}}
|
||||
|
||||
- [API 규칙](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#api-conventions)에 대해 자세히 알아보기
|
||||
- [애그리게이터(aggregator)](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/aggregated-api-servers.md)에
|
||||
대한 디자인 문서 읽기
|
|
@ -10,7 +10,7 @@ weight: 30
|
|||
|
||||
|
||||
<!-- body -->
|
||||
[쿠버네티스 REST API](/ko/docs/reference/using-api/api-overview/)를 사용해 애플리케이션을 작성하기 위해
|
||||
[쿠버네티스 REST API](/ko/docs/reference/using-api/)를 사용해 애플리케이션을 작성하기 위해
|
||||
API 호출 또는 요청/응답 타입을 직접 구현할 필요는 없다.
|
||||
사용하고 있는 프로그래밍 언어를 위한 클라이언트 라이브러리를 사용하면 된다.
|
||||
|
||||
|
|
|
@ -2,3 +2,32 @@
|
|||
title: 학습 환경
|
||||
weight: 20
|
||||
---
|
||||
|
||||
<!--
|
||||
{{/* There is a Netlify redirect from this page to /docs/tasks/tools/ */}}
|
||||
{{/* This page content only exists to provide a navigation stub */}}
|
||||
{{/* and to protect in case that redirect is one day removed. */}}
|
||||
|
||||
{{/* If you're localizing this page, you only need to copy the front matter */}}
|
||||
{{/* and add a redirect into "/static/_redirects", for YOUR localization. */}}
|
||||
-->
|
||||
|
||||
## kind
|
||||
|
||||
[`kind`](https://kind.sigs.k8s.io/docs/)를 사용하면 로컬 컴퓨터에서
|
||||
쿠버네티스를 사용할 수 있다. 이 툴을 사용하려면
|
||||
[도커](https://docs.docker.com/get-docker/)를 설치 및 구성해야 한다.
|
||||
|
||||
kind [빠른 시작](https://kind.sigs.k8s.io/docs/user/quick-start/) 페이지에는
|
||||
kind를 시작하고 실행하기 위해 해야 할 일이 나와 있다.
|
||||
|
||||
## minikube
|
||||
|
||||
`kind`와 마찬가지로, [`minikube`](https://minikube.sigs.k8s.io/)는 로컬에서 쿠버네티스를 실행할 수 있는 툴이다.
|
||||
`minikube`는 개인용 컴퓨터(윈도우, 맥OS, 리눅스 포함)에서
|
||||
단일 노드 쿠버네티스 클러스터를 실행하므로
|
||||
쿠버네티스를 시험해 보거나 일상적인 개발 작업에 사용할 수 있다.
|
||||
|
||||
툴을 설치하고 싶으면
|
||||
[시작하기!](https://minikube.sigs.k8s.io/docs/start/) 공식 가이드를
|
||||
참조하기 바란다.
|
||||
|
|
|
@ -1,512 +0,0 @@
|
|||
---
|
||||
title: Minikube로 쿠버네티스 설치
|
||||
weight: 30
|
||||
content_type: concept
|
||||
---
|
||||
|
||||
<!-- overview -->
|
||||
|
||||
Minikube는 쿠버네티스를 로컬에서 쉽게 실행하는 도구이다. Minikube는 매일 쿠버네티스를 사용하거나 개발하려는 사용자들을 위해 가상 머신(VM) 이나 노트북에서 단일 노드 쿠버네티스 클러스터를 실행한다.
|
||||
|
||||
|
||||
|
||||
<!-- body -->
|
||||
|
||||
## Minikube 특징
|
||||
|
||||
Minikube는 다음과 같은 쿠버네티스의 기능을 제공한다.
|
||||
|
||||
* DNS
|
||||
* 노드 포트
|
||||
* 컨피그 맵과 시크릿
|
||||
* 대시보드
|
||||
* 컨테이너 런타임: [Docker](https://www.docker.com/), [CRI-O](https://cri-o.io/) 와 [containerd](https://github.com/containerd/containerd)
|
||||
* CNI(Container Network Interface) 사용
|
||||
* 인그레스
|
||||
|
||||
## 설치
|
||||
|
||||
[Minikube 설치](/ko/docs/tasks/tools/install-minikube/) 항목을 보자.
|
||||
|
||||
## 빠른 시작
|
||||
|
||||
여기서 기술하는 간단한 데모는 어떻게 로컬에서 Minikube를 시작하고, 사용하고 삭제하는지를 안내한다. 다음의 주어진 단계를 따라서 Minikube를 시작하고 탐구한다.
|
||||
|
||||
1. Minikube를 시작하고 클러스터를 생성
|
||||
|
||||
```shell
|
||||
minikube start
|
||||
```
|
||||
|
||||
결과는 다음과 비슷하다.
|
||||
|
||||
```
|
||||
Starting local Kubernetes cluster...
|
||||
Running pre-create checks...
|
||||
Creating machine...
|
||||
Starting local Kubernetes cluster...
|
||||
```
|
||||
|
||||
특정 쿠버네티스 버전, VM, 컨테이너 런타임 상에서 클러스터를 시작하기 위한 보다 상세한 정보는 [클러스터 시작하기](#클러스터-시작하기)를 참조한다.
|
||||
|
||||
2. 이제, kubectl을 통해서 클러스터와 상호작용할 수 있다. 보다 상세한 정보는 [클러스터와 상호 작용하기](#클러스터와-상호-작용하기)를 참조한다.
|
||||
|
||||
간단한 HTTP 서버인 `echoserver` 이미지를 사용해서 쿠버네티스 디플로이먼트를 만들고 `--port`를 이용해서 8080 포트로 노출해보자.
|
||||
|
||||
```shell
|
||||
kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.10
|
||||
```
|
||||
|
||||
결과는 다음과 비슷하다.
|
||||
|
||||
```
|
||||
deployment.apps/hello-minikube created
|
||||
```
|
||||
3. `hello-minikube` 디플로이먼트에 액세스하기 위해, 서비스로 노출시킨다.
|
||||
|
||||
```shell
|
||||
kubectl expose deployment hello-minikube --type=NodePort --port=8080
|
||||
```
|
||||
|
||||
`--type=NodePort` 옵션은 서비스 타입을 지정한다.
|
||||
|
||||
결과는 다음과 비슷하다.
|
||||
|
||||
```
|
||||
service/hello-minikube exposed
|
||||
```
|
||||
|
||||
4. `hello-minikube` 파드가 이제 시작되었지만 노출된 서비스를 통해서 접근하기 전에 파드가 뜨기를 기다려야한다.
|
||||
|
||||
파드가 시작되고 실행 중인지 확인한다.
|
||||
|
||||
```shell
|
||||
kubectl get pod
|
||||
```
|
||||
|
||||
출력에서 `STATUS`가 `ContainerCreating`으로 나타나는 경우, 파드는 아직 생성 중이다.
|
||||
|
||||
```
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
hello-minikube-3383150820-vctvh 0/1 ContainerCreating 0 3s
|
||||
```
|
||||
|
||||
출력에서 `STATUS`가 `Running`으로 나타나는 경우, 파드는 이제 시작돼서 실행 중이다.
|
||||
|
||||
```
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
hello-minikube-3383150820-vctvh 1/1 Running 0 13s
|
||||
```
|
||||
|
||||
5. 서비스 상세를 보기 위해서 노출된 서비스의 URL을 얻는다.
|
||||
|
||||
```shell
|
||||
minikube service hello-minikube --url
|
||||
```
|
||||
|
||||
6. 로컬 클러스터의 상세를 보기위해서, 출력에서 얻은 URL을 브라우저에 복사해서 붙여넣는다.
|
||||
|
||||
출력은 다음과 비슷하다.
|
||||
|
||||
```
|
||||
Hostname: hello-minikube-7c77b68cff-8wdzq
|
||||
|
||||
Pod Information:
|
||||
-no pod information available-
|
||||
|
||||
Server values:
|
||||
server_version=nginx: 1.13.3 - lua: 10008
|
||||
|
||||
Request Information:
|
||||
client_address=172.17.0.1
|
||||
method=GET
|
||||
real path=/
|
||||
query=
|
||||
request_version=1.1
|
||||
request_scheme=http
|
||||
request_uri=http://192.168.99.100:8080/
|
||||
|
||||
Request Headers:
|
||||
accept=*/*
|
||||
host=192.168.99.100:30674
|
||||
user-agent=curl/7.47.0
|
||||
|
||||
Request Body:
|
||||
-no body in request-
|
||||
```
|
||||
|
||||
서비스나 클러스터가 더 이상 구동되지 않도록 하려면, 삭제한다.
|
||||
|
||||
7. `hello-minikube` 서비스 삭제
|
||||
|
||||
```shell
|
||||
kubectl delete services hello-minikube
|
||||
```
|
||||
|
||||
The output is similar to this:
|
||||
|
||||
```
|
||||
service "hello-minikube" deleted
|
||||
```
|
||||
|
||||
8. `hello-minikube` 디플로이먼트 삭제
|
||||
|
||||
```shell
|
||||
kubectl delete deployment hello-minikube
|
||||
```
|
||||
|
||||
The output is similar to this:
|
||||
|
||||
```
|
||||
deployment.extensions "hello-minikube" deleted
|
||||
```
|
||||
|
||||
9. 로컬 Minikube 클러스터 중지
|
||||
|
||||
```shell
|
||||
minikube stop
|
||||
```
|
||||
|
||||
The output is similar to this:
|
||||
|
||||
```
|
||||
Stopping "minikube"...
|
||||
"minikube" stopped.
|
||||
```
|
||||
|
||||
보다 상세한 정보는 [클러스터 중지하기](#클러스터-중지하기)를 참조한다.
|
||||
|
||||
10. 로컬 Minikube 클러스터 삭제
|
||||
|
||||
```shell
|
||||
minikube delete
|
||||
```
|
||||
출력은 다음과 비슷하다.
|
||||
```
|
||||
Deleting "minikube" ...
|
||||
The "minikube" cluster has been deleted.
|
||||
```
|
||||
보다 상세한 정보는 [Deleting a cluster](#클러스터-삭제하기)를 참조한다.
|
||||
|
||||
## 클러스터 관리하기
|
||||
|
||||
### 클러스터 시작하기
|
||||
|
||||
클러스터를 시작하기 위해서 `minikube start` 커멘드를 사용할 수 있다.
|
||||
이 커멘드는 단일 노드 쿠버네티스 클러스터를 구동하는 가상 머신을 생성하고 구성한다.
|
||||
이 커멘드는 또한 [kubectl](/ko/docs/reference/kubectl/overview/)도 설정해서 클러스터와 통신할 수 있도록 한다.
|
||||
|
||||
{{< note >}}
|
||||
웹 프록시 뒤에 있다면, `minikube start` 커맨드에 해당 정보를 전달해야 한다.
|
||||
|
||||
```shell
|
||||
https_proxy=<my proxy> minikube start --docker-env http_proxy=<my proxy> --docker-env https_proxy=<my proxy> --docker-env no_proxy=192.168.99.0/24
|
||||
```
|
||||
불행하게도, 환경 변수 설정만으로는 되지 않는다.
|
||||
|
||||
Minikube는 또한 "minikube" 콘텍스트를 생성하고 이를 kubectl의 기본값으로 설정한다.
|
||||
이 콘텍스트로 돌아오려면, 다음의 코멘드를 입력한다. `kubectl config use-context minikube`.
|
||||
{{< /note >}}
|
||||
|
||||
#### 쿠버네티스 버전 지정하기
|
||||
|
||||
`minikube start` 코멘드에 `--kubernetes-version` 문자열을
|
||||
추가해서 Minikube에서 사용할 쿠버네티스 버전을 지정할 수 있다.
|
||||
예를 들어 버전 {{< param "fullversion" >}}를 구동하려면, 다음과 같이 실행한다.
|
||||
|
||||
```
|
||||
minikube start --kubernetes-version {{< param "fullversion" >}}
|
||||
```
|
||||
#### VM 드라이버 지정하기
|
||||
`minikube start` 코멘드에 `--driver=<enter_driver_name>` 플래그를 추가해서 VM 드라이버를 변경할 수 있다.
|
||||
코멘드를 예를 들면 다음과 같다.
|
||||
```shell
|
||||
minikube start --driver=<driver_name>
|
||||
```
|
||||
Minikube는 다음의 드라이버를 지원한다.
|
||||
{{< note >}}
|
||||
지원되는 드라이버와 플러그인 설치 방법에 대한 보다 상세한 정보는 [드라이버](https://minikube.sigs.k8s.io/docs/reference/drivers/)를 참조한다.
|
||||
{{< /note >}}
|
||||
|
||||
* docker ([드라이버 설치](https://minikube.sigs.k8s.io/docs/drivers/docker/))
|
||||
* virtualbox ([드라이버 설치](https://minikube.sigs.k8s.io/docs/drivers/virtualbox/))
|
||||
* podman ([드라이버 설치](https://minikube.sigs.k8s.io/docs/drivers/podman/)) (EXPERIMENTAL)
|
||||
* vmwarefusion
|
||||
* kvm2 ([드라이버 설치](https://minikube.sigs.k8s.io/docs/reference/drivers/kvm2/))
|
||||
* hyperkit ([드라이버 설치](https://minikube.sigs.k8s.io/docs/reference/drivers/hyperkit/))
|
||||
* hyperv ([드라이버 설치](https://minikube.sigs.k8s.io/docs/reference/drivers/hyperv/))
|
||||
다음 IP는 동적이며 변경할 수 있다. `minikube ip`로 알아낼 수 있다.
|
||||
* vmware ([드라이버 설치](https://minikube.sigs.k8s.io/docs/reference/drivers/vmware/)) (VMware unified driver)
|
||||
* parallels ([드라이버 설치](https://minikube.sigs.k8s.io/docs/reference/drivers/parallels/))
|
||||
* none (쿠버네티스 컴포넌트를 가상 머신이 아닌 호스트 상에서 구동한다. 리눅스를 실행중이어야 하고, {{< glossary_tooltip term_id="docker" >}}가 설치되어야 한다.)
|
||||
|
||||
{{< caution >}}
|
||||
`none` 드라이버를 사용한다면 일부 쿠버네티스 컴포넌트는 Minikube 환경 외부에 있는 부작용이 있는 권한을 가진 컨테이너로 실행된다. 이런 부작용은 개인용 워크스테이션에는 `none` 드라이버가 권장하지 않는 것을 의미 한다.
|
||||
{{< /caution >}}
|
||||
|
||||
#### 대안적인 컨테이너 런타임 상에서 클러스터 시작하기
|
||||
Minikube를 다음의 컨테이너 런타임에서 기동할 수 있다.
|
||||
{{< tabs name="container_runtimes" >}}
|
||||
{{% tab name="containerd" %}}
|
||||
[containerd](https://github.com/containerd/containerd)를 컨테이너 런타임으로 사용하려면, 다음을 실행한다.
|
||||
```bash
|
||||
minikube start \
|
||||
--network-plugin=cni \
|
||||
--enable-default-cni \
|
||||
--container-runtime=containerd \
|
||||
--bootstrapper=kubeadm
|
||||
```
|
||||
|
||||
혹은 확장 버전을 사용할 수 있다.
|
||||
|
||||
```bash
|
||||
minikube start \
|
||||
--network-plugin=cni \
|
||||
--enable-default-cni \
|
||||
--extra-config=kubelet.container-runtime=remote \
|
||||
--extra-config=kubelet.container-runtime-endpoint=unix:///run/containerd/containerd.sock \
|
||||
--extra-config=kubelet.image-service-endpoint=unix:///run/containerd/containerd.sock \
|
||||
--bootstrapper=kubeadm
|
||||
```
|
||||
{{% /tab %}}
|
||||
{{% tab name="CRI-O" %}}
|
||||
[CRI-O](https://cri-o.io/)를 컨테이너 런타임으로 사용하려면, 다음을 실행한다.
|
||||
```bash
|
||||
minikube start \
|
||||
--network-plugin=cni \
|
||||
--enable-default-cni \
|
||||
--container-runtime=cri-o \
|
||||
--bootstrapper=kubeadm
|
||||
```
|
||||
혹은 확장 버전을 사용할 수 있다.
|
||||
|
||||
```bash
|
||||
minikube start \
|
||||
--network-plugin=cni \
|
||||
--enable-default-cni \
|
||||
--extra-config=kubelet.container-runtime=remote \
|
||||
--extra-config=kubelet.container-runtime-endpoint=/var/run/crio.sock \
|
||||
--extra-config=kubelet.image-service-endpoint=/var/run/crio.sock \
|
||||
--bootstrapper=kubeadm
|
||||
```
|
||||
{{% /tab %}}
|
||||
{{< /tabs >}}
|
||||
|
||||
#### Docker 데몬 재사용을 통한 로컬 이미지 사용하기
|
||||
|
||||
쿠버네티스 단일 VM을 사용하면 Minikube에 내장된 도커 데몬을 재사용하기에 매우 간편하다. 이 경우는 호스트 장비에 도커 레지스트리를 설치하고 이미지를 푸시할 필요가 없다. 또 로컬에서 빠르게 실행할 수 있는데 이는 Minikube와 동일한 도커 데몬 안에서 이미지를 빌드하기 때문이다.
|
||||
|
||||
{{< note >}}
|
||||
Docker 이미지를 'latest'가 아닌 다른 태그로 태그했는지 확인하고 이미지를 풀링할 때에는 그 태그를 이용한다. 혹시 이미지 태그 버전을 지정하지 않았다면, 기본값은 `:latest`이고 이미지 풀링 정책은 `Always`가 가정하나, 만약 기본 Docker 레지스트리(보통 DockerHub)에 해당 Docker 이미지 버전이 없다면 `ErrImagePull`의 결과가 나타날 것이다.
|
||||
{{< /note >}}
|
||||
|
||||
맥이나 리눅스 호스트에서 해당 Docker 데몬을 사용하려면 `minikube docker-env` 에서 마지막 줄을 실행한다.
|
||||
|
||||
이제 개인의 맥/리눅스 머신 내 커멘드 라인에서 도커를 사용해서 Minikube VM 안의 도커 데몬과 통신할 수 있다.
|
||||
|
||||
```shell
|
||||
docker ps
|
||||
```
|
||||
|
||||
{{< note >}}
|
||||
Centos 7 에서 Docker는 아래와 같은 오류를 발생한다.
|
||||
|
||||
```
|
||||
Could not read CA certificate "/etc/docker/ca.pem": open /etc/docker/ca.pem: no such file or directory
|
||||
```
|
||||
|
||||
/etc/sysconfig/docker를 업데이트하고 Minikube의 환경에 변경이 반영되었는지 확인해서 고칠 수 있다.
|
||||
|
||||
```shell
|
||||
< DOCKER_CERT_PATH=/etc/docker
|
||||
---
|
||||
> if [ -z "${DOCKER_CERT_PATH}" ]; then
|
||||
> DOCKER_CERT_PATH=/etc/docker
|
||||
> fi
|
||||
```
|
||||
{{< /note >}}
|
||||
|
||||
### 쿠버네티스 구성하기
|
||||
|
||||
Minikube는 사용자가 쿠버네티스 컴포넌트를 다양한 값으로 설정할 수 있도록 하는 '설정기' 기능이 있다.
|
||||
이 기능을 사용하려면, `--extra-config` 플래그를 `minikube start` 명령어에 추가하여야 한다.
|
||||
|
||||
이 플래그는 여러번 쓸 수 있어 여러 옵션 설정을 전달 할 수 있다.
|
||||
|
||||
이 플래그는 `component.key=value`형식의 문자열로,
|
||||
앞에 `component`는 아래 목록에 하나의 문자열이며 `key`는 configuration struct의 값이고 `value`는 설정할 값이다(역주: key는 struct의 맴버명).
|
||||
|
||||
올바른 키들은 각 컴포넌트의 쿠버네티스 `componentconfigs` 문서에서 찾아 볼 수 있다.
|
||||
다음은 각각의 지원하는 설정에 대한 문서이다.
|
||||
|
||||
* [kubelet](https://godoc.org/k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig#KubeletConfiguration)
|
||||
* [apiserver](https://godoc.org/k8s.io/kubernetes/cmd/kube-apiserver/app/options#ServerRunOptions)
|
||||
* [proxy](https://godoc.org/k8s.io/kubernetes/pkg/proxy/apis/config#KubeProxyConfiguration)
|
||||
* [controller-manager](https://godoc.org/k8s.io/kubernetes/pkg/controller/apis/config#KubeControllerManagerConfiguration)
|
||||
* [etcd](https://godoc.org/github.com/coreos/etcd/etcdserver#ServerConfig)
|
||||
* [scheduler](https://godoc.org/k8s.io/kubernetes/pkg/scheduler/apis/config#KubeSchedulerConfiguration)
|
||||
|
||||
#### 예제
|
||||
|
||||
쿠블렛에서 `MaxPods` 설정을 5로 바꾸려면 `--extra-config=kubelet.MaxPods=5` 플래그를 전달하자.
|
||||
|
||||
이 기능은 또한 중첩 구조를 지원한다. 스케쥴러에서 `LeaderElection.LeaderElect` 설정을 `true`로 하려면, `--extra-config=scheduler.LeaderElection.LeaderElect=true` 플래그를 전달하자.
|
||||
|
||||
`apiserver`에서 `AuthorizationMode`를 `RBAC`으로 바꾸려면, `--extra-config=apiserver.authorization-mode=RBAC`를 사용할 수 있다.
|
||||
|
||||
### 클러스터 중지
|
||||
`minikube stop` 명령어는 클러스터를 중지하는데 사용할 수 있다.
|
||||
이 명령어는 Minikube 가상 머신을 종료하지만, 모든 클러스터 상태와 데이터를 보존한다.
|
||||
클러스터를 다시 시작하면 이전의 상태로 돌려준다.
|
||||
|
||||
### 클러스터 삭제
|
||||
`minikube delete` 명령은 클러스터를 삭제하는데 사용할 수 있다.
|
||||
이 명령어는 Minikube 가상 머신을 종료하고 삭제한다. 어떤 데이터나 상태도 보존되지 않다.
|
||||
|
||||
### Minikube 업그레이드
|
||||
macOS를 사용하고 있고 [Brew 패키지 관리자](https://brew.sh/)가 설치되어 있다면 다음과 같이 실행한다.
|
||||
|
||||
```shell
|
||||
brew update
|
||||
brew upgrade minikube
|
||||
```
|
||||
|
||||
## 클러스터와 상호 작용하기
|
||||
|
||||
### Kubectl
|
||||
|
||||
`minikube start` 명령어는 Minikube로 부르는 [kubectl 콘텍스트](/docs/reference/generated/kubectl/kubectl-commands/#-em-set-context-em-)를 생성한다.
|
||||
이 콘텍스트는 Minikube 클러스터와 통신하는 설정을 포함한다.
|
||||
|
||||
Minikube는 이 콘텍스트를 자동적으로 기본으로 설정한다. 만약 미래에 이것을 바꾸고 싶다면 다음을 실행하자.
|
||||
|
||||
`kubectl config use-context minikube`
|
||||
|
||||
혹은 다음과 같이 커맨드를 실행할 때마다 매번 콘텍스트를 전달한다.
|
||||
|
||||
`kubectl get pods --context=minikube`
|
||||
|
||||
### 대시보드
|
||||
|
||||
[쿠버네티스 대시보드](/ko/docs/tasks/access-application-cluster/web-ui-dashboard/)를 이용하려면, Minikube를 실행한 후 쉘에서 아래 명령어를 실행하여 주소를 확인한다.
|
||||
|
||||
```shell
|
||||
minikube dashboard
|
||||
```
|
||||
|
||||
### 서비스
|
||||
|
||||
노드 포트로 노출된 서비스를 접근하기 위해, Minikube를 시작한 이후 쉘에서 아래 명령어를 실행하여 주소를 확인하자.
|
||||
|
||||
```shell
|
||||
minikube service [-n NAMESPACE] [--url] NAME
|
||||
```
|
||||
|
||||
## 네트워킹
|
||||
|
||||
Minikube VM은 host-only IP 주소를 통해 호스트 시스템에 노출되고, 이 IP 주소는 `minikube ip` 명령어로 확인할 수 있다.
|
||||
`NodePort` 서비스 타입은 IP 주소에 해당 노드 포트로 접근할 수 있다.
|
||||
|
||||
서비스의 NodePort를 확인하려면 `kubectl` 명령어로 아래와 같이 하면 된다.
|
||||
|
||||
`kubectl get service $SERVICE --output='jsonpath="{.spec.ports[0].nodePort}"'`
|
||||
|
||||
## 퍼시스턴트 볼륨
|
||||
Minikube는 [퍼시스턴트 볼륨](/ko/docs/concepts/storage/persistent-volumes/)을 `hostPath` 타입으로 지원한다.
|
||||
이런 퍼시스턴트 볼륨은 Minikube VM 내에 디렉터리로 매핑됩니다.
|
||||
|
||||
Minikube VM은 tmpfs에서 부트하는데, 매우 많은 디렉터리가 재부트(`minikube stop`)까지는 유지되지 않다.
|
||||
그러나, Minikube는 다음의 호스트 디렉터리 아래 파일은 유지하도록 설정되어 있다.
|
||||
|
||||
* `/data`
|
||||
* `/var/lib/minikube`
|
||||
* `/var/lib/docker`
|
||||
|
||||
이것은 `/data` 디렉터리에 데이터를 보존하도록 한 퍼시스턴트 볼륨 환경설정의 예이다.
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: pv0001
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
capacity:
|
||||
storage: 5Gi
|
||||
hostPath:
|
||||
path: /data/pv0001/
|
||||
```
|
||||
|
||||
## 호스트 폴더 마운트
|
||||
어떤 드라이버는 VM 안에 호스트 폴더를 마운트하여 VM과 호스트 사이에 쉽게 파일을 공유할 수 있게 한다. 이들은 지금 설정할 수 없고 사용하는 드라이버나 운영체제에 따라 다르다.
|
||||
|
||||
{{< note >}}
|
||||
호스트 폴더 공유는 KVM 드라이버에서 아직 구현되어 있지 않다.
|
||||
{{< /note >}}
|
||||
|
||||
| Driver | OS | HostFolder | VM |
|
||||
| --- | --- | --- | --- |
|
||||
| VirtualBox | 리눅스 | `/home` | `/hosthome` |
|
||||
| VirtualBox | macOS | `/Users` | `/Users` |
|
||||
| VirtualBox | 윈도우 | `C://Users` | `/c/Users` |
|
||||
| VMware Fusion | macOS | `/Users` | `/mnt/hgfs/Users` |
|
||||
| Xhyve | macOS | `/Users` | `/Users` |
|
||||
|
||||
## 프라이빗 컨테이너 레지스트리
|
||||
|
||||
프라이빗 컨테이너 레지스트리를 이용하려면, [이 페이지](/ko/docs/concepts/containers/images/)의 단계를 따르자.
|
||||
|
||||
`ImagePullSecrets`를 이용하기를 권하지만, Minikube VM 상에서 설정하려 한다면 `/home/docker` 디렉터리에 `.dockercfg`를 두거나 `/home/docker/.docker` 디렉터리에 `config.json`을 둘 수 있다.
|
||||
|
||||
## 애드온
|
||||
|
||||
Minikube에서 커스텀 애드온을 적절히 시작하고 재시작할 수 있으려면,
|
||||
Minikube와 함께 시작하려는 애드온을 `~/.minikube/addons` 디렉터리에 두자.
|
||||
폴더 내부의 애드온은 Minikube VM으로 이동되어
|
||||
Minikube가 시작하거나 재시작될 때에 함께 실행된다.
|
||||
|
||||
## HTTP 프록시 환경에서 Minikube 사용하기
|
||||
|
||||
Minikube는 쿠버네티스와 Docker 데몬을 포함한 가상 머신을 생성한다.
|
||||
쿠버네티스가 Docker를 이용하여 컨테이너를 스케쥴링 시도할 때에, Docker 데몬은 컨테이너 이미지를 풀링하기 위해 외부 네트워크를 이용해야 한다.
|
||||
|
||||
HTTP 프록시 내부라면, Docker에서 프록시 설정을 해야 한다.
|
||||
이를 하기 위해서 요구되는 환경 변수를 `minikube start` 중에 플래그로 전달한다.
|
||||
|
||||
예를 들어:
|
||||
|
||||
```shell
|
||||
minikube start --docker-env http_proxy=http://$YOURPROXY:PORT \
|
||||
--docker-env https_proxy=https://$YOURPROXY:PORT
|
||||
```
|
||||
|
||||
만약 가상 머신 주소가 192.168.99.100 이라면 프록시 설정이 `kubectl`에 직접적으로 도달하지 못할 수도 있다.
|
||||
이 IP 주소에 대해 프록시 설정을 지나치게 하려면 no_proxy 설정을 수정해야 한다. 다음과 같이 할 수 있다.
|
||||
|
||||
```shell
|
||||
export no_proxy=$no_proxy,$(minikube ip)
|
||||
```
|
||||
|
||||
## 알려진 이슈
|
||||
|
||||
다중 노드가 필요한 기능은 Minukube에서 동작하지 않는다.
|
||||
|
||||
## 설계
|
||||
|
||||
Minikube는 VM 프로비저닝을 위해서 [libmachine](https://github.com/docker/machine/tree/master/libmachine)를 사용하고, 쿠버네티스 클러스터를 프로비저닝하기 위해 [kubeadm](https://github.com/kubernetes/kubeadm)을 사용한다.
|
||||
|
||||
Minikube에 대한 더 자세한 정보는, [제안](https://git.k8s.io/community/contributors/design-proposals/cluster-lifecycle/local-cluster-ux.md) 부분을 읽어보자.
|
||||
|
||||
## 추가적인 링크:
|
||||
|
||||
* **목표와 비목표**: Minikube 프로젝트의 목표와 비목표에 대해서는 [로드맵](https://minikube.sigs.k8s.io/docs/contrib/roadmap/)을 살펴보자.
|
||||
* **개발 가이드**: 풀 리퀘스트를 보내는 방법에 대한 개요는 [기여하기](https://minikube.sigs.k8s.io/docs/contrib/)를 살펴보자.
|
||||
* **Minikube 빌드**: Minikube를 소스에서 빌드/테스트하는 방법은 [빌드 가이드](https://minikube.sigs.k8s.io/docs/contrib/building/)를 살펴보자.
|
||||
* **새 의존성 추가하기**: Minikube에 새 의존성을 추가하는 방법에 대해서는, [의존성 추가 가이드](https://minikube.sigs.k8s.io/docs/contrib/drivers/)를 보자.
|
||||
* **새 애드온 추가하기**: Minikube에 새 애드온을 추가하는 방법에 대해서는, [애드온 추가 가이드](https://minikube.sigs.k8s.io/docs/contrib/addons/)를 보자.
|
||||
* **MicroK8s**: 가상 머신을 사용하지 않으려는 리눅스 사용자는 대안으로 [MicroK8s](https://microk8s.io/)를 고려할 수 있다.
|
||||
|
||||
## 커뮤니티
|
||||
|
||||
컨트리뷰션, 질문과 의견은 모두 환영하며 격려한다! Minikube 개발자는 [슬랙](https://kubernetes.slack.com)에 `#minikube` 채널(초청받으려면 [여기](https://slack.kubernetes.io/))에 상주하고 있다. 또한 [kubernetes-dev 구글 그룹 메일링 리스트](https://groups.google.com/forum/#!forum/kubernetes-dev)도 있다. 메일링 리스트에 포스팅한다면 제목에 "minikube: "라는 접두어를 사용하자.
|
|
@ -4,126 +4,133 @@ content_type: concept
|
|||
weight: 10
|
||||
---
|
||||
<!-- overview -->
|
||||
{{< feature-state for_k8s_version="v1.6" state="stable" >}}
|
||||
파드에서 컨테이너를 실행하기 위해 쿠버네티스는 컨테이너 런타임을 사용한다.
|
||||
이 페이지는 다양한 런타임들에 대한 설치 지침을 담고 있다.
|
||||
|
||||
|
||||
파드가 노드에서 실행될 수 있도록 클러스터의 각 노드에
|
||||
{{< glossary_tooltip text="컨테이너 런타임" term_id="container-runtime" >}}을
|
||||
설치해야 한다. 이 페이지에서는 관련된 항목을 설명하고
|
||||
노드 설정 관련 작업을 설명한다.
|
||||
|
||||
<!-- body -->
|
||||
|
||||
이 페이지에는 리눅스 환경의 쿠버네티스에서 여러 공통 컨테이너 런타임을 사용하는 방법에 대한
|
||||
세부 정보가 있다.
|
||||
|
||||
{{< caution >}}
|
||||
컨테이너를 실행할 때 runc가 시스템 파일 디스크립터를 처리하는 방식에서 결함이 발견되었다.
|
||||
악성 컨테이너는 이 결함을 사용하여 runc 바이너리의 내용을 덮어쓸 수 있으며
|
||||
따라서 컨테이너 호스트 시스템에서 임의의 명령을 실행할 수 있다.
|
||||
|
||||
문제에 대한 자세한 내용은 [CVE-2019-5736](https://access.redhat.com/security/cve/cve-2019-5736)
|
||||
를 참고한다.
|
||||
{{< /caution >}}
|
||||
|
||||
### 적용 가능성
|
||||
- [containerd](#containerd)
|
||||
- [CRI-O](#cri-o)
|
||||
- [도커](#도커)
|
||||
|
||||
{{< note >}}
|
||||
이 문서는 리눅스에 CRI를 설치하는 사용자를 위해 작성되었다.
|
||||
다른 운영 체제의 경우, 해당 플랫폼과 관련된 문서를 찾아보자.
|
||||
{{< /note >}}
|
||||
|
||||
### Cgroup 드라이버
|
||||
|
||||
리눅스 배포판의 init 시스템이 systemd인 경우, init 프로세스는
|
||||
root control group(`cgroup`)을 생성 및 사용하는 cgroup 관리자로 작동한다.
|
||||
Systemd는 cgroup과의 긴밀한 통합을 통해 프로세스당 cgroup을 할당한다.
|
||||
컨테이너 런타임과 kubelet이 `cgroupfs`를 사용하도록 설정할 수 있다.
|
||||
systemd와 함께`cgroupfs`를 사용하면 두 개의 서로 다른 cgroup 관리자가 존재하게 된다는 뜻이다.
|
||||
## Cgroup 드라이버
|
||||
|
||||
Control group은 프로세스에 할당된 리소스를 제한하는데 사용된다.
|
||||
단일 cgroup 관리자는 할당된 리소스가 무엇인지를 단순화하고,
|
||||
기본적으로 사용가능한 리소스와 사용중인 리소스를 일관성있게 볼 수 있다.
|
||||
관리자가 두 개인 경우, 이런 리소스도 두 개의 관점에서 보게 된다. kubelet과 Docker는
|
||||
`cgroupfs`를 사용하고 나머지 프로세스는
|
||||
`systemd`를 사용하도록 노드가 설정된 경우,
|
||||
리소스가 부족할 때 불안정해지는 사례를 본 적이 있다.
|
||||
|
||||
리눅스 배포판의 init 시스템이 [systemd](https://www.freedesktop.org/wiki/Software/systemd/)인
|
||||
경우, init 프로세스는 root control group(`cgroup`)을
|
||||
생성 및 사용하는 cgroup 관리자로 작동한다.
|
||||
Systemd는 cgroup과의 긴밀한 통합을 통해 프로세스당 cgroup을 할당한다.
|
||||
컨테이너 런타임과 kubelet이 `cgroupfs`를 사용하도록 설정할 수 있다. systemd와 함께
|
||||
`cgroupfs`를 사용하면 두 개의 서로 다른 cgroup 관리자가 존재하게 된다는 뜻이다.
|
||||
|
||||
단일 cgroup 관리자는 할당되는 리소스가 무엇인지를 단순화하고,
|
||||
기본적으로 사용할 수 있는 리소스와 사용 중인 리소스를 일관성있게 볼 수 있다.
|
||||
시스템에 두 개의 cgroup 관리자가 있으면, 이런 리소스도 두 개의 관점에서 보게 된다.
|
||||
현장에서 사람들은 kubelet과 도커에 `cgroupfs`를 사용하고,
|
||||
나머지 프로세스는 `systemd`를 사용하도록 노드가 설정된 경우, 리소스가 부족할 때
|
||||
불안정해지는 사례를 보고했다.
|
||||
|
||||
컨테이너 런타임과 kubelet이 `systemd`를 cgroup 드라이버로 사용하도록 설정을 변경하면
|
||||
시스템이 안정화된다. 아래의 도커 설정에서 `native.cgroupdriver=systemd` 옵션을 확인하라.
|
||||
시스템이 안정화된다. 도커에 대해 구성하려면, `native.cgroupdriver=systemd`를 설정한다.
|
||||
|
||||
{{< caution >}}
|
||||
클러스터에 결합되어 있는 노드의 cgroup 관리자를 변경하는 것은 권장하지 않는다.
|
||||
클러스터에 결합되어 있는 노드의 cgroup 관리자를 변경하는 것은 강력하게 권장하지 *않는다*.
|
||||
하나의 cgroup 드라이버의 의미를 사용하여 kubelet이 파드를 생성해왔다면,
|
||||
컨테이너 런타임을 다른 cgroup 드라이버로 변경하는 것은 존재하는 기존 파드에 대해 PodSandBox를 재생성을 시도할 때, 에러가 발생할 수 있다.
|
||||
kubelet을 재시작 하는 것은 에러를 해결할 수 없을 것이다.
|
||||
추천하는 방법은 워크로드에서 노드를 제거하고, 클러스터에서 제거한 다음 다시 결합시키는 것이다.
|
||||
컨테이너 런타임을 다른 cgroup 드라이버로 변경하는 것은 존재하는 기존 파드에 대해 파드 샌드박스 재생성을 시도할 때, 에러가 발생할 수 있다.
|
||||
kubelet을 재시작하는 것은 에러를 해결할 수 없을 것이다.
|
||||
|
||||
자동화가 가능하다면, 업데이트된 구성을 사용하여 노드를 다른 노드로
|
||||
교체하거나, 자동화를 사용하여 다시 설치한다.
|
||||
{{< /caution >}}
|
||||
|
||||
## 도커
|
||||
## 컨테이너 런타임
|
||||
|
||||
각 머신들에 대해서, 도커를 설치한다.
|
||||
버전 19.03.11이 추천된다. 그러나 1.13.1, 17.03, 17.06, 17.09, 18.06 그리고 18.09도 동작하는 것으로 알려져 있다.
|
||||
쿠버네티스 릴리스 노트를 통해서, 최신에 검증된 도커 버전의 지속적인 파악이 필요하다.
|
||||
{{% thirdparty-content %}}
|
||||
|
||||
시스템에 도커를 설치하기 위해서 아래의 커맨드들을 사용한다.
|
||||
### containerd
|
||||
|
||||
{{< tabs name="tab-cri-docker-installation" >}}
|
||||
{{% tab name="Ubuntu 16.04+" %}}
|
||||
이 섹션에는 `containerd` 를 CRI 런타임으로 사용하는 데 필요한 단계가 포함되어 있다.
|
||||
|
||||
필수 구성 요소를 설치 및 구성한다.
|
||||
|
||||
```shell
|
||||
# (도커 CE 설치)
|
||||
## 리포지터리 설정
|
||||
### apt가 HTTPS 리포지터리를 사용할 수 있도록 해주는 패키지 설치
|
||||
sudo apt-get update && sudo apt-get install -y \
|
||||
apt-transport-https ca-certificates curl software-properties-common gnupg2
|
||||
```
|
||||
|
||||
```shell
|
||||
# 도커 공식 GPG 키 추가
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
|
||||
```
|
||||
|
||||
```shell
|
||||
# 도커 apt 리포지터리 추가.
|
||||
sudo add-apt-repository \
|
||||
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
|
||||
$(lsb_release -cs) \
|
||||
stable"
|
||||
```
|
||||
|
||||
```shell
|
||||
# 도커 CE 설치.
|
||||
sudo apt-get update && sudo apt-get install -y \
|
||||
containerd.io=1.2.13-2 \
|
||||
docker-ce=5:19.03.11~3-0~ubuntu-$(lsb_release -cs) \
|
||||
docker-ce-cli=5:19.03.11~3-0~ubuntu-$(lsb_release -cs)
|
||||
```
|
||||
|
||||
```shell
|
||||
# 도커 데몬 설정
|
||||
cat <<EOF | sudo tee /etc/docker/daemon.json
|
||||
{
|
||||
"exec-opts": ["native.cgroupdriver=systemd"],
|
||||
"log-driver": "json-file",
|
||||
"log-opts": {
|
||||
"max-size": "100m"
|
||||
},
|
||||
"storage-driver": "overlay2"
|
||||
}
|
||||
cat <<EOF | sudo tee /etc/modules-load.d/containerd.conf
|
||||
overlay
|
||||
br_netfilter
|
||||
EOF
|
||||
|
||||
sudo modprobe overlay
|
||||
sudo modprobe br_netfilter
|
||||
|
||||
# 필요한 sysctl 파라미터를 설정하면 재부팅 후에도 유지된다.
|
||||
cat <<EOF | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf
|
||||
net.bridge.bridge-nf-call-iptables = 1
|
||||
net.ipv4.ip_forward = 1
|
||||
net.bridge.bridge-nf-call-ip6tables = 1
|
||||
EOF
|
||||
|
||||
# 재부팅하지 않고 sysctl 파라미터 적용
|
||||
sudo sysctl --system
|
||||
```
|
||||
|
||||
containerd를 설치한다.
|
||||
|
||||
{{< tabs name="tab-cri-containerd-installation" >}}
|
||||
{{% tab name="Ubuntu 16.04" %}}
|
||||
|
||||
```shell
|
||||
# 도커의 공식 GPG 키 추가
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
|
||||
# (containerd 설치)
|
||||
## 리포지터리 설정
|
||||
### HTTPS를 통해 리포지터리를 사용할 수 있도록 패키지 설치
|
||||
sudo apt-get update && sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
|
||||
```
|
||||
|
||||
```shell
|
||||
sudo mkdir -p /etc/systemd/system/docker.service.d
|
||||
## 도커의 공식 GPG 키 추가
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key --keyring /etc/apt/trusted.gpg.d/docker.gpg add -
|
||||
```
|
||||
|
||||
```shell
|
||||
# 도커 재시작.
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart docker
|
||||
## 도커 apt 리포지터리 추가
|
||||
sudo add-apt-repository \
|
||||
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
|
||||
$(lsb_release -cs) \
|
||||
stable"
|
||||
```
|
||||
|
||||
```shell
|
||||
## containerd 설치
|
||||
sudo apt-get update && sudo apt-get install -y containerd.io
|
||||
```
|
||||
|
||||
```shell
|
||||
# containerd 구성
|
||||
sudo mkdir -p /etc/containerd
|
||||
sudo containerd config default > /etc/containerd/config.toml
|
||||
```
|
||||
|
||||
```shell
|
||||
# containerd 재시작
|
||||
sudo systemctl restart containerd
|
||||
```
|
||||
{{% /tab %}}
|
||||
{{% tab name="CentOS/RHEL 7.4+" %}}
|
||||
|
||||
```shell
|
||||
# (도커 CE 설치)
|
||||
# (containerd 설치)
|
||||
## 리포지터리 설정
|
||||
### 필요한 패키지 설치
|
||||
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
|
||||
|
@ -131,64 +138,73 @@ sudo yum install -y yum-utils device-mapper-persistent-data lvm2
|
|||
|
||||
```shell
|
||||
## 도커 리포지터리 추가
|
||||
sudo yum-config-manager --add-repo \
|
||||
https://download.docker.com/linux/centos/docker-ce.repo
|
||||
sudo yum-config-manager \
|
||||
--add-repo \
|
||||
https://download.docker.com/linux/centos/docker-ce.repo
|
||||
```
|
||||
|
||||
```shell
|
||||
# 도커 CE 설치.
|
||||
sudo yum update -y && sudo yum install -y \
|
||||
containerd.io-1.2.13 \
|
||||
docker-ce-19.03.11 \
|
||||
docker-ce-cli-19.03.11
|
||||
# containerd 설치
|
||||
sudo yum update -y && sudo yum install -y containerd.io
|
||||
```
|
||||
|
||||
```shell
|
||||
## /etc/docker 생성.
|
||||
sudo mkdir /etc/docker
|
||||
## containerd 구성
|
||||
sudo mkdir -p /etc/containerd
|
||||
sudo containerd config default > /etc/containerd/config.toml
|
||||
```
|
||||
|
||||
```shell
|
||||
# 도커 데몬 설정.
|
||||
cat <<EOF | sudo tee /etc/docker/daemon.json
|
||||
{
|
||||
"exec-opts": ["native.cgroupdriver=systemd"],
|
||||
"log-driver": "json-file",
|
||||
"log-opts": {
|
||||
"max-size": "100m"
|
||||
},
|
||||
"storage-driver": "overlay2",
|
||||
"storage-opts": [
|
||||
"overlay2.override_kernel_check=true"
|
||||
]
|
||||
}
|
||||
EOF
|
||||
# containerd 재시작
|
||||
sudo systemctl restart containerd
|
||||
```
|
||||
{{% /tab %}}
|
||||
{{% tab name="Windows (PowerShell)" %}}
|
||||
```powershell
|
||||
# (Install containerd)
|
||||
# download containerd
|
||||
cmd /c curl -OL https://github.com/containerd/containerd/releases/download/v1.4.0-beta.2/containerd-1.4.0-beta.2-windows-amd64.tar.gz
|
||||
cmd /c tar xvf .\containerd-1.4.0-beta.2-windows-amd64.tar.gz
|
||||
```
|
||||
|
||||
```shell
|
||||
sudo mkdir -p /etc/systemd/system/docker.service.d
|
||||
```powershell
|
||||
# 추출 및 구성
|
||||
Copy-Item -Path ".\bin\" -Destination "$Env:ProgramFiles\containerd" -Recurse -Force
|
||||
cd $Env:ProgramFiles\containerd\
|
||||
.\containerd.exe config default | Out-File config.toml -Encoding ascii
|
||||
|
||||
# 구성을 검토한다. 설정에 따라 조정할 수 있다.
|
||||
# - sandbox_image (쿠버네티스 pause 이미지)
|
||||
# - cni bin_dir 및 conf_dir locations
|
||||
Get-Content config.toml
|
||||
```
|
||||
|
||||
```shell
|
||||
# 도커 재시작.
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart docker
|
||||
```powershell
|
||||
# containerd 시작
|
||||
.\containerd.exe --register-service
|
||||
Start-Service containerd
|
||||
```
|
||||
{{% /tab %}}
|
||||
{{< /tabs >}}
|
||||
|
||||
부팅 시 도커 서비스를 시작하려면, 다음 명령을 실행한다.
|
||||
#### systemd {#containerd-systemd}
|
||||
|
||||
```shell
|
||||
sudo systemctl enable docker
|
||||
`/etc/containerd/config.toml` 의 `systemd` cgroup 드라이버를 `runc` 에서 사용하려면, 다음과 같이 설정한다.
|
||||
|
||||
```
|
||||
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
|
||||
...
|
||||
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
|
||||
SystemdCgroup = true
|
||||
```
|
||||
|
||||
자세한 내용은 [공식 도커 설치 가이드](https://docs.docker.com/engine/installation/)
|
||||
를 참고한다.
|
||||
kubeadm을 사용하는 경우,
|
||||
[kubelet용 cgroup 드라이버](/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#configure-cgroup-driver-used-by-kubelet-on-control-plane-node)를 수동으로 구성한다.
|
||||
|
||||
## CRI-O
|
||||
### CRI-O
|
||||
|
||||
이 섹션은 `CRI-O`를 CRI 런타임으로 설치하는 필수적인 단계를 담고 있다.
|
||||
이 섹션은 CRI-O를 컨테이너 런타임으로 설치하는 필수적인 단계를 담고 있다.
|
||||
|
||||
시스템에 CRI-O를 설치하기 위해서 다음의 커맨드를 사용한다.
|
||||
|
||||
|
@ -197,7 +213,7 @@ CRI-O 메이저와 마이너 버전은 쿠버네티스 메이저와 마이너
|
|||
더 자세한 정보는 [CRI-O 호환 매트릭스](https://github.com/cri-o/cri-o)를 본다.
|
||||
{{< /note >}}
|
||||
|
||||
### 선행 조건
|
||||
필수 구성 요소를 설치하고 구성한다.
|
||||
|
||||
```shell
|
||||
sudo modprobe overlay
|
||||
|
@ -216,9 +232,10 @@ sudo sysctl --system
|
|||
{{< tabs name="tab-cri-cri-o-installation" >}}
|
||||
{{% tab name="Debian" %}}
|
||||
|
||||
다음의 운영 체제에서 CRI-O를 설치하려면, 환경 변수 $OS를 아래의 표에서 적절한 필드로 설정한다.
|
||||
다음의 운영 체제에서 CRI-O를 설치하려면, 환경 변수 `OS` 를
|
||||
아래의 표에서 적절한 필드로 설정한다.
|
||||
|
||||
| 운영 체제 | $OS |
|
||||
| 운영 체제 | `$OS` |
|
||||
| ---------------- | ----------------- |
|
||||
| Debian Unstable | `Debian_Unstable` |
|
||||
| Debian Testing | `Debian_Testing` |
|
||||
|
@ -233,14 +250,14 @@ sudo sysctl --system
|
|||
그런 다음, 아래를 실행한다.
|
||||
```shell
|
||||
cat <<EOF | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
|
||||
"deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS/ /"
|
||||
deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS/ /
|
||||
EOF
|
||||
cat <<EOF | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:$VERSION.list
|
||||
"deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/$VERSION/$OS/ /"
|
||||
deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/$VERSION/$OS/ /
|
||||
EOF
|
||||
|
||||
curl -L https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:$VERSION/$OS/Release.key | sudo apt-key add -
|
||||
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS/Release.key | sudo apt-key add -
|
||||
curl -L https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:$VERSION/$OS/Release.key | sudo apt-key --keyring /etc/apt/trusted.gpg.d/libcontainers.gpg add -
|
||||
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS/Release.key | sudo apt-key --keyring /etc/apt/trusted.gpg.d/libcontainers.gpg add -
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install cri-o cri-o-runc
|
||||
|
@ -249,9 +266,9 @@ sudo apt-get install cri-o cri-o-runc
|
|||
|
||||
{{% tab name="Ubuntu" %}}
|
||||
|
||||
다음의 운영 체제에서 CRI-O를 설치하려면, 환경 변수 $OS를 아래의 표에서 적절한 필드로 설정한다.
|
||||
다음의 운영 체제에서 CRI-O를 설치하려면, 환경 변수 `OS` 를 아래의 표에서 적절한 필드로 설정한다.
|
||||
|
||||
| 운영 체제 | $OS |
|
||||
| 운영 체제 | `$OS` |
|
||||
| ---------------- | ----------------- |
|
||||
| Ubuntu 20.04 | `xUbuntu_20.04` |
|
||||
| Ubuntu 19.10 | `xUbuntu_19.10` |
|
||||
|
@ -267,11 +284,15 @@ sudo apt-get install cri-o cri-o-runc
|
|||
|
||||
그런 다음, 아래를 실행한다.
|
||||
```shell
|
||||
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS/ /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
|
||||
echo "deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/$VERSION/$OS/ /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:$VERSION.list
|
||||
cat <<EOF | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
|
||||
deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS/ /
|
||||
EOF
|
||||
cat <<EOF | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:$VERSION.list
|
||||
deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/$VERSION/$OS/ /
|
||||
EOF
|
||||
|
||||
curl -L https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:$VERSION/$OS/Release.key | apt-key add -
|
||||
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS/Release.key | apt-key add -
|
||||
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS/Release.key | sudo apt-key --keyring /etc/apt/trusted.gpg.d/libcontainers.gpg add -
|
||||
curl -L https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:$VERSION/$OS/Release.key | sudo apt-key --keyring /etc/apt/trusted.gpg.d/libcontainers-cri-o.gpg add -
|
||||
|
||||
apt-get update
|
||||
apt-get install cri-o cri-o-runc
|
||||
|
@ -280,9 +301,9 @@ apt-get install cri-o cri-o-runc
|
|||
|
||||
{{% tab name="CentOS" %}}
|
||||
|
||||
다음의 운영 체제에서 CRI-O를 설치하려면, 환경 변수 $OS를 아래의 표에서 적절한 필드로 설정한다.
|
||||
다음의 운영 체제에서 CRI-O를 설치하려면, 환경 변수 `OS` 를 아래의 표에서 적절한 필드로 설정한다.
|
||||
|
||||
| 운영 체제 | $OS |
|
||||
| 운영 체제 | `$OS` |
|
||||
| ---------------- | ----------------- |
|
||||
| Centos 8 | `CentOS_8` |
|
||||
| Centos 8 Stream | `CentOS_8_Stream` |
|
||||
|
@ -330,7 +351,7 @@ sudo dnf install cri-o
|
|||
{{% /tab %}}
|
||||
{{< /tabs >}}
|
||||
|
||||
### CRI-O 시작
|
||||
CRI-O를 시작한다.
|
||||
|
||||
```shell
|
||||
sudo systemctl daemon-reload
|
||||
|
@ -340,78 +361,75 @@ sudo systemctl start crio
|
|||
자세한 사항은 [CRI-O 설치 가이드](https://github.com/kubernetes-sigs/cri-o#getting-started)를
|
||||
참고한다.
|
||||
|
||||
## Containerd
|
||||
### 도커
|
||||
|
||||
이 섹션은 `containerd`를 CRI 런타임으로써 사용하는데 필요한 단계를 담고 있다.
|
||||
각 노드에 도커 CE를 설치한다.
|
||||
|
||||
Containerd를 시스템에 설치하기 위해서 다음의 커맨드들을 사용한다.
|
||||
쿠버네티스 릴리스 정보에서 해당 버전의 쿠버네티스와 호환되는 도커 버전을 찾을 수 있다.
|
||||
|
||||
### 선행 조건
|
||||
사용자의 시스템에서 다음의 명령을 이용해 도커를 설치한다.
|
||||
|
||||
{{< tabs name="tab-cri-docker-installation" >}}
|
||||
{{% tab name="Ubuntu 16.04+" %}}
|
||||
|
||||
```shell
|
||||
cat <<EOF | sudo tee /etc/modules-load.d/containerd.conf
|
||||
overlay
|
||||
br_netfilter
|
||||
EOF
|
||||
|
||||
sudo modprobe overlay
|
||||
sudo modprobe br_netfilter
|
||||
|
||||
# 요구되는 sysctl 파라미터 설정, 이 설정은 재부팅에서도 유지된다.
|
||||
cat <<EOF | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf
|
||||
net.bridge.bridge-nf-call-iptables = 1
|
||||
net.ipv4.ip_forward = 1
|
||||
net.bridge.bridge-nf-call-ip6tables = 1
|
||||
EOF
|
||||
|
||||
sudo sysctl --system
|
||||
```
|
||||
|
||||
### containerd 설치
|
||||
|
||||
{{< tabs name="tab-cri-containerd-installation" >}}
|
||||
{{% tab name="Ubuntu 16.04" %}}
|
||||
|
||||
```shell
|
||||
# (containerd 설치)
|
||||
# (도커 CE 설치)
|
||||
## 리포지터리 설정
|
||||
### apt가 HTTPS로 리포지터리를 사용하는 것을 허용하기 위한 패키지 설치
|
||||
sudo apt-get update && sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
|
||||
sudo apt-get update && sudo apt-get install -y \
|
||||
apt-transport-https ca-certificates curl software-properties-common gnupg2
|
||||
```
|
||||
|
||||
```shell
|
||||
## 도커 공식 GPG 키 추가
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
|
||||
# 도커 공식 GPG 키 추가:
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key --keyring /etc/apt/trusted.gpg.d/docker.gpg add -
|
||||
```
|
||||
|
||||
```shell
|
||||
## 도커 apt 리포지터리 추가.
|
||||
# 도커 apt 리포지터리 추가:
|
||||
sudo add-apt-repository \
|
||||
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
|
||||
$(lsb_release -cs) \
|
||||
stable"
|
||||
deb [arch=amd64] https://download.docker.com/linux/ubuntu \
|
||||
$(lsb_release -cs) \
|
||||
stable"
|
||||
```
|
||||
|
||||
```shell
|
||||
## containerd 설치
|
||||
sudo apt-get update && sudo apt-get install -y containerd.io
|
||||
# 도커 CE 설치
|
||||
sudo apt-get update && sudo apt-get install -y \
|
||||
containerd.io=1.2.13-2 \
|
||||
docker-ce=5:19.03.11~3-0~ubuntu-$(lsb_release -cs) \
|
||||
docker-ce-cli=5:19.03.11~3-0~ubuntu-$(lsb_release -cs)
|
||||
```
|
||||
|
||||
```shell
|
||||
# containerd 설정
|
||||
sudo mkdir -p /etc/containerd
|
||||
sudo containerd config default > /etc/containerd/config.toml
|
||||
# 도커 데몬 설정
|
||||
cat <<EOF | sudo tee /etc/docker/daemon.json
|
||||
{
|
||||
"exec-opts": ["native.cgroupdriver=systemd"],
|
||||
"log-driver": "json-file",
|
||||
"log-opts": {
|
||||
"max-size": "100m"
|
||||
},
|
||||
"storage-driver": "overlay2"
|
||||
}
|
||||
EOF
|
||||
```
|
||||
|
||||
```shell
|
||||
# containerd 재시작
|
||||
sudo systemctl restart containerd
|
||||
# /etc/systemd/system/docker.service.d 생성
|
||||
sudo mkdir -p /etc/systemd/system/docker.service.d
|
||||
```
|
||||
|
||||
```shell
|
||||
# 도커 재시작
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart docker
|
||||
```
|
||||
{{% /tab %}}
|
||||
{{% tab name="CentOS/RHEL 7.4+" %}}
|
||||
|
||||
```shell
|
||||
# (containerd 설치)
|
||||
# (도커 CE 설치)
|
||||
## 리포지터리 설정
|
||||
### 필요한 패키지 설치
|
||||
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
|
||||
|
@ -419,66 +437,58 @@ sudo yum install -y yum-utils device-mapper-persistent-data lvm2
|
|||
|
||||
```shell
|
||||
## 도커 리포지터리 추가
|
||||
sudo yum-config-manager \
|
||||
--add-repo \
|
||||
https://download.docker.com/linux/centos/docker-ce.repo
|
||||
sudo yum-config-manager --add-repo \
|
||||
https://download.docker.com/linux/centos/docker-ce.repo
|
||||
```
|
||||
|
||||
```shell
|
||||
## containerd 설치
|
||||
sudo yum update -y && yum install -y containerd.io
|
||||
# 도커 CE 설치
|
||||
sudo yum update -y && sudo yum install -y \
|
||||
containerd.io-1.2.13 \
|
||||
docker-ce-19.03.11 \
|
||||
docker-ce-cli-19.03.11
|
||||
```
|
||||
|
||||
```shell
|
||||
## containerd 설정
|
||||
sudo mkdir -p /etc/containerd
|
||||
sudo containerd config default > /etc/containerd/config.toml
|
||||
## /etc/docker 생성
|
||||
sudo mkdir /etc/docker
|
||||
```
|
||||
|
||||
```shell
|
||||
# containerd 재시작
|
||||
sudo systemctl restart containerd
|
||||
```
|
||||
{{% /tab %}}
|
||||
{{% tab name="윈도우 (PowerShell)" %}}
|
||||
```powershell
|
||||
# (containerd 설치)
|
||||
# containerd 다운로드
|
||||
cmd /c curl -OL https://github.com/containerd/containerd/releases/download/v1.4.0-beta.2/containerd-1.4.0-beta.2-windows-amd64.tar.gz
|
||||
cmd /c tar xvf .\containerd-1.4.0-beta.2-windows-amd64.tar.gz
|
||||
# 도커 데몬 설정
|
||||
cat <<EOF | sudo tee /etc/docker/daemon.json
|
||||
{
|
||||
"exec-opts": ["native.cgroupdriver=systemd"],
|
||||
"log-driver": "json-file",
|
||||
"log-opts": {
|
||||
"max-size": "100m"
|
||||
},
|
||||
"storage-driver": "overlay2",
|
||||
"storage-opts": [
|
||||
"overlay2.override_kernel_check=true"
|
||||
]
|
||||
}
|
||||
EOF
|
||||
```
|
||||
|
||||
```powershell
|
||||
# 압축을 풀고 구성
|
||||
Copy-Item -Path ".\bin\" -Destination "$Env:ProgramFiles\containerd" -Recurse -Force
|
||||
cd $Env:ProgramFiles\containerd\
|
||||
.\containerd.exe config default | Out-File config.toml -Encoding ascii
|
||||
|
||||
# 구성을 검토한다. 설정에 따라 아래를 조정할 수 있다.
|
||||
# - sandbox_image (쿠버네티스 pause 이미지)
|
||||
# - cni bin_dir 및 conf_dir 위치
|
||||
Get-Content config.toml
|
||||
```shell
|
||||
# /etc/systemd/system/docker.service.d 생성
|
||||
sudo mkdir -p /etc/systemd/system/docker.service.d
|
||||
```
|
||||
|
||||
```powershell
|
||||
# containerd 시작
|
||||
.\containerd.exe --register-service
|
||||
Start-Service containerd
|
||||
```shell
|
||||
# 도커 재시작
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart docker
|
||||
```
|
||||
{{% /tab %}}
|
||||
{{< /tabs >}}
|
||||
|
||||
### systemd
|
||||
|
||||
`systemd` cgroup driver를 사용하려면, `/etc/containerd/config.toml`에 다음을 설정한다.
|
||||
부팅 시 `docker` 서비스를 시작하려면, 다음 명령을 실행한다.
|
||||
|
||||
```shell
|
||||
sudo systemctl enable docker
|
||||
```
|
||||
[plugins.cri]
|
||||
systemd_cgroup = true
|
||||
```
|
||||
kubeadm을 사용하는 경우에도 마찬가지로, 수동으로
|
||||
[kubelet을 위한 cgroup 드라이버](/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#configure-cgroup-driver-used-by-kubelet-on-control-plane-node)를 설정한다.
|
||||
|
||||
## 다른 CRI 런타임: frakti
|
||||
|
||||
자세한 정보는 [Frakti 빠른 시작 가이드](https://github.com/kubernetes/frakti#quickstart)를 참고한다.
|
||||
자세한 내용은 [공식 도커 설치 가이드](https://docs.docker.com/engine/installation/)를
|
||||
참조한다.
|
||||
|
|
|
@ -600,7 +600,7 @@ PodSecurityContext 필드는 윈도우에서 작동하지 않는다. 참조를
|
|||
|
||||
쿠버네티스 파드에서는 컨테이너 엔드포인트를 호스팅하기 위해 먼저 인프라 또는 "pause" 컨테이너가 생성된다. 인프라 및 워커 컨테이너를 포함하여 동일한 파드에 속하는 컨테이너는 공통 네트워크 네임스페이스 및 엔드포인트(동일한 IP 및 포트 공간)를 공유한다. 네트워크 구성을 잃지 않고 워커 컨테이너가 충돌하거나 다시 시작되도록 하려면 pause 컨테이너가 필요하다.
|
||||
|
||||
"pause" (인프라) 이미지는 Microsoft Container Registry(MCR)에서 호스팅된다. `docker pull mcr.microsoft.com/k8s/core/pause:1.2.0`을 사용하여 접근할 수 있다. 자세한 내용은 [DOCKERFILE](https://github.com/kubernetes-sigs/sig-windows-tools/tree/master/cmd/wincat)을 참고한다.
|
||||
"pause" (인프라) 이미지는 Microsoft Container Registry(MCR)에서 호스팅된다. `docker pull mcr.microsoft.com/k8s/core/pause:1.2.0`을 사용하여 접근할 수 있다. 자세한 내용은 [DOCKERFILE](https://github.com/kubernetes-sigs/windows-testing/blob/master/images/pause/Dockerfile)을 참고한다.
|
||||
|
||||
### 추가 조사
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ spec:
|
|||
command:
|
||||
- powershell.exe
|
||||
- -command
|
||||
- "<#code used from https://gist.github.com/wagnerandrade/5424431#> ; $$listener = New-Object System.Net.HttpListener ; $$listener.Prefixes.Add('http://*:80/') ; $$listener.Start() ; $$callerCounts = @{} ; Write-Host('Listening at http://*:80/') ; while ($$listener.IsListening) { ;$$context = $$listener.GetContext() ;$$requestUrl = $$context.Request.Url ;$$clientIP = $$context.Request.RemoteEndPoint.Address ;$$response = $$context.Response ;Write-Host '' ;Write-Host('> {0}' -f $$requestUrl) ; ;$$count = 1 ;$$k=$$callerCounts.Get_Item($$clientIP) ;if ($$k -ne $$null) { $$count += $$k } ;$$callerCounts.Set_Item($$clientIP, $$count) ;$$ip=(Get-NetAdapter | Get-NetIpAddress); $$header='<html><body><H1>Windows Container Web Server</H1>' ;$$callerCountsString='' ;$$callerCounts.Keys | % { $$callerCountsString+='<p>IP {0} callerCount {1} ' -f $$ip[1].IPAddress,$$callerCounts.Item($$_) } ;$$footer='</body></html>' ;$$content='{0}{1}{2}' -f $$header,$$callerCountsString,$$footer ;Write-Output $$content ;$$buffer = [System.Text.Encoding]::UTF8.GetBytes($$content) ;$$response.ContentLength64 = $$buffer.Length ;$$response.OutputStream.Write($$buffer, 0, $$buffer.Length) ;$$response.Close() ;$$responseStatus = $$response.StatusCode ;Write-Host('< {0}' -f $$responseStatus) } ; "
|
||||
- "<#code used from https://gist.github.com/19WAS85/5424431#> ; $$listener = New-Object System.Net.HttpListener ; $$listener.Prefixes.Add('http://*:80/') ; $$listener.Start() ; $$callerCounts = @{} ; Write-Host('Listening at http://*:80/') ; while ($$listener.IsListening) { ;$$context = $$listener.GetContext() ;$$requestUrl = $$context.Request.Url ;$$clientIP = $$context.Request.RemoteEndPoint.Address ;$$response = $$context.Response ;Write-Host '' ;Write-Host('> {0}' -f $$requestUrl) ; ;$$count = 1 ;$$k=$$callerCounts.Get_Item($$clientIP) ;if ($$k -ne $$null) { $$count += $$k } ;$$callerCounts.Set_Item($$clientIP, $$count) ;$$ip=(Get-NetAdapter | Get-NetIpAddress); $$header='<html><body><H1>Windows Container Web Server</H1>' ;$$callerCountsString='' ;$$callerCounts.Keys | % { $$callerCountsString+='<p>IP {0} callerCount {1} ' -f $$ip[1].IPAddress,$$callerCounts.Item($$_) } ;$$footer='</body></html>' ;$$content='{0}{1}{2}' -f $$header,$$callerCountsString,$$footer ;Write-Output $$content ;$$buffer = [System.Text.Encoding]::UTF8.GetBytes($$content) ;$$response.ContentLength64 = $$buffer.Length ;$$response.OutputStream.Write($$buffer, 0, $$buffer.Length) ;$$response.Close() ;$$responseStatus = $$response.StatusCode ;Write-Host('< {0}' -f $$responseStatus) } ; "
|
||||
nodeSelector:
|
||||
kubernetes.io/os: windows
|
||||
```
|
||||
|
|
|
@ -149,9 +149,8 @@ root 인증서를 사용하려면 특수한 설정을 필요로 할 것이다.
|
|||
|
||||
localhost에서 제공되거나 방화벽으로 보호되는 몇몇 클러스터들에서는 apiserver가 인증을
|
||||
요구하지 않지만 이는 표준이 아니다.
|
||||
[API에 대한 접근 구성](/ko/docs/reference/access-authn-authz/controlling-access/)은
|
||||
[API에 대한 접근 제어](/ko/docs/concepts/security/controlling-access)은
|
||||
클러스터 관리자가 이를 어떻게 구성할 수 있는지를 설명한다.
|
||||
이 방식들은 미래의 고가용성 지원과 충돌될 수 있다.
|
||||
|
||||
## API에 프로그래밍 방식으로 접근
|
||||
|
||||
|
|
|
@ -148,8 +148,8 @@ http 클라이언트가 루트 인증서를 사용하도록 하려면 특별한
|
|||
|
||||
일부 클러스터에서, API 서버는 인증이 필요하지 않다.
|
||||
로컬 호스트에서 제공되거나, 방화벽으로 보호될 수 있다. 이에 대한 표준은
|
||||
없다. [API에 대한 접근 구성](/ko/docs/reference/access-authn-authz/controlling-access/)은
|
||||
클러스터 관리자가 이를 구성하는 방법에 대해 설명한다. 이러한 접근 방식은 향후
|
||||
없다. [쿠버네티스 API에 대한 접근 제어](/docs/concepts/security/controlling-access)은
|
||||
클러스터 관리자로서 이를 구성하는 방법에 대해 설명한다. 이러한 접근 방식은 향후
|
||||
고 가용성 지원과 충돌할 수 있다.
|
||||
|
||||
### API에 프로그래밍 방식으로 접근
|
||||
|
|
|
@ -69,7 +69,7 @@ Oracle은 당신이 고가용성의 관리형 쿠버네티스 컨트롤 플레
|
|||
다른 제공자들과 도구들은 업그레이드를 다른 방식으로 관리한다. 이들의 업그레이드를 위해서는 이들의 주요 문서를 참조하기를 권장한다.
|
||||
|
||||
* [kops](https://github.com/kubernetes/kops)
|
||||
* [kubespray](https://github.com/kubernetes-incubator/kubespray)
|
||||
* [kubespray](https://github.com/kubernetes-sigs/kubespray)
|
||||
* [CoreOS Tectonic](https://coreos.com/tectonic/docs/latest/admin/upgrade.html)
|
||||
* [Digital Rebar](https://provision.readthedocs.io/en/tip/doc/content-packages/krib.html)
|
||||
* ...
|
||||
|
|
|
@ -8,7 +8,7 @@ weight: 10
|
|||
|
||||
{{< feature-state for_k8s_version="v1.15" state="stable" >}}
|
||||
|
||||
[kubeadm](/docs/reference/setup-tools/kubeadm/kubeadm/)으로 생성된 클라이언트 인증서는 1년 후에 만료된다. 이 페이지는 kubeadm으로 인증서 갱신을 관리하는 방법을 설명한다.
|
||||
[kubeadm](/ko/docs/reference/setup-tools/kubeadm/)으로 생성된 클라이언트 인증서는 1년 후에 만료된다. 이 페이지는 kubeadm으로 인증서 갱신을 관리하는 방법을 설명한다.
|
||||
|
||||
## {{% heading "prerequisites" %}}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ weight: 40
|
|||
|
||||
## {{% heading "prerequisites" %}}
|
||||
|
||||
[kubeadm 시작하기](/ko/docs/reference/setup-tools/kubeadm/kubeadm/)의 1, 2, 3 단계를 완료하자.
|
||||
[kubeadm 시작하기](/ko/docs/reference/setup-tools/kubeadm/)의 1, 2, 3 단계를 완료하자.
|
||||
|
||||
<!-- steps -->
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ weight: 50
|
|||
## {{% heading "prerequisites" %}}
|
||||
|
||||
쿠버네티스 클러스터가 필요하다. 맨 땅에서부터 시작하기를 위해서
|
||||
[kubeadm 시작하기 안내서](/ko/docs/reference/setup-tools/kubeadm/kubeadm/)를 따른다.
|
||||
[kubeadm 시작하기 안내서](/ko/docs/reference/setup-tools/kubeadm/)를 따른다.
|
||||
|
||||
<!-- steps -->
|
||||
|
||||
|
|
|
@ -21,8 +21,8 @@ weight: 10
|
|||
클러스터의 각 노드에 최소 300 MiB 메모리가 있어야 한다.
|
||||
|
||||
이 페이지의 몇 가지 단계를 수행하기 위해서는 클러스터 내
|
||||
[metrics-server](https://github.com/kubernetes-incubator/metrics-server)
|
||||
서비스 실행이 필요하다. 이미 실행중인 metrics-server가 있다면
|
||||
[metrics-server](https://github.com/kubernetes-sigs/metrics-server)
|
||||
서비스 실행이 필요하다. 이미 실행 중인 metrics-server가 있다면
|
||||
다음 단계를 건너뛸 수 있다.
|
||||
|
||||
Minikube를 사용 중이라면, 다음 명령어를 실행해 metric-server를
|
||||
|
|
|
@ -31,7 +31,7 @@ weight: 60
|
|||
아직 단일 노드 클러스터를 가지고 있지 않다면, [Minikube](/ko/docs/setup/learning-environment/minikube/)를
|
||||
사용하여 클러스터 하나를 생성할 수 있다.
|
||||
|
||||
* [퍼시스턴트 볼륨](/ko/docs/concepts/storage/persistent-volumes/)의
|
||||
* [퍼시스턴트 볼륨](https://minikube.sigs.k8s.io/docs/)의
|
||||
관련 자료에 익숙해지도록 한다.
|
||||
|
||||
<!-- steps -->
|
||||
|
|
|
@ -51,8 +51,8 @@ kubelet은 비율 계산에 사용할 윈도우를 선택한다.
|
|||
|
||||
## 메트릭 서버
|
||||
|
||||
[메트릭 서버](https://github.com/kubernetes-incubator/metrics-server)는 클러스터 전역에서 리소스 사용량 데이터를 집계한다.
|
||||
기본적으로, `kube-up.sh` 스크립트에 의해 생성된 클러스터에는 메트릭 서버가
|
||||
[메트릭 서버](https://github.com/kubernetes-sigs/metrics-server)는 클러스터 전역에서 리소스 사용량 데이터를 집계한다.
|
||||
`kube-up.sh` 스크립트에 의해 생성된 클러스터에는 기본적으로 메트릭 서버가
|
||||
디플로이먼트 오브젝트로 배포된다. 만약 다른 쿠버네티스 설치 메커니즘을 사용한다면, 제공된
|
||||
[디플로이먼트 components.yaml](https://github.com/kubernetes-sigs/metrics-server/releases) 파일을 사용하여 메트릭 서버를 배포할 수 있다.
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ title: 리소스 모니터링 도구
|
|||
컨트롤러와 같은 클러스터 구성요소나
|
||||
`kubectl top` 유틸리티에 관련되어 있는
|
||||
메트릭들로 제한된 집합을 제공한다. 이 메트릭은 경량의 단기 인메모리 저장소인
|
||||
[metrics-server](https://github.com/kubernetes-incubator/metrics-server)에
|
||||
[metrics-server](https://github.com/kubernetes-sigs/metrics-server)에
|
||||
의해서 수집되며 `metrics.k8s.io` API를 통해 노출된다.
|
||||
|
||||
metrics-server는 클러스터 상의 모든 노드를 발견하고 각 노드의
|
||||
|
|
|
@ -47,17 +47,10 @@ weight: 20
|
|||
envar-demo 1/1 Running 0 9s
|
||||
```
|
||||
|
||||
1. 파드 안에 실행되고 있는 컨테이너의 셸에 접근한다.
|
||||
1. 파드의 컨테이너 환경 변수를 나열한다.
|
||||
|
||||
```shell
|
||||
kubectl exec -it envar-demo -- /bin/bash
|
||||
```
|
||||
|
||||
1. 셸 안에서, 환경 변수를 나열하기 위해 `printenv` 커맨드를 실행한다.
|
||||
|
||||
```shell
|
||||
# 컨테이너 내 셸에서 다음을 실행한다.
|
||||
printenv
|
||||
kubectl exec envar-demo -- printenv
|
||||
```
|
||||
|
||||
출력은 아래와 비슷할 것이다.
|
||||
|
@ -71,8 +64,6 @@ weight: 20
|
|||
DEMO_FAREWELL=Such a sweet sorrow
|
||||
```
|
||||
|
||||
1. 셸에서 빠져나오기 위해, `exit`을 입력한다.
|
||||
|
||||
{{< note >}}
|
||||
`env` 나 `envFrom` 필드를 이용해 설정된 환경 변수들은 컨테이너 이미지
|
||||
안에서 명시된 모든 환경 변수들을 오버라이딩한다.
|
||||
|
|
|
@ -18,9 +18,9 @@ Horizontal Pod Autoscaler 동작과 관련된 더 많은 정보를 위해서는
|
|||
|
||||
|
||||
이 예제는 버전 1.2 또는 이상의 쿠버네티스 클러스터와 kubectl을 필요로 한다.
|
||||
[메트릭-서버](https://github.com/kubernetes-incubator/metrics-server/) 모니터링을 클러스터에 배포하여 리소스 메트릭 API를 통해 메트릭을 제공해야 한다.
|
||||
[메트릭-서버](https://github.com/kubernetes-sigs/metrics-server) 모니터링을 클러스터에 배포하여 리소스 메트릭 API를 통해 메트릭을 제공해야 한다.
|
||||
Horizontal Pod Autoscaler가 메트릭을 수집할때 해당 API를 사용한다.
|
||||
메트릭-서버를 배포하는 지침은 [메트릭-서버](https://github.com/kubernetes-incubator/metrics-server/)의 GitHub 저장소에 있고, [GCE 가이드](/docs/setup/turnkey/gce/)로 클러스터를 올리는 경우 메트릭-서버 모니터링은 디폴트로 활성화된다.
|
||||
메트릭-서버를 배포하는 지침은 [메트릭-서버](https://github.com/kubernetes-sigs/metrics-server)의 GitHub 저장소에 있고, [GCE 가이드](/docs/setup/turnkey/gce/)로 클러스터를 올리는 경우 메트릭-서버 모니터링은 디폴트로 활성화된다.
|
||||
|
||||
Horizontal Pod Autoscaler에 다양한 자원 메트릭을 적용하고자 하는 경우,
|
||||
버전 1.6 또는 이상의 쿠버네티스 클러스터와 kubectl를 사용해야 한다.
|
||||
|
|
|
@ -264,12 +264,12 @@ API에 접속하려면 클러스터 관리자는 다음을 확인해야 한다.
|
|||
|
||||
* 해당 API 등록:
|
||||
|
||||
* 리소스 메트릭의 경우, 일반적으로 이것은 [메트릭-서버](https://github.com/kubernetes-incubator/metrics-server)가 제공하는 `metrics.k8s.io` API이다.
|
||||
* 리소스 메트릭의 경우, 일반적으로 이것은 [메트릭-서버](https://github.com/kubernetes-sigs/metrics-server)가 제공하는 `metrics.k8s.io` API이다.
|
||||
클러스터 애드온으로 시작할 수 있다.
|
||||
|
||||
* 사용자 정의 메트릭의 경우, 이것은 `custom.metrics.k8s.io` API이다. 메트릭 솔루션 공급 업체에서 제공하는 "어댑터" API 서버에서 제공한다.
|
||||
메트릭 파이프라인 또는 [알려진 솔루션 목록](https://github.com/kubernetes/metrics/blob/master/IMPLEMENTATIONS.md#custom-metrics-api)으로 확인한다.
|
||||
직접 작성하고 싶다면 [샘플](https://github.com/kubernetes-incubator/custom-metrics-apiserver)을 확인하라.
|
||||
직접 작성하고 싶다면 [샘플](https://github.com/kubernetes-sigs/custom-metrics-apiserver)을 확인한다.
|
||||
|
||||
* 외부 메트릭의 경우, 이것은 `external.metrics.k8s.io` API이다. 위에 제공된 사용자 정의 메트릭 어댑터에서 제공될 수 있다.
|
||||
|
||||
|
|
|
@ -17,11 +17,23 @@ no_list: true
|
|||
|
||||
<a class="btn btn-primary" href="/ko/docs/tasks/tools/install-kubectl/" role="button" aria-label="kubectl 설치 및 설정 가이드 보기">kubectl 설치 및 설정 가이드 보기</a>
|
||||
|
||||
[`kubectl` 레퍼런스 문서](/ko/docs/reference/kubectl/)를 읽어볼 수도 있다.
|
||||
[`kubectl` 레퍼런스 문서](/ko/docs/reference/kubectl/)를
|
||||
읽어볼 수도 있다.
|
||||
|
||||
## kind
|
||||
|
||||
[kind](https://kind.sigs.k8s.io/docs/)를 사용하면 로컬 컴퓨터에서
|
||||
쿠버네티스를 실행할 수 있다. 이 도구를 사용하려면
|
||||
[도커](https://docs.docker.com/get-docker/)를 설치하고 구성해야 한다.
|
||||
|
||||
kind [퀵 스타트](https://kind.sigs.k8s.io/docs/user/quick-start/) 페이지는
|
||||
kind를 시작하고 실행하기 위해 수행해야 하는 작업을 보여준다.
|
||||
|
||||
<a class="btn btn-primary" href="https://kind.sigs.k8s.io/docs/user/quick-start/" role="button" aria-label="kind 시작하기 가이드 보기">kind 시작하기 가이드 보기</a>
|
||||
|
||||
## minikube
|
||||
|
||||
[`minikube`](https://minikube.sigs.k8s.io/)는 쿠버네티스를 로컬에서 실행할 수 있는
|
||||
`kind` 와 마찬가지로, [`minikube`](https://minikube.sigs.k8s.io/)는 쿠버네티스를 로컬에서 실행할 수 있는
|
||||
도구이다. `minikube` 는 개인용 컴퓨터(윈도우, macOS 및 리눅스 PC 포함)에서
|
||||
단일 노드 쿠버네티스 클러스터를 실행하여 쿠버네티스를 사용해보거나 일상적인 개발 작업을
|
||||
수행할 수 있다.
|
||||
|
@ -35,14 +47,12 @@ no_list: true
|
|||
`minikube` 가 작동하면, 이를 사용하여
|
||||
[샘플 애플리케이션을 실행](/ko/docs/tutorials/hello-minikube/)해볼 수 있다.
|
||||
|
||||
## kind
|
||||
## kubeadm
|
||||
|
||||
`minikube` 와 마찬가지로, [kind](https://kind.sigs.k8s.io/docs/)를 사용하면 로컬 컴퓨터에서
|
||||
쿠버네티스를 실행할 수 있다. `minikube` 와 달리, `kind` 는 단일 컨테이너 런타임에서만 작동한다.
|
||||
`kind` 는 [도커](https://docs.docker.com/get-docker/)를 설치하고
|
||||
구성해야 한다.
|
||||
{{< glossary_tooltip term_id="kubeadm" text="kubeadm" >}} 도구를 사용하여 쿠버네티스 클러스터를 만들고 관리할 수 있다.
|
||||
사용자 친화적인 방식으로 최소한의 실행 가능하고 안전한 클러스터를 설정하고 실행하는 데 필요한 작업을 수행한다.
|
||||
|
||||
[퀵 스타트](https://kind.sigs.k8s.io/docs/user/quick-start/)는 `kind` 를 시작하고 실행하기 위해
|
||||
수행해야 하는 작업을 보여준다.
|
||||
[kubeadm 설치](/docs/setup/production-environment/tools/kubeadm/install-kubeadm/) 페이지는 kubeadm 설치하는 방법을 보여준다.
|
||||
설치가 끝나면, [클러스터 생성](/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/)이 가능하다.
|
||||
|
||||
<a class="btn btn-primary" href="https://kind.sigs.k8s.io/docs/user/quick-start/" role="button" aria-label="kind 시작하기 가이드 보기">kind 시작하기 가이드 보기</a>
|
||||
<a class="btn btn-primary" href="/docs/setup/production-environment/tools/kubeadm/install-kubeadm/" role="button" aria-label="kubeadm 설치 가이드 보기">kubeadm 설치 가이드 보기</a>
|
||||
|
|
|
@ -521,7 +521,7 @@ compinit
|
|||
|
||||
## {{% heading "whatsnext" %}}
|
||||
|
||||
* [Minikube 설치](/ko/docs/tasks/tools/install-minikube/)
|
||||
* [Minikube 설치](https://minikube.sigs.k8s.io/docs/start/)
|
||||
* 클러스터 생성에 대한 자세한 내용은 [시작하기](/ko/docs/setup/)를 참고한다.
|
||||
* [애플리케이션을 시작하고 노출하는 방법에 대해 배운다.](/ko/docs/tasks/access-application-cluster/service-access-application-cluster/)
|
||||
* 직접 생성하지 않은 클러스터에 접근해야하는 경우,
|
||||
|
|
|
@ -15,25 +15,23 @@ card:
|
|||
|
||||
<!-- overview -->
|
||||
|
||||
이 튜토리얼에서는 [Minikube](/ko/docs/setup/learning-environment/minikube)와 Katacoda를 이용하여
|
||||
이 튜토리얼에서는 Minikube와 Katacoda를 이용하여
|
||||
쿠버네티스에서 샘플 애플리케이션을 어떻게 실행하는지 살펴본다.
|
||||
Katacode는 무료로 브라우저에서 쿠버네티스 환경을 제공한다.
|
||||
|
||||
{{< note >}}
|
||||
[로컬에서 Minikube](/ko/docs/tasks/tools/install-minikube/)를 설치했다면 이 튜토리얼도 따라 할 수 있다.
|
||||
로컬에서 Minikube를 설치했다면 이 튜토리얼도 따라 할 수 있다.
|
||||
설치 안내는 [minikube 시작](https://minikube.sigs.k8s.io/docs/start/)을 참고한다.
|
||||
{{< /note >}}
|
||||
|
||||
|
||||
|
||||
## {{% heading "objectives" %}}
|
||||
|
||||
|
||||
* 샘플 애플리케이션을 Minikube에 배포한다.
|
||||
* 샘플 애플리케이션을 minikube에 배포한다.
|
||||
* 배포한 애플리케이션을 실행한다.
|
||||
* 애플리케이션의 로그를 확인한다.
|
||||
|
||||
|
||||
|
||||
## {{% heading "prerequisites" %}}
|
||||
|
||||
|
||||
|
@ -43,14 +41,14 @@ Katacode는 무료로 브라우저에서 쿠버네티스 환경을 제공한다.
|
|||
|
||||
<!-- lessoncontent -->
|
||||
|
||||
## Minikubue 클러스터 만들기
|
||||
## minikubue 클러스터 만들기
|
||||
|
||||
1. **Launch Terminal** 을 클릭
|
||||
|
||||
{{< kat-button >}}
|
||||
|
||||
{{< note >}}
|
||||
Minikube를 로컬에 설치했다면 `minikube start`를 실행한다.
|
||||
minikube를 로컬에 설치했다면 `minikube start`를 실행한다.
|
||||
{{< /note >}}
|
||||
|
||||
2. 브라우저에서 쿠버네티스 대시보드를 열어보자.
|
||||
|
@ -156,7 +154,7 @@ Katacode는 무료로 브라우저에서 쿠버네티스 환경을 제공한다.
|
|||
|
||||
로드 밸런서를 지원하는 클라우드 공급자의 경우에는
|
||||
서비스에 접근할 수 있도록 외부 IP 주소가 프로비저닝 한다.
|
||||
Minikube에서 `LoadBalancer`타입은 `minikube service` 명령어를 통해서 해당 서비스를 접근할 수
|
||||
minikube에서 `LoadBalancer`타입은 `minikube service` 명령어를 통해서 해당 서비스를 접근할 수
|
||||
있게 한다.
|
||||
|
||||
3. 다음 명령어를 실행한다
|
||||
|
@ -173,7 +171,7 @@ Katacode는 무료로 브라우저에서 쿠버네티스 환경을 제공한다.
|
|||
|
||||
## 애드온 사용하기
|
||||
|
||||
Minikube에는 활성화하거나 비활성화 할 수 있고 로컬 쿠버네티스 환경에서 접속해 볼 수 있는 내장 {{< glossary_tooltip text="애드온" term_id="addons" >}} 셋이 있다.
|
||||
minikube 툴은 활성화하거나 비활성화할 수 있고 로컬 쿠버네티스 환경에서 접속해 볼 수 있는 내장 {{< glossary_tooltip text="애드온" term_id="addons" >}} 셋이 포함되어 있다.
|
||||
|
||||
1. 현재 지원하는 애드온 목록을 확인한다.
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ weight: 30
|
|||
### 추가적인 Minikube 설정 요령
|
||||
|
||||
{{< caution >}}
|
||||
[Minikube](/docs/getting-started-guides/minikube/)는 1024MiB 메모리와 1개 CPU가 기본 설정이다.
|
||||
[Minikube](https://minikube.sigs.k8s.io/docs/)는 1024MiB 메모리와 1개 CPU가 기본 설정이다.
|
||||
이 튜토리얼에서 Minikube를 기본 리소스 설정으로 실행하면 리소스 부족 오류가
|
||||
발생한다. 이런 오류를 피하려면 Minikube를 다음 설정으로 실행하자.
|
||||
|
||||
|
|
|
@ -17,8 +17,6 @@ card:
|
|||
* Metricbeat
|
||||
* Packetbeat
|
||||
|
||||
|
||||
|
||||
## {{% heading "objectives" %}}
|
||||
|
||||
* Redis를 이용한 PHP 방명록 시작.
|
||||
|
@ -27,7 +25,6 @@ card:
|
|||
* Beats 배포.
|
||||
* 로그와 메트릭의 대시보드 보기.
|
||||
|
||||
|
||||
## {{% heading "prerequisites" %}}
|
||||
|
||||
|
||||
|
@ -38,16 +35,20 @@ card:
|
|||
|
||||
* 실행 중인 [Redis를 이용한 PHP 방명록](/ko/docs/tutorials/stateless-application/guestbook) 튜토리얼의 배포본.
|
||||
|
||||
* 실행 중인 Elasticsearch와 Kibana 디플로이먼트. [Elastic Cloud의 Elasticsearch 서비스](https://cloud.elastic.co)를 사용하거나, [파일을 내려받아](https://www.elastic.co/guide/en/elastic-stack-get-started/current/get-started-elastic-stack.html) 워크스테이션이나 서버에서 운영하거나, [Elastic의 Helm 차트](https://github.com/elastic/helm-charts)를 이용한다.
|
||||
* 실행 중인 Elasticsearch와 Kibana 디플로이먼트. [Elastic Cloud의 Elasticsearch 서비스](https://cloud.elastic.co)를 사용하거나,
|
||||
[파일을 내려받아](https://www.elastic.co/guide/en/elastic-stack-get-started/current/get-started-elastic-stack.html)
|
||||
워크스테이션이나 서버에서 운영하거나, [Elastic의 Helm 차트](https://github.com/elastic/helm-charts)를 이용한다.
|
||||
|
||||
|
||||
|
||||
<!-- lessoncontent -->
|
||||
|
||||
## Redis를 이용한 PHP 방명록 시작
|
||||
|
||||
이 튜토리얼은 [Redis를 이용한 PHP 방명록](/ko/docs/tutorials/stateless-application/guestbook)을 기반으로 한다. 방명록 애플리케이션을 실행 중이라면, 이를 모니터링할 수 있다. 실행되지 않은 경우라면 지침을 따라 방명록을 배포하고 **정리하기** 단계는 수행하지 말자. 방명록을 실행할 때 이 페이지로 돌아오자.
|
||||
|
||||
## 클러스터 롤 바인딩 추가
|
||||
|
||||
[클러스터 단위 롤 바인딩](/docs/reference/access-authn-authz/rbac/#rolebinding-and-clusterrolebinding)을 생성하여, 클러스터 수준(kube-system 안에)으로 kube-state-metrics와 Beats를 배포할 수 있게 한다.
|
||||
|
||||
```shell
|
||||
|
@ -58,31 +59,39 @@ kubectl create clusterrolebinding cluster-admin-binding \
|
|||
## kube-state-metrics 설치
|
||||
|
||||
[*kube-state-metrics*](https://github.com/kubernetes/kube-state-metrics)는 쿠버네티스 API 서버를 모니터링하며 오브젝트 상태에 대한 메트릭을 생성하는 간단한 서비스이다. 이런 메트릭을 Metricbeat이 보고한다. 방명록이 실행된 쿠버네티스 클러스터에서 kube-state-metrics을 추가한다.
|
||||
|
||||
```shell
|
||||
git clone https://github.com/kubernetes/kube-state-metrics.git kube-state-metrics
|
||||
kubectl apply -f kube-state-metrics/examples/standard
|
||||
```
|
||||
|
||||
### kube-state-metrics 실행 여부 확인
|
||||
|
||||
```shell
|
||||
kubectl get pods --namespace=kube-system -l app.kubernetes.io/name=kube-state-metrics
|
||||
```
|
||||
|
||||
출력
|
||||
```shell
|
||||
|
||||
```
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
kube-state-metrics-89d656bf8-vdthm 1/1 Running 0 21s
|
||||
```
|
||||
|
||||
## Elastic의 예제를 GitHub 리포지터리에 클론한다.
|
||||
|
||||
```shell
|
||||
git clone https://github.com/elastic/examples.git
|
||||
```
|
||||
|
||||
나머지 커맨드는 `examples/beats-k8s-send-anywhere` 디렉터리의 파일을 참조할 것이라서, 그쪽으로 현재 디렉터리를 변경한다.
|
||||
|
||||
```shell
|
||||
cd examples/beats-k8s-send-anywhere
|
||||
```
|
||||
|
||||
## 쿠버네티스 시크릿 만들기
|
||||
|
||||
쿠버네티스 {{< glossary_tooltip text="시크릿" term_id="secret" >}}은 암호나 토큰, 키 같이 소량의 민감한 데이터를 포함하는 오브젝트이다. 이러한 정보는 다른 방식으로도 파드 스펙이나 이미지에 넣을 수 있을 것이다. 시크릿 오브젝트에 넣으면 이것이 어떻게 사용되는지 다양하게 제어할 수 있고, 우발적인 노출 사고의 위험이 줄일 수 있다.
|
||||
|
||||
{{< note >}}
|
||||
|
@ -93,55 +102,68 @@ cd examples/beats-k8s-send-anywhere
|
|||
{{% tab name="자체 관리(Self Managed)" %}}
|
||||
|
||||
### 자체 관리
|
||||
|
||||
Elastic Cloud의 Elasticsearch 서비스로 연결한다면 **관리 서비스** 탭으로 전환한다.
|
||||
|
||||
### 자격증명(credentials) 설정
|
||||
|
||||
자체 관리 Elasticsearch와 Kibana(자체 관리는 사실상 Elastic Cloud의 관리 서비스 Elasticsearch와 다르다) 서비스에 접속할 때에 4개 파일을 수정하여 쿠버네티스 시크릿을 생성한다. 파일은 다음과 같다.
|
||||
|
||||
1. ELASTICSEARCH_HOSTS
|
||||
1. ELASTICSEARCH_PASSWORD
|
||||
1. ELASTICSEARCH_USERNAME
|
||||
1. KIBANA_HOST
|
||||
1. `ELASTICSEARCH_HOSTS`
|
||||
1. `ELASTICSEARCH_PASSWORD`
|
||||
1. `ELASTICSEARCH_USERNAME`
|
||||
1. `KIBANA_HOST`
|
||||
|
||||
이 정보를 Elasticsearch 클러스터와 Kibana 호스트에 지정한다. 여기 예시(또는 [*이 구성*](https://stackoverflow.com/questions/59892896/how-to-connect-from-minikube-to-elasticsearch-installed-on-host-local-developme/59892897#59892897)을 본다)가 있다.
|
||||
|
||||
#### `ELASTICSEARCH_HOSTS`
|
||||
|
||||
1. Elastic의 Elasticsearch Helm 차트에서 노드 그룹(nodeGroup).
|
||||
|
||||
```shell
|
||||
["http://elasticsearch-master.default.svc.cluster.local:9200"]
|
||||
```
|
||||
```
|
||||
["http://elasticsearch-master.default.svc.cluster.local:9200"]
|
||||
```
|
||||
|
||||
1. Mac을 위한 Docker에서 Beats를 운영 중인 Mac에서 운영하는 단일 Elasticsearch 노드.
|
||||
|
||||
```shell
|
||||
["http://host.docker.internal:9200"]
|
||||
```
|
||||
```
|
||||
["http://host.docker.internal:9200"]
|
||||
```
|
||||
|
||||
1. VM이나 물리 장비에서 운영 중인 두 개의 ELASTICSEARCH 노드.
|
||||
|
||||
```shell
|
||||
["http://host1.example.com:9200", "http://host2.example.com:9200"]
|
||||
```
|
||||
`ELASTICSEARCH_HOSTS` 수정한다.
|
||||
```
|
||||
["http://host1.example.com:9200", "http://host2.example.com:9200"]
|
||||
```
|
||||
|
||||
`ELASTICSEARCH_HOSTS` 를 수정한다.
|
||||
|
||||
```shell
|
||||
vi ELASTICSEARCH_HOSTS
|
||||
```
|
||||
|
||||
#### `ELASTICSEARCH_PASSWORD`
|
||||
화이트 스페이스나 인용 부호나 <> 도 없는 암호이다.
|
||||
화이트 스페이스나 인용 부호나 `<` 또는 `>` 도 없는 암호이다.
|
||||
|
||||
<사용자의 시크릿 암호>
|
||||
```
|
||||
<사용자시크릿암호>
|
||||
```
|
||||
|
||||
`ELASTICSEARCH_PASSWORD` 를 수정한다.
|
||||
|
||||
`ELASTICSEARCH_PASSWORD` 수정한다.
|
||||
```shell
|
||||
vi ELASTICSEARCH_PASSWORD
|
||||
```
|
||||
|
||||
#### `ELASTICSEARCH_USERNAME`
|
||||
화이트 스페이스나 인용 부호나 <> 도 없는 이름이다.
|
||||
화이트 스페이스나 인용 부호나 `<` 또는 `>` 도 없는 이름이다.
|
||||
|
||||
<Elasticsearch를 위한 수집 사용자 이름>
|
||||
```
|
||||
<Elasticsearch를 위한 수집 사용자 이름>
|
||||
```
|
||||
|
||||
`ELASTICSEARCH_USERNAME` 을 수정한다.
|
||||
|
||||
`ELASTICSEARCH_USERNAME` 수정한다.
|
||||
```shell
|
||||
vi ELASTICSEARCH_USERNAME
|
||||
```
|
||||
|
@ -150,78 +172,97 @@ vi ELASTICSEARCH_USERNAME
|
|||
|
||||
1.Elastic의 Kibana Helm 차트의 인스턴스이다. 하위 도메인 `default`는 기본 네임스페이스를 참조한다. 다른 네임스페이스를 사용하여 Helm 차트를 배포한 경우 하위 도메인이 다릅니다.
|
||||
|
||||
```shell
|
||||
"kibana-kibana.default.svc.cluster.local:5601"
|
||||
```
|
||||
```
|
||||
"kibana-kibana.default.svc.cluster.local:5601"
|
||||
```
|
||||
|
||||
1. Mac 용 Docker에서 실행하는 Beats가 있는 Mac에서 실행하는 Kibana 인스턴스
|
||||
|
||||
```shell
|
||||
"host.docker.internal:5601"
|
||||
```
|
||||
```
|
||||
"host.docker.internal:5601"
|
||||
```
|
||||
1. 가상머신이나 물리적 하드웨어에서 실행 중인 두 개의 Elasticsearch 노드
|
||||
|
||||
```shell
|
||||
"host1.example.com:5601"
|
||||
```
|
||||
`KIBANA_HOST`를 편집한다.
|
||||
```
|
||||
"host1.example.com:5601"
|
||||
```
|
||||
|
||||
`KIBANA_HOST` 를 편집한다.
|
||||
|
||||
```shell
|
||||
vi KIBANA_HOST
|
||||
```
|
||||
|
||||
### 쿠버네티스 시크릿 만들기
|
||||
이 커맨드는 방금 편집한 파일을 기반으로 쿠버네티스의 시스템 수준의 네임스페이스(kube-system)에 시크릿을 만든다.
|
||||
|
||||
kubectl create secret generic dynamic-logging \
|
||||
--from-file=./ELASTICSEARCH_HOSTS \
|
||||
--from-file=./ELASTICSEARCH_PASSWORD \
|
||||
--from-file=./ELASTICSEARCH_USERNAME \
|
||||
--from-file=./KIBANA_HOST \
|
||||
--namespace=kube-system
|
||||
이 커맨드는 방금 편집한 파일을 기반으로 쿠버네티스의 시스템 수준의 네임스페이스(`kube-system`)에 시크릿을 만든다.
|
||||
|
||||
```shell
|
||||
kubectl create secret generic dynamic-logging \
|
||||
--from-file=./ELASTICSEARCH_HOSTS \
|
||||
--from-file=./ELASTICSEARCH_PASSWORD \
|
||||
--from-file=./ELASTICSEARCH_USERNAME \
|
||||
--from-file=./KIBANA_HOST \
|
||||
--namespace=kube-system
|
||||
```
|
||||
|
||||
{{% /tab %}}
|
||||
{{% tab name="관리 서비스(Managed service)" %}}
|
||||
|
||||
## 관리 서비스
|
||||
|
||||
이 탭은 Elastic Cloud에서 Elasticsearch 서비스 만에 대한 것으로, 이미 자체 관리 Elasticsearch와 Kibana 배포로 시크릿을 생성했다면, [Beats 배포](#deploy-the-beats)를 계속한다.
|
||||
|
||||
### 자격증명(credentials) 설정
|
||||
|
||||
Elastic Cloud에서 관리되는 Elastic 서비스에 연결할 때, 쿠버네티스 시크릿을 생성하기 위해 편집할 두 파일이 있다. 파일은 다음과 같다.
|
||||
|
||||
1. ELASTIC_CLOUD_AUTH
|
||||
1. ELASTIC_CLOUD_ID
|
||||
1. `ELASTIC_CLOUD_AUTH`
|
||||
1. `ELASTIC_CLOUD_ID`
|
||||
|
||||
디플로이먼트를 생성할 때에 Elasticsearch 콘솔에서 제공한 정보로 이를 설정한다. 여기 예시들이 있다.
|
||||
|
||||
#### ELASTIC_CLOUD_ID
|
||||
```shell
|
||||
#### `ELASTIC_CLOUD_ID`
|
||||
|
||||
```
|
||||
devk8s:ABC123def456ghi789jkl123mno456pqr789stu123vwx456yza789bcd012efg345hijj678klm901nop345zEwOTJjMTc5YWQ0YzQ5OThlN2U5MjAwYTg4NTIzZQ==
|
||||
```
|
||||
|
||||
#### ELASTIC_CLOUD_AUTH
|
||||
#### `ELASTIC_CLOUD_AUTH`
|
||||
|
||||
사용자 이름, 콜론(`:`) 및 비밀번호인데, 공백 또는 따옴표는 없다.
|
||||
```shell
|
||||
|
||||
```
|
||||
elastic:VFxJJf9Tjwer90wnfTghsn8w
|
||||
```
|
||||
|
||||
### 필요 파일 편집하기
|
||||
|
||||
```shell
|
||||
vi ELASTIC_CLOUD_ID
|
||||
vi ELASTIC_CLOUD_AUTH
|
||||
```
|
||||
|
||||
### 쿠버네티스 시크릿 생성하기
|
||||
이 커맨드는 방금 편집한 파일을 기반으로 쿠버네티스의 시스템 수준의 네임스페이스(kube-system)에 시크릿을 생성한다.
|
||||
|
||||
kubectl create secret generic dynamic-logging \
|
||||
--from-file=./ELASTIC_CLOUD_ID \
|
||||
--from-file=./ELASTIC_CLOUD_AUTH \
|
||||
--namespace=kube-system
|
||||
이 커맨드는 방금 편집한 파일을 기반으로 쿠버네티스의 시스템 수준의 네임스페이스(`kube-system`)에 시크릿을 생성한다.
|
||||
|
||||
{{% /tab %}}
|
||||
```shell
|
||||
kubectl create secret generic dynamic-logging \
|
||||
--from-file=./ELASTIC_CLOUD_ID \
|
||||
--from-file=./ELASTIC_CLOUD_AUTH \
|
||||
--namespace=kube-system
|
||||
```
|
||||
|
||||
{{% /tab %}}
|
||||
{{< /tabs >}}
|
||||
|
||||
## Beats 배포하기 {#deploy-the-beats}
|
||||
|
||||
각 Beat마다 메니페스트 파일을 제공한다. 이 메니페스트 파일은 앞서 생성한 시크릿을 사용하여, Elasticsearch 및 Kibana 서버에 연결하도록 Beats를 구성한다.
|
||||
|
||||
### Filebeat에 대해
|
||||
|
||||
Filebeat는 쿠버네티스 노드와 해당 노두에서 실행되는 각 파드에서 실행되는 컨테이너의 로그를 수집한다. Filebeat는 {{< glossary_tooltip text="데몬 셋" term_id="daemonset" >}}으로 배포한다. Filebeat는 쿠버네티스 클러스터에서 실행 중인 애플리케이션을 자동 검색할 수 있다. 시작시에 Filebeat는 기존 컨테이너를 검색하고 이에 적절한 구성을 시작하고 새 시작/종료 이벤트를 감시한다.
|
||||
|
||||
아래 내용은 Filebeat가 방명록 애플리케이션과 함께 배포된 Redis 컨테이너에서 Redis 로그를 찾아 구문분석할 수 있게 하는 자동 검색 구성이다. 이 구성은 `filebeat-kubernetes.yaml`파일에 있다.
|
||||
|
@ -240,20 +281,25 @@ Filebeat는 쿠버네티스 노드와 해당 노두에서 실행되는 각 파
|
|||
enabled: true
|
||||
var.hosts: ["${data.host}:${data.port}"]
|
||||
```
|
||||
|
||||
이것은 `redis` 컨테이너가 `app` 문자열을 포함하는 레이블로 감지될 때에 Filebeat 모듈 `redis`를 적용하도록 Filebeat를 구성한다. Redis 모듈은 Docker 입력 유형을 사용하여 컨테이너에서 `로그` 스트림을 수집할 수 있다(이 Redis 컨테이너의 STDOUT 스트림과 연관된 쿠버네티스 노드에서 파일 읽기). 또한 이 모듈은 컨테이너 메타 데이터에 제공되는 적절한 파드 호스트와 포트에 연결하여 Redis의 `slowlog` 항목을 수집할 수 있다.
|
||||
|
||||
### Filebeat 배포
|
||||
|
||||
```shell
|
||||
kubectl create -f filebeat-kubernetes.yaml
|
||||
```
|
||||
|
||||
#### 확인
|
||||
|
||||
```shell
|
||||
kubectl get pods -n kube-system -l k8s-app=filebeat-dynamic
|
||||
```
|
||||
|
||||
### Metricbeat에 대해
|
||||
|
||||
Metricbeat 자동 검색은 Filebeat와 같은 방식으로 구성된다. 다음은 Redis 컨테이너에 대한 Metricbeat의 자동 검색 구성이다. 이 구성은 `metricbeat-kubernetes.yaml`에 있다.
|
||||
|
||||
```yaml
|
||||
- condition.equals:
|
||||
kubernetes.labels.tier: backend
|
||||
|
@ -265,18 +311,23 @@ Metricbeat 자동 검색은 Filebeat와 같은 방식으로 구성된다. 다음
|
|||
# Redis hosts
|
||||
hosts: ["${data.host}:${data.port}"]
|
||||
```
|
||||
|
||||
이것은 컨테이너가 `tier` 레이블이 `backend` 문자열과 같은 레이블로 감지될 때에 Metricbeat 모듈 `redis`를 적용하도록 Metricbeat를 구성한다. `redis` 모듈은 컨테이너 메타데이터에 제공되는 적절한 파드 호스트와 포트에 연결하여 컨테이너에서 `info` 및 `keyspace` 메트릭을 수집할 수 있다.
|
||||
|
||||
### Metricbeat 배포
|
||||
|
||||
```shell
|
||||
kubectl create -f metricbeat-kubernetes.yaml
|
||||
```
|
||||
|
||||
#### 확인
|
||||
|
||||
```shell
|
||||
kubectl get pods -n kube-system -l k8s-app=metricbeat
|
||||
```
|
||||
|
||||
### Packetbeat에 대해
|
||||
|
||||
Packetbeat 구성은 Filebeat와 Metricbeat와는 다르다. 컨테이너 레이블과 일치시킬 패턴을 지정하지 않고, 구성은 관련 프로토콜 및 포트 번호를 기반으로 한다. 아래는 포트 번호의 하위 집합이다.
|
||||
|
||||
{{< note >}}
|
||||
|
@ -307,11 +358,13 @@ packetbeat.flows:
|
|||
```
|
||||
|
||||
#### Packetbeat 배포하기
|
||||
|
||||
```shell
|
||||
kubectl create -f packetbeat-kubernetes.yaml
|
||||
```
|
||||
|
||||
#### 확인하기
|
||||
|
||||
```shell
|
||||
kubectl get pods -n kube-system -l k8s-app=packetbeat-dynamic
|
||||
```
|
||||
|
@ -328,13 +381,16 @@ Metricbeat에서 Apache 메트릭을 가져올 수 있게 하려면, mod-status
|
|||
|
||||
|
||||
## 디플로이먼트를 확장하고 모니터링중인 새 파드를 확인하기
|
||||
|
||||
기존 디플로이먼트를 확인한다.
|
||||
|
||||
```shell
|
||||
kubectl get deployments
|
||||
```
|
||||
|
||||
출력
|
||||
```shell
|
||||
|
||||
```
|
||||
NAME READY UP-TO-DATE AVAILABLE AGE
|
||||
frontend 3/3 3 3 3h27m
|
||||
redis-master 1/1 1 1 3h27m
|
||||
|
@ -342,54 +398,56 @@ redis-slave 2/2 2 2 3h27m
|
|||
```
|
||||
|
||||
front의 디플로이먼트를 두 개의 파드로 축소한다.
|
||||
|
||||
```shell
|
||||
kubectl scale --replicas=2 deployment/frontend
|
||||
```
|
||||
|
||||
출력
|
||||
```shell
|
||||
|
||||
```
|
||||
deployment.extensions/frontend scaled
|
||||
```
|
||||
|
||||
frontend의 파드를 최대 3개의 파드로 확장한다.
|
||||
|
||||
```shell
|
||||
kubectl scale --replicas=3 deployment/frontend
|
||||
```
|
||||
|
||||
## Kibana에서 변화 확인하기
|
||||
|
||||
스크린 캡처를 확인하여, 표시된 필터를 추가하고 해당 열을 뷰에 추가한다. ScalingReplicaSet 항목이 표시되고, 여기에서 이벤트 목록의 맨 위에 풀링되는 이미지, 마운트된 볼륨, 파드 시작 등을 보여준다.
|
||||

|
||||
|
||||
|
||||
|
||||
## {{% heading "cleanup" %}}
|
||||
|
||||
디플로이먼트와 서비스를 삭제하면 실행중인 파드도 삭제된다. 한 커맨드로 여러 개의 리소스를 삭제하기 위해 레이블을 이용한다.
|
||||
|
||||
1. 다음 커맨드를 실행하여 모든 파드, 디플로이먼트, 서비스를 삭제한다.
|
||||
|
||||
```shell
|
||||
kubectl delete deployment -l app=redis
|
||||
kubectl delete service -l app=redis
|
||||
kubectl delete deployment -l app=guestbook
|
||||
kubectl delete service -l app=guestbook
|
||||
kubectl delete -f filebeat-kubernetes.yaml
|
||||
kubectl delete -f metricbeat-kubernetes.yaml
|
||||
kubectl delete -f packetbeat-kubernetes.yaml
|
||||
kubectl delete secret dynamic-logging -n kube-system
|
||||
```
|
||||
```shell
|
||||
kubectl delete deployment -l app=redis
|
||||
kubectl delete service -l app=redis
|
||||
kubectl delete deployment -l app=guestbook
|
||||
kubectl delete service -l app=guestbook
|
||||
kubectl delete -f filebeat-kubernetes.yaml
|
||||
kubectl delete -f metricbeat-kubernetes.yaml
|
||||
kubectl delete -f packetbeat-kubernetes.yaml
|
||||
kubectl delete secret dynamic-logging -n kube-system
|
||||
```
|
||||
|
||||
1. 실행 중인 파드가 없음을 확인하기 위해 파드 목록을 조회한다.
|
||||
|
||||
```shell
|
||||
kubectl get pods
|
||||
```
|
||||
|
||||
커맨드의 출력은 다음과 같아야 한다.
|
||||
|
||||
```
|
||||
No resources found.
|
||||
```
|
||||
```shell
|
||||
kubectl get pods
|
||||
```
|
||||
|
||||
출력은 다음과 같아야 한다.
|
||||
|
||||
```
|
||||
No resources found.
|
||||
```
|
||||
|
||||
## {{% heading "whatsnext" %}}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
쿠버네티스 클러스터가 필요하고, kubectl 커맨드-라인 툴이 클러스터와
|
||||
통신할 수 있도록 설정되어 있어야 한다.
|
||||
만약, 아직 클러스터를 가지고 있지 않다면,
|
||||
[Minikube](/ko/docs/setup/learning-environment/minikube/)를 사용해서 생성하거나,
|
||||
[minikube](/ko/docs/tasks/tools/#minikube)를 사용해서 생성하거나
|
||||
다음의 쿠버네티스 플레이그라운드 중 하나를 사용할 수 있다.
|
||||
|
||||
* [Katacoda](https://www.katacoda.com/courses/kubernetes/playground)
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue