-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Translate concepts/services-networking/dns-pod-service in Korean
- Loading branch information
SoHye Choi
committed
Sep 21, 2019
1 parent
5dc2b2a
commit 1934b9b
Showing
3 changed files
with
256 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
title: "μλΉμ€, λ‘λλ°Έλ°μ±, λ€νΈμνΉ" | ||
weight: 60 | ||
--- |
232 changes: 232 additions & 0 deletions
232
content/ko/docs/concepts/services-networking/dns-pod-service.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,232 @@ | ||
--- | ||
title: μλΉμ€ λ° νλμ© DNS | ||
content_template: templates/concept | ||
weight: 20 | ||
--- | ||
{{% capture overview %}} | ||
μ΄ νμ΄μ§λ μΏ λ²λ€ν°μ€κ° μ§μνλ DNS κ°μμ κ΄ν΄ μ€λͺ νλ€. | ||
{{% /capture %}} | ||
|
||
{{% capture body %}} | ||
|
||
## μκ° | ||
μΏ λ²λ€ν°μ€ DNSλ ν΄λ¬μ€ν°μ μλΉμ€μ DNS νλλ₯Ό κ΄λ¦¬νλ©°, κ°λ³ 컨ν μ΄λλ€μ΄ DNS λ€μμ ν΄μν λ DNS | ||
μλΉμ€μ IPλ₯Ό μλ΅νλλ‘ kubeletsλ₯Ό ꡬμ±νλ€. | ||
|
||
### DNS λ€μμ΄ ν λΉλλ κ²λ€ | ||
|
||
ν΄λ¬μ€ν° λ΄μ DNS μλ²λ₯Ό ν¬ν¨ν λͺ¨λ μλΉμ€λ DNS λ€μμ΄ ν λΉλλ€. κΈ°λ³Έμ μΌλ‘ ν΄λΌμ΄μΈνΈ νλμ DNS κ²μ | ||
리μ€νΈλ νλ μ체μ λ€μμ€νμ΄μ€μ ν΄λ¬μ€ν°μ κΈ°λ³Έ λλ©μΈμ ν¬ν¨νλ€. μ΄ μμλ λ€μκ³Ό κ°λ€: | ||
|
||
μΏ λ²λ€ν°μ€ λ€μμ€νμ΄μ€ `bar`μ `foo`λΌλ μλΉμ€κ° μλ€. λ€μμ€νμ΄μ€ `bar`μμ running μνμΈ νλλ | ||
λ¨μνκ² `foo`λ₯Ό μ‘°ννλ DNS 쿼리λ₯Ό ν΅ν΄μ μλΉμ€ `foo`λ₯Ό μ°Ύμ μ μλ€. | ||
λ€μμ€νμ΄μ€ `quux`μμ μ€ν μ€μΈ νλλ `foo.bar`λ₯Ό μ‘°ννλ DNS 쿼리λ₯Ό ν΅ν΄μ μ΄ μλΉμ€λ₯Ό μ°Ύμ μ μλ€. | ||
|
||
λ€μ μ μμλ μΏ λ²λ€ν°μ€ DNSμμ μ§μνλ λ μ½λ μ νκ³Ό λ μ΄μμμ μμΈν μ€λͺ νλ€. μ΄ μΈμ λμνλ λ μ΄μμ, | ||
λ€μ λλ 쿼리λ ꡬν μΈλΆ μ λ³΄λ‘ κ°μ£Όνλ©° κ²½κ³ μμ΄ λ³κ²½λ μ μλ€. μ΅μ μ λ°μ΄νΈμ λν μμΈν μ€λͺ μ λ€μ | ||
λ§ν¬λ₯Ό ν΅ν΄ μ°Έμ‘°ν μ μλ€. | ||
[μΏ λ²λ€ν°μ€ DNS κΈ°λ° μλΉμ€ λμ€μ»€λ²λ¦¬](https://github.com/kubernetes/dns/blob/master/docs/specification.md). | ||
|
||
## DNS κΈ°λ° μλΉμ€ | ||
|
||
### A λ μ½λ | ||
|
||
ν€λλ¦¬μ€ μλΉμ€κ° μλ "λ Έλ©" μλΉμ€λ `my-svc.my-namespace.svc.cluster-domain.example` | ||
νμμ μ΄λ¦μ κ°μ§ DNS A λ μ½λκ° ν λΉλλ€. μ΄λ μλΉμ€μ ν΄λ¬μ€ν° IPλ‘ ν΄μλλ€. | ||
|
||
ν΄λ¬μ€ν° IPκ° μλ "ν€λ리μ€" μλΉμ€ λν `my-svc.my-namespace.svc.cluster-domain.example` | ||
νμμ μ΄λ¦μ κ°μ§ DNS A λ μ½λκ° ν λΉλλ€. λ Έλ© μλΉμ€μλ λ€λ₯΄κ² μ΄λ μλΉμ€μ μν΄ μ νλ νλλ€μ IP μ§ν©μΌλ‘ ν΄μλλ€. | ||
ν΄λΌμ΄μΈνΈλ ν΄μλ IP μ§ν©μμ IPλ₯Ό μ§μ μ ννκ±°λ νμ€ λΌμ΄λλ‘λΉμ ν΅ν΄ μ νν μ μλ€. | ||
|
||
### SRV λ μ½λ | ||
|
||
SRV λ μ½λλ λ Έλ© μλΉμ€ λλ [ν€λλ¦¬μ€ μλΉμ€](/docs/concepts/services-networking/service/#headless-services)μ | ||
μνλ λ€μλ ν¬νΈλ₯Ό μν΄ λ§λ€μ΄μ‘λ€. κ°κ°μ λ€μλ ν¬νΈμ λν΄μ SRV λ μ½λλ λ€μκ³Ό κ°μ νμμ κ°μ§ μ μλ€. `_my-port-name._my-port-protocol.my-svc.my-namespace.svc.cluster-domain.example`. | ||
μ κ· μλΉμ€μ κ²½μ°, μ΄λ ν¬νΈ λ²νΈμ λλ©μΈ λ€μμΌλ‘ ν΄μλλ€: `my-svc.my-namespace.svc.cluster-domain.example`. | ||
ν€λλ¦¬μ€ μλΉμ€μ κ²½μ°, μλΉμ€λ₯Ό μ§μνλ κ° νλμ λν΄ νλμ© λ³΅μ μλ΅μΌλ‘ ν΄μλλ©° μ΄ μλ΅μ νλμ ν¬νΈ λ²νΈμ λλ©μΈ μ΄λ¦μ ν¬ν¨νλ€: `auto-generated-name.my-svc.my-namespace.svc.cluster-domain.example`. | ||
|
||
|
||
## νλ | ||
|
||
### νλμ νΈμ€νΈλ€μ νλμ μλΈλλ©μΈ νλ | ||
|
||
νλκ° μμ±λλ©΄ νΈμ€νΈλ€μμ ν΄λΉ νλμ `metadata.name` κ°μ΄ λλ€. | ||
νλ μ€ν(Pod spec)μλ μ νμ νλμΈ `hostname`μ΄ μλ€. μ΄ νλλ νλμ νΈμ€νΈλ€μμ μ§μ ν μ μλ€. | ||
νλμ μ΄λ¦μ΄ μ§μ λλ©΄ νλμ μ΄λ¦λ³΄λ€ νλμ νΈμ€νΈλ€μμ΄ μ°μ μλλ€. μλ₯Ό λ€μ΄ `hostname` νλκ° | ||
"`my-host`"λ‘ μ€μ λ νλλ νΈμ€νΈλ€μμ΄ "`my-host`"λ‘ μ€μ λλ€. | ||
|
||
λν, νλ μ€ν(Pod spec)μλ μ νμ νλμΈ `subdomain`μ΄ μλ€. μ΄ νλλ μλΈλλ©μΈμ μ§μ ν μ μλ€. | ||
μλ₯Ό λ€μ΄ "`my-namespace`" λ€μμ€νμ΄μ€μμ, `hostname` νλκ° "`foo`"λ‘ μ€μ λκ³ , `subdomain` | ||
νλκ° "`bar`"λ‘ μ€μ λ νλλ μ 체 μ£Όμ λλ©μΈ λ€μ (FQDN)μ κ°μ§κ² λλ€: "`foo.bar.my-namespace.svc.cluster-domain.example`". | ||
|
||
μμ: | ||
|
||
```yaml | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: default-subdomain | ||
spec: | ||
selector: | ||
name: busybox | ||
clusterIP: None | ||
ports: | ||
- name: foo # Actually, no port is needed. | ||
port: 1234 | ||
targetPort: 1234 | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: busybox1 | ||
labels: | ||
name: busybox | ||
spec: | ||
hostname: busybox-1 | ||
subdomain: default-subdomain | ||
containers: | ||
- image: busybox:1.28 | ||
command: | ||
- sleep | ||
- "3600" | ||
name: busybox | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: busybox2 | ||
labels: | ||
name: busybox | ||
spec: | ||
hostname: busybox-2 | ||
subdomain: default-subdomain | ||
containers: | ||
- image: busybox:1.28 | ||
command: | ||
- sleep | ||
- "3600" | ||
name: busybox | ||
``` | ||
νλμ λμΌν λ€μμ€νμ΄μ€ λ΄μ κ°μ μλΈλλ©μΈ μ΄λ¦μ κ°μ§ ν€λλ¦¬μ€ μλΉμ€κ° μλ€λ©΄, ν΄λ¬μ€ν°μ KubeDNS | ||
μλ²λ νλμ μ 체 μ£Όμ νΈμ€νΈλ€μ(fully qualified hostname)μΈ A λ μ½λλ₯Ό λ°ννλ€. | ||
μλ₯Ό λ€μ΄ νΈμ€νΈλ€μμ΄ "`busybox-1`"μ΄κ³ , μλΈλλ©μΈμ΄ "`default-subdomain`"μ΄κ³ , | ||
κ°μ λ€μμ€νμ΄μ€ λ΄ ν€λλ¦¬μ€ μλΉμ€μ μ΄λ¦μ΄ "`default-subdomain`"μ΄λ©΄, νλλ λ€μκ³Ό κ°μ΄ μκΈ° μμ μ | ||
FQDNμ μ»κ² λλ€: "`busybox-1.default-subdomain.my-namespace.svc.cluster-domain.example`". | ||
DNSλ μ FQDNμ λν΄ νλμ IPλ₯Ό κ°λ¦¬ν€λ A λ μ½λλ₯Ό μ 곡νλ€. "`busybox1`"μ "`busybox2`" νλ λͺ¨λ | ||
κ° νλλ₯Ό κ΅¬λΆ κ°λ₯ν A λ μ½λλ₯Ό κ°μ§κ³ μλ€. | ||
|
||
μλν¬μΈνΈ κ°μ²΄λ `hostname` νλλ₯Ό μμμ μλν¬μΈνΈ IP μ£Όμλ‘ μ§μ ν μ μλ€. | ||
|
||
{{< note >}} | ||
A λ μ½λλ νλμ μ΄λ¦μΌλ‘ μμ±λμ§ μκΈ° λλ¬Έμ νλμ A λ μ½λλ₯Ό μμ±νκΈ° μν΄μλ `hostname` νλλ₯Ό μμ±ν΄μΌ νλ€. | ||
`hostname` νλλ μκ³ `subdomain` νλλ§ μλ νλλ νλμ IP μ£Όμλ₯Ό κ°λ¦¬ν€λ ν€λλ¦¬μ€ μλΉμ€μ | ||
A λ μ½λλ§ μμ±ν μ μλ€. (`default-subdomain.my-namespace.svc.cluster-domain.example`) | ||
λν λ μ½λλ₯Ό κ°μ§κΈ° μν΄μλ νλκ° μ€λΉλμ΄μΌ νλ€. κ·Έλ μ§ μμ κ²½μ°, μλΉμ€μμ `publishNotReadyAddresses=True`κ° νμ±νλλ€. | ||
{{< /note >}} | ||
|
||
### νλμ DNS μ μ± | ||
|
||
DNS μ μ± μ νλ λ³λ‘ μ€μ ν μ μλ€. νμ¬ μΏ λ²λ€ν°μ€λ λ€μκ³Ό κ°μ νλλ³ DNS μ μ± μ μ§μνλ€. | ||
μ΄ μ μ± λ€μ νλ μ€ν(Pod Spec)μ `dnsPolicy` νλμμ μ§μ ν μ μλ€. | ||
|
||
- "`Default`": νλλ νλκ° μ€νλκ³ μλ λ Έλλ‘λΆν° name resolution μ€μ μ μμλ°λλ€. | ||
μμΈν λ΄μ©μ [related discussion](/docs/tasks/administer-cluster/dns-custom-nameservers/#inheriting-dns-from-the-node) | ||
μμ νμΈν μ μλ€. | ||
- "`ClusterFirst`": "`www.kubernetes.io`"μ κ°μ΄ ν΄λ¬μ€ν° λλ©μΈ suffix ꡬμ±κ³Ό μΌμΉνμ§ | ||
μλ DNS 쿼리λ λ Έλμμ μμλ μ μ€νΈλ¦Ό λ€μμλ²λ‘ μ λ¬λλ€. ν΄λ¬μ€ν° κ΄λ¦¬μλ μΆκ° μ€ν λλ©μΈκ³Ό | ||
μ μ€νΈλ¦Ό DNS μλ²λ₯Ό ꡬμΆν μ μλ€. κ·Έλ¬ν κ²½μ° DNS 쿼리λ₯Ό μ΄λ»κ² μ²λ¦¬νλμ§μ λν μμΈν λ΄μ©μ [related discussion](/docs/tasks/administer-cluster/dns-custom-nameservers/#impacts-on-pods) | ||
μμ νμΈν μ μλ€. | ||
- "`ClusterFirstWithHostNet`": hostNetworkμμ running μνμΈ νλμ κ²½μ° DNS μ μ± μΈ | ||
"`ClusterFirstWithHostNet`"μ λͺ μμ μΌλ‘ μ€μ ν΄μΌ νλ€. | ||
- "`None`": μ΄ μ μ± μ νλκ° μΏ λ²λ€ν°μ€ νκ²½μ DNS μ€μ μ 무μνλλ‘ νλ€. λͺ¨λ DNS μ€μ μ νλ μ€ν(Pod Spec) | ||
λ΄μ `dnsConfig`νλλ₯Ό μ¬μ©νμ¬ μ 곡ν΄μΌ νλ€. | ||
μλ μ μΈ [νλμ DNS μ€μ ](#νλμ-dns-μ€μ )μμ μμΈν λ΄μ©μ νμΈν μ μλ€. | ||
|
||
{{< note >}} | ||
"Default"λ κΈ°λ³Έ DNS μ μ± μ΄ μλλ€. `dnsPolicy`κ° λͺ μμ μΌλ‘ μ§μ λμ΄μμ§ μλ€λ©΄ | ||
βClusterFirstβκ° κΈ°λ³Έκ°μΌλ‘ μ¬μ©λλ€. | ||
{{< /note >}} | ||
|
||
μλ μμλ `hostNetwork`νλκ° `true`λ‘ μ€μ λμ΄ μμ΄μ | ||
DNS μ μ± μ΄ "`ClusterFirstWithHostNet`"μΌλ‘ μ€μ λ νλλ₯Ό 보μ¬μ€λ€. | ||
|
||
```yaml | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: busybox | ||
namespace: default | ||
spec: | ||
containers: | ||
- image: busybox:1.28 | ||
command: | ||
- sleep | ||
- "3600" | ||
imagePullPolicy: IfNotPresent | ||
name: busybox | ||
restartPolicy: Always | ||
hostNetwork: true | ||
dnsPolicy: ClusterFirstWithHostNet | ||
``` | ||
|
||
### νλμ DNS μ€μ | ||
|
||
μ¬μ©μλ€μ νλμ DNS μ€μ μ ν΅ν΄μ μ§μ νλμ DNSλ₯Ό μΈν ν μ μλ€. | ||
|
||
`dnsConfig` νλλ μ νμ μ΄κ³ , `dnsPolicy` μΈν κ³Ό ν¨κ» λμνλ€. μ΄λ, | ||
νλμ `dnsPolicy`μ κ°μ΄ "`None`"μΌλ‘ μ€μ λμ΄ μμ΄μΌ `dnsConfig` νλλ₯Ό μ§μ ν μ μλ€. | ||
|
||
μ¬μ©μλ `dnsConfig` νλμμ λ€μκ³Ό κ°μ μμ±λ€μ μ§μ ν μ μλ€: | ||
|
||
- `nameservers`: νλμ DNS μλ²κ° μ¬μ©ν IP μ£Όμλ€μ λͺ©λ‘μ΄λ€. νλμ `dnsPolicy`κ° "`None`" μΌλ‘ | ||
μ€μ λ κ²½μ°μλ μ μ΄λ νλμ IP μ£Όμκ° ν¬ν¨λμ΄μΌ νλ©°, κ·Έλ μ§ μμΌλ©΄ μ΄ μμ±μ μλ΅ν μ μλ€. | ||
`nameservers`μ λμ΄λ μλ²λ μ§μ λ DNS μ μ± μ ν΅ν΄ μμ±λ κΈ°λ³Έ λ€μ μλ²μ ν©μ³μ§λ©° μ€λ³΅λλ μ£Όμλ μ κ±°λλ€. | ||
- `searches`: νλμ νΈμ€νΈλ€μμ μ°ΎκΈ° μν DNS κ²μ λλ©μΈμ λͺ©λ‘μ΄λ€. μ΄ μμ±μ μλ΅μ΄ κ°λ₯νλ©°, | ||
κ°μ μ§μ ν κ²½μ° λμ΄λ κ²μ λλ©μΈμ μ§μ λ DNS μ μ± μ ν΅ν΄ μμ±λ κΈ°λ³Έ κ²μ λλ©μΈμ ν©μ³μ§λ€. | ||
λ³ν© μ μ€λ³΅λλ λλ©μΈμ μ κ±°λλ©°, μΏ λ²λ€ν°μ€λ μ΅λ 6κ°μ κ²μ λλ©μΈμ νμ©νκ³ μλ€. | ||
- `options`: `name` μμ±(νμ)κ³Ό `value` μμ±(μ ν)μ κ°μ§ μ μλ κ°μ²΄λ€μ μ νμ λͺ©λ‘μ΄λ€. | ||
μ΄ μμ±μ λ΄μ©μ μ§μ λ DNS μ μ± μμ μμ±λ μ΅μ μΌλ‘ λ³ν©λλ€. μ΄ μμ±μ λ΄μ©μ μ§μ λ DNS μ μ± μ | ||
ν΅ν΄ μμ±λ μ΅μ μΌλ‘ ν©μ³μ§λ©°, λ³ν© μ μ€λ³΅λλ νλͺ©μ μ κ±°λλ€. | ||
|
||
λ€μμ 컀μ€ν DNS μΈν μ ν νλμ μμμ΄λ€: | ||
|
||
{{< codenew file="service/networking/custom-dns.yaml" >}} | ||
|
||
μμμ νλκ° μμ±λλ©΄, 컨ν μ΄λ `test`μ `/etc/resolv.conf` νμΌμλ λ€μκ³Ό κ°μ λ΄μ©μ΄ μΆκ°λλ€. | ||
|
||
``` | ||
nameserver 1.2.3.4 | ||
search ns1.svc.cluster-domain.example my.dns.search.suffix | ||
options ndots:2 edns0 | ||
``` | ||
IPv6 μ μ μ μν΄μ κ²μ κ²½λ‘μ λ€μ μλ² μ μ μ λ€μκ³Ό κ°μμΌ νλ€: | ||
```shell | ||
kubectl exec -it dns-example -- cat /etc/resolv.conf | ||
``` | ||
μΆλ ₯μ λ€μκ³Ό κ°μ νμμΌ κ²μ΄λ€: | ||
```shell | ||
nameserver fd00:79:30::a | ||
search default.svc.cluster-domain.example svc.cluster-domain.example cluster-domain.example | ||
options ndots:5 | ||
``` | ||
|
||
### κΈ°λ₯ μ§μ μ¬λΆ | ||
|
||
νλ DNS κ΅¬μ± λ° DNS μ μ± "`None`"μ λν μ§μ μ 보λ μλμμ νμΈ ν μ μλ€. | ||
|
||
| k8s λ²μ | κΈ°λ₯ μ§μ | | ||
| :---------: |:-----------:| | ||
| 1.14 | μμ | | ||
| 1.10 | λ² ν (κΈ°λ³Έ)| | ||
| 1.9 | μν | | ||
|
||
{{% /capture %}} | ||
|
||
{{% capture whatsnext %}} | ||
|
||
DNS κ΅¬μ± κ΄λ¦¬μ λν μ§μΉ¨μ [Configure DNS Service](/docs/tasks/administer-cluster/dns-custom-nameservers/)μμ νμΈ ν μ μλ€. | ||
|
||
{{% /capture %}} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
namespace: default | ||
name: dns-example | ||
spec: | ||
containers: | ||
- name: test | ||
image: nginx | ||
dnsPolicy: "None" | ||
dnsConfig: | ||
nameservers: | ||
- 1.2.3.4 | ||
searches: | ||
- ns1.svc.cluster-domain.example | ||
- my.dns.search.suffix | ||
options: | ||
- name: ndots | ||
value: "2" | ||
- name: edns0 |