Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Penemuan layanan dan ringkasan DNS
Topik ini menjelaskan cara GKE di Azure berinteraksi dengan Layanan Nama Domain (DNS).
Penemuan layanan
Penemuan layanan adalah proses saat workload menemukan layanan tanpa
mengetahui alamat IP layanan. Bagian ini menjelaskan cara GKE di Azure mengimplementasikan penemuan layanan dan DNS terkelola.
Kubernetes secara otomatis membuat nama layanan yang menggunakan spesifikasi berikut:
service.namespace.svc.cluster.local
Dengan keterangan:
service: nama layanan Anda
namespace: Namespace layanan Anda
Workload juga mengakses layanan eksternal—misalnya example.net—menggunakan nama DNS. Untuk mengetahui informasi selengkapnya tentang perilaku DNS di Kubernetes, lihat
DNS untuk Layanan dan Pod.
CoreDNS
GKE di Azure menggunakan
CoreDNS
untuk me-resolve nama DNS dalam cluster. CoreDNS berjalan sebagai Deployment
redundan yang diskalakan di namespace
kube-system. Deployment CoreDNS memiliki Service yang mengelompokkan Pod CoreDNS dan memberinya satu alamat IP. CoreDNS Deployment diskalakan dengan
ukuran dan penggunaan cluster.
NodeLocal DNSCache
GKE di Azure menggunakan NodeLocal DNSCache untuk meningkatkan performa pencarian DNS. NodeLocal DNSCache berjalan sebagai DaemonSet pada setiap node dalam cluster Anda. Saat Pod membuat permintaan DNS, permintaan tersebut
akan mengarah ke cache DNS terlebih dahulu pada node yang sama. Jika cache tidak dapat menyelesaikan permintaan DNS, cache akan meneruskan permintaan ke:
CoreDNS untuk nama internal— misalnya foo.bar.svc.cluster.local
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-07-31 UTC."],[],[],null,["# Service discovery and DNS overview\n==================================\n\nThis topic describes how GKE on Azure interacts with Domain\nName Services (DNS).\n\nService discovery\n-----------------\n\nService discovery is the process where workloads discover services without\nknowing the service's IP address. This section describes how\nGKE on Azure implements service discovery and managed DNS.\n\nKubernetes automatically generates service names that use the following\n[specification](https://github.com/kubernetes/dns/blob/master/docs/specification.md):\n\n\u003cvar translate=\"no\"\u003eservice\u003c/var\u003e`.`\u003cvar translate=\"no\"\u003enamespace\u003c/var\u003e`.svc.cluster.local`\n\nWhere:\n\n- \u003cvar translate=\"no\"\u003eservice\u003c/var\u003e: your service's name\n- \u003cvar translate=\"no\"\u003enamespace\u003c/var\u003e: your service's Namespace\n\nWorkloads also access external services--- for example `example.net`---\nusing DNS names. For more information on the behavior of DNS in Kubernetes, see\n[DNS for Services and Pods](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/).\n\n### CoreDNS\n\nGKE on Azure uses\n[CoreDNS](https://kubernetes.io/blog/2018/07/10/coredns-ga-for-kubernetes-cluster-dns/)\nto resolve DNS names within clusters. CoreDNS runs as a redundant, scaled\n[Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/)\nin the `kube-system`\nnamespace. The CoreDNS deployment has a\n[Service](/kubernetes-engine/docs/concepts/service) that groups the CoreDNS Pods\nand gives them a single IP address. The CoreDNS Deployment scales with the\ncluster's size and usage.\n\n### NodeLocal DNSCache\n\nGKE on Azure uses\n[NodeLocal DNSCache](https://kubernetes.io/docs/tasks/administer-cluster/nodelocaldns/)\nto improve DNS lookup performance. NodeLocal DNSCache runs as a\n[DaemonSet](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/)\non each node in your cluster. When a Pod makes a DNS request, the request first\ngoes to the DNS cache on the same node. If the cache can't resolve the DNS\nrequest, the cache forwards the request to either:\n\n- CoreDNS for an internal name--- for example `foo.bar.svc.cluster.local`\n\nWhat's next\n-----------\n\n- For an overview of how DNS is used in Kubernetes clusters, see [DNS for Services and Pods](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/)."]]