mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
commit
e25210d367
@ -1,11 +1,11 @@
|
||||
apiVersion: v1beta3
|
||||
kind: ReplicationController
|
||||
metadata:
|
||||
name: kube-dns
|
||||
namespace: default
|
||||
labels:
|
||||
k8s-app: kube-dns
|
||||
kubernetes.io/cluster-service: "true"
|
||||
name: kube-dns
|
||||
namespace: default
|
||||
spec:
|
||||
replicas: {{ pillar['dns_replicas'] }}
|
||||
selector:
|
||||
@ -15,7 +15,6 @@ spec:
|
||||
labels:
|
||||
k8s-app: kube-dns
|
||||
kubernetes.io/cluster-service: "true"
|
||||
name: kube-dns
|
||||
spec:
|
||||
containers:
|
||||
- name: etcd
|
||||
@ -31,7 +30,7 @@ spec:
|
||||
- name: kube2sky
|
||||
image: gcr.io/google_containers/kube2sky:1.4
|
||||
args:
|
||||
# entrypoint = "/kube2sky"
|
||||
# command = "/kube2sky"
|
||||
- -domain={{ pillar['dns_domain'] }}
|
||||
- -kubecfg_file=/etc/dns_token/kubeconfig
|
||||
volumeMounts:
|
||||
@ -41,7 +40,7 @@ spec:
|
||||
- name: skydns
|
||||
image: gcr.io/google_containers/skydns:2015-03-11-001
|
||||
args:
|
||||
# entrypoint = "/skydns"
|
||||
# command = "/skydns"
|
||||
- -machines=http://localhost:4001
|
||||
- -addr=0.0.0.0:53
|
||||
- -domain={{ pillar['dns_domain'] }}.
|
||||
@ -49,6 +48,9 @@ spec:
|
||||
- containerPort: 53
|
||||
name: dns
|
||||
protocol: UDP
|
||||
- containerPort: 53
|
||||
name: dns-tcp
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
exec:
|
||||
command:
|
||||
|
@ -1,14 +1,19 @@
|
||||
apiVersion: v1beta3
|
||||
kind: Service
|
||||
apiVersion: v1beta1
|
||||
id: kube-dns
|
||||
metadata:
|
||||
name: kube-dns
|
||||
namespace: default
|
||||
protocol: UDP
|
||||
port: 53
|
||||
portalIP: {{ pillar['dns_server'] }}
|
||||
containerPort: 53
|
||||
labels:
|
||||
k8s-app: kube-dns
|
||||
name: kube-dns
|
||||
kubernetes.io/cluster-service: "true"
|
||||
spec:
|
||||
selector:
|
||||
k8s-app: kube-dns
|
||||
portalIP: {{ pillar['dns_server'] }}
|
||||
ports:
|
||||
- name: dns
|
||||
port: 53
|
||||
protocol: UDP
|
||||
- name: dns-tcp
|
||||
port: 53
|
||||
protocol: TCP
|
||||
|
6
contrib/for-tests/dnsutils/Dockerfile
Normal file
6
contrib/for-tests/dnsutils/Dockerfile
Normal file
@ -0,0 +1,6 @@
|
||||
FROM debian:wheezy
|
||||
MAINTAINER Tim Hockin "thockin@google.com"
|
||||
|
||||
RUN apt-get -q update && \
|
||||
apt-get install -y dnsutils && \
|
||||
apt-get clean
|
8
contrib/for-tests/dnsutils/Makefile
Normal file
8
contrib/for-tests/dnsutils/Makefile
Normal file
@ -0,0 +1,8 @@
|
||||
all:
|
||||
@echo "try 'make image' or 'make push'"
|
||||
|
||||
image:
|
||||
docker build -t gcr.io/google_containers/dnsutils .
|
||||
|
||||
push:
|
||||
gcloud preview docker push gcr.io/google_containers/dnsutils
|
@ -67,7 +67,9 @@ var _ = Describe("Services", func() {
|
||||
|
||||
probeCmd := "for i in `seq 1 600`; do "
|
||||
for _, name := range namesToResolve {
|
||||
probeCmd += fmt.Sprintf("wget -O /dev/null %s && echo OK > /results/%s;", name, name)
|
||||
// Resolve by TCP and UDP DNS.
|
||||
probeCmd += fmt.Sprintf(`test -n "$(dig +notcp +noall +answer +search %s)" && echo OK > /results/udp@%s;`, name, name)
|
||||
probeCmd += fmt.Sprintf(`test -n "$(dig +tcp +noall +answer +search %s)" && echo OK > /results/tcp@%s;`, name, name)
|
||||
}
|
||||
probeCmd += "sleep 1; done"
|
||||
|
||||
@ -102,8 +104,8 @@ var _ = Describe("Services", func() {
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "pinger",
|
||||
Image: "gcr.io/google_containers/busybox",
|
||||
Name: "querier",
|
||||
Image: "gcr.io/google_containers/dnsutils",
|
||||
Command: []string{"sh", "-c", probeCmd},
|
||||
VolumeMounts: []api.VolumeMount{
|
||||
{
|
||||
@ -141,16 +143,18 @@ var _ = Describe("Services", func() {
|
||||
expectNoError(wait.Poll(time.Second*2, time.Second*60, func() (bool, error) {
|
||||
failed = []string{}
|
||||
for _, name := range namesToResolve {
|
||||
for _, proto := range []string{"udp", "tcp"} {
|
||||
testCase := fmt.Sprintf("%s@%s", proto, name)
|
||||
_, err := c.Get().
|
||||
Prefix("proxy").
|
||||
Resource("pods").
|
||||
Namespace(api.NamespaceDefault).
|
||||
Name(pod.Name).
|
||||
Suffix("results", name).
|
||||
Suffix("results", testCase).
|
||||
Do().Raw()
|
||||
if err != nil {
|
||||
failed = append(failed, name)
|
||||
Logf("Lookup using %s for %s failed: %v\n", pod.Name, name, err)
|
||||
failed = append(failed, testCase)
|
||||
}
|
||||
}
|
||||
}
|
||||
if len(failed) == 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user