Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Daichi Sakaue <[email protected]>
  • Loading branch information
yokaze committed Nov 27, 2023
1 parent c723a7f commit 65f765e
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 3 deletions.
2 changes: 1 addition & 1 deletion images.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const (
ToolsImage = Image("quay.io/cybozu/cke-tools:1.26.0")
PauseImage = Image("quay.io/cybozu/pause:3.9.0.1")
CoreDNSImage = Image("quay.io/cybozu/coredns:1.10.1.1")
UnboundImage = Image("quay.io/cybozu/unbound:1.17.1.4")
UnboundImage = Image("ghcr.io/cybozu/unbound:1.18.0.2")
UnboundExporterImage = Image("quay.io/cybozu/unbound_exporter:0.4.1.5")
)

Expand Down
19 changes: 19 additions & 0 deletions mtest/kubernetes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,19 @@ func testKubernetes() {
}
return nil
}).Should(Succeed())

Eventually(func() error {
stdout, stderr, err := kubectl("get", "service", "-n="+namespace, "httpd", "-o", "jsonpath='{.spec.clusterIP}'")
if err != nil {
return fmt.Errorf("%v: stderr=%s", err, stderr)
}
ip := string(stdout)

_, stderr, err = kubectl("exec", "-n="+namespace, "client", "getent", "hosts", ip)
if err != nil {
return fmt.Errorf("%v: stderr=%s", err, stderr)
}
}).Should(Succeed())

Check failure on line 164 in mtest/kubernetes_test.go

View workflow job for this annotation

GitHub Actions / Build CKE

missing return (compile)
})

It("updates unbound config", func() {
Expand Down Expand Up @@ -245,6 +258,12 @@ func testKubernetes() {
return err
}).Should(Succeed())

By("querying www.dnssec-failed.org using node DNS from ubuntu pod")
Consistently(func() error {
_, _, err := kubectl("exec", "-n="+namespace, "client", "getent", "hosts", "www.dnssec-failed.org")
return err
}).WithTimeout(time.Second * 5).WithPolling(time.Second * 1).ShouldNot(Succeed())

By("getting metrics from unbound_exporter")
Eventually(func() error {
stdout, _, err := kubectl("exec", "-n=kube-system", "daemonset/node-dns", "-c", "unbound", "--", "curl", "-sSf", "http://127.0.0.1:9167/metrics")
Expand Down
20 changes: 20 additions & 0 deletions op/nodedns/nodedns.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,26 @@ server:
local-zone: "29.172.in-addr.arpa." transparent
local-zone: "30.172.in-addr.arpa." transparent
local-zone: "31.172.in-addr.arpa." transparent
trust-anchor-file: "/usr/local/unbound/etc/unbound/root.key"
domain-insecure: "{{ .Domain }}"
domain-insecure: "10.in-addr.arpa."
domain-insecure: "168.192.in-addr.arpa."
domain-insecure: "16.172.in-addr.arpa."
domain-insecure: "17.172.in-addr.arpa."
domain-insecure: "18.172.in-addr.arpa."
domain-insecure: "19.172.in-addr.arpa."
domain-insecure: "20.172.in-addr.arpa."
domain-insecure: "21.172.in-addr.arpa."
domain-insecure: "22.172.in-addr.arpa."
domain-insecure: "23.172.in-addr.arpa."
domain-insecure: "24.172.in-addr.arpa."
domain-insecure: "25.172.in-addr.arpa."
domain-insecure: "26.172.in-addr.arpa."
domain-insecure: "27.172.in-addr.arpa."
domain-insecure: "28.172.in-addr.arpa."
domain-insecure: "29.172.in-addr.arpa."
domain-insecure: "30.172.in-addr.arpa."
domain-insecure: "31.172.in-addr.arpa."
remote-control:
control-enable: yes
control-interface: {{ if .LocalControl }} /var/run/unbound/unbound.sock {{ else }} 127.0.0.1 {{ end }}
Expand Down
4 changes: 2 additions & 2 deletions static/resources.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 65f765e

Please sign in to comment.