顯示頁面舊版反向連結Fold/unfold all回到頁頂 本頁是唯讀的,您可以看到原始碼,但不能更動它。您如果覺得它不應被鎖上,請詢問管理員。 ====== 針對 K8s 環境內定義類似 /etc/hosts 方式 ====== * 以下是在 rancher 下的設定方式 * Clusters(已經建立的 Cluster) -> System * Resources -> Config -> Namespace: kube-system -> coredns -> Edit * Corefile 的內容改成類似以下: <file> .:53 { errors health { lameduck 5s } ready kubernetes cluster.local in-addr.arpa ip6.arpa { pods insecure fallthrough in-addr.arpa ip6.arpa } prometheus :9153 forward . "/etc/resolv.conf" cache 30 loop reload loadbalance hosts iiidevops.tw { 192.168.7.101 www.iiidevops.tw 192.168.7.101 gitlab.iiidevops.tw 192.168.7.101 redmine.iiidevops.tw 192.168.7.101 harbor.iiidevops.tw 192.168.7.101 sonarqube.iiidevops.tw fallthrough } } </file> * Save 存檔就可以立即生效 ===== 參考網址 ===== * https://medium.com/@hjrocha/add-a-custom-host-to-kubernetes-a06472cedccb * https://linux-rtdocs.readthedocs.io/en/latest/k8s/coreDNS%E6%B7%BB%E5%8A%A0%E9%9D%99%E6%80%81DNS%E7%9A%84%E6%96%B9%E6%B3%95/ {{tag>coredns rancher k8s}} tech/rancher_coredns_hosts.txt 上一次變更: 2021/01/27 15:48由 jonathan