mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 23:15:14 +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.
|
||||
# This domain must not be used in your network. Services will be discoverable
|
||||
# under <service-name>.<namespace>.<domainname>, e.g.
|
||||
# myservice.default.cluster.local
|
||||
# myservice.default.svc.cluster.local
|
||||
dns_domain: "{{ cluster_name }}"
|
||||
|
||||
# IP address of the DNS server.
|
||||
|
@ -100,7 +100,7 @@ public class KubernetesSeedProvider implements SeedProvider {
|
||||
|
||||
public List<InetAddress> getSeeds() {
|
||||
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 podNamespace = getEnvOrDefault("POD_NAMESPACE", "default");
|
||||
String path = String.format("/api/v1/namespaces/%s/endpoints/", podNamespace);
|
||||
|
@ -171,7 +171,7 @@ $ kubectl logs dns-frontend
|
||||
|
||||
#### 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;
|
||||
|
@ -139,8 +139,8 @@ Result: ([]string)<nil>
|
||||
Error: <*>lookup elasticsearch-logging: no such host
|
||||
|
||||
LookupSRV("", "", elasticsearch-logging):
|
||||
cname: elasticsearch-logging.default.cluster.local.
|
||||
Result: ([]*net.SRV)[<*>{Target:(string)elasticsearch-logging.default.cluster.local. Port:(uint16)9200 Priority:(uint16)10 Weight:(uint16)100}]
|
||||
cname: elasticsearch-logging.default.svc.cluster.local.
|
||||
Result: ([]*net.SRV)[<*>{Target:(string)elasticsearch-logging.default.svc.cluster.local. Port:(uint16)9200 Priority:(uint16)10 Weight:(uint16)100}]
|
||||
Error: <nil>
|
||||
|
||||
LookupHost(elasticsearch-logging):
|
||||
|
@ -18,7 +18,7 @@
|
||||
# should only send updates if something changes. We should be able to do
|
||||
# this by comparing pod creation time with the last scan time.
|
||||
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)
|
||||
path="api/v1/pods"
|
||||
query="labels=$SELECTOR"
|
||||
|
Loading…
Reference in New Issue
Block a user