mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 15:58:37 +00:00
Update examples to not use old DNS names
This commit is contained in:
parent
4e1630d3a9
commit
89e9851ac5
@ -28,7 +28,7 @@ kube_cert_group: kube-cert
|
|||||||
# Internal DNS domain name.
|
# Internal DNS domain name.
|
||||||
# This domain must not be used in your network. Services will be discoverable
|
# This domain must not be used in your network. Services will be discoverable
|
||||||
# under <service-name>.<namespace>.<domainname>, e.g.
|
# under <service-name>.<namespace>.<domainname>, e.g.
|
||||||
# myservice.default.cluster.local
|
# myservice.default.svc.cluster.local
|
||||||
dns_domain: "{{ cluster_name }}"
|
dns_domain: "{{ cluster_name }}"
|
||||||
|
|
||||||
# IP address of the DNS server.
|
# IP address of the DNS server.
|
||||||
|
@ -100,7 +100,7 @@ public class KubernetesSeedProvider implements SeedProvider {
|
|||||||
|
|
||||||
public List<InetAddress> getSeeds() {
|
public List<InetAddress> getSeeds() {
|
||||||
List<InetAddress> list = new ArrayList<InetAddress>();
|
List<InetAddress> list = new ArrayList<InetAddress>();
|
||||||
String host = "https://kubernetes.default.cluster.local";
|
String host = "https://kubernetes.default.svc.cluster.local";
|
||||||
String serviceName = getEnvOrDefault("CASSANDRA_SERVICE", "cassandra");
|
String serviceName = getEnvOrDefault("CASSANDRA_SERVICE", "cassandra");
|
||||||
String podNamespace = getEnvOrDefault("POD_NAMESPACE", "default");
|
String podNamespace = getEnvOrDefault("POD_NAMESPACE", "default");
|
||||||
String path = String.format("/api/v1/namespaces/%s/endpoints/", podNamespace);
|
String path = String.format("/api/v1/namespaces/%s/endpoints/", podNamespace);
|
||||||
|
@ -171,7 +171,7 @@ $ kubectl logs dns-frontend
|
|||||||
|
|
||||||
#### Note about default namespace
|
#### Note about default namespace
|
||||||
|
|
||||||
If you prefer not using namespace, then all your services can be addressed using `default` namespace, e.g. `http://dns-backend.default.cluster.local:8000`, or shorthand version `http://dns-backend:8000`
|
If you prefer not using namespace, then all your services can be addressed using `default` namespace, e.g. `http://dns-backend.default.svc.cluster.local:8000`, or shorthand version `http://dns-backend:8000`
|
||||||
|
|
||||||
|
|
||||||
### tl; dr;
|
### tl; dr;
|
||||||
|
@ -139,8 +139,8 @@ Result: ([]string)<nil>
|
|||||||
Error: <*>lookup elasticsearch-logging: no such host
|
Error: <*>lookup elasticsearch-logging: no such host
|
||||||
|
|
||||||
LookupSRV("", "", elasticsearch-logging):
|
LookupSRV("", "", elasticsearch-logging):
|
||||||
cname: elasticsearch-logging.default.cluster.local.
|
cname: elasticsearch-logging.default.svc.cluster.local.
|
||||||
Result: ([]*net.SRV)[<*>{Target:(string)elasticsearch-logging.default.cluster.local. Port:(uint16)9200 Priority:(uint16)10 Weight:(uint16)100}]
|
Result: ([]*net.SRV)[<*>{Target:(string)elasticsearch-logging.default.svc.cluster.local. Port:(uint16)9200 Priority:(uint16)10 Weight:(uint16)100}]
|
||||||
Error: <nil>
|
Error: <nil>
|
||||||
|
|
||||||
LookupHost(elasticsearch-logging):
|
LookupHost(elasticsearch-logging):
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
# should only send updates if something changes. We should be able to do
|
# should only send updates if something changes. We should be able to do
|
||||||
# this by comparing pod creation time with the last scan time.
|
# this by comparing pod creation time with the last scan time.
|
||||||
while true; do
|
while true; do
|
||||||
hostport="https://kubernetes.default.cluster.local"
|
hostport="https://kubernetes.default.svc.cluster.local"
|
||||||
token=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
|
token=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
|
||||||
path="api/v1/pods"
|
path="api/v1/pods"
|
||||||
query="labels=$SELECTOR"
|
query="labels=$SELECTOR"
|
||||||
|
Loading…
Reference in New Issue
Block a user