Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added option to route traces traffic to local availability zone #4655

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cluster/config-defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,10 @@ coredns_log_svc_names: "true"
# clusters and prevent CoreDNS from running out of memory in case of spikes.
coredns_max_upstream_concurrency: 2000 # 0 means there is no concurrency limits

coredns_route_traces_to_local_zone: "false"
coredns_global_traces_endpoint: ""
coredns_local_zone_traces_endpoint: ""


# Kubernetes on Ubuntu AMI to use
# note this configuration uses the [amiID][0] function. It returns the
Expand Down
18 changes: 18 additions & 0 deletions cluster/manifests/coredns-local/configmap-local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,24 @@ data:
}
{{ end }}

{{ if eq .ConfigItems.coredns_route_traces_to_local_zone "true"}}
{{ .ConfigItems.coredns_global_traces_endpoint }}:9254 {
errors

rewrite name exact {{ .ConfigItems.coredns_global_traces_endpoint }} {{ .ConfigItems.coredns_local_zone_traces_endpoint }}

kubernetes cluster.local {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are a bit worried that having kubernetes defined both in this server block and below will double the memory for tracking kubernetes resources which would be a problem in big clusters.

Would you be able to verify if this is the case or not? Or alternatively merge it into a single server block to avoid defining the kubernetes block twice?

For context we have separate server blocks because of the guidance here: coredns/coredns#2593 (comment) it may need to be re-evaluated considering this new use-case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense, moved rewrite rule for traces endpoint into existed server, removed extra server

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you include the guidance from this comment?

Copy link
Collaborator Author

@kostz kostz Sep 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I understand you correctly,

  • Second server with a kubernetes plugin was removed
  • I'm not touching kubernetes plugin definition at all in the existed server, it stays the same
  • That enhancement you're referring to is probably a good case for individual ticket, testing (performance?) and individual pull request

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean I can replace

 kubernetes  {
            pods insecure
        }

with

 kubernetes cluster.local 2.10.in-addr.arpa 3.10.in-addr.arpa {
            pods insecure
        }

but I'm not sure about the potential impact and it looks like not much related to the feature I'm implementing

pods insecure
}
cache 30
{{ if eq .ConfigItems.coredns_log_svc_names "true"}}
log svc.svc.cluster.local.
{{ end }}
prometheus :9153
ready :9155
}
{{ end }}

# 10.2.0.0/16, 10.3.0.0/16 defines that this server is authority for revese
# lookups for these ranges.
cluster.local:9254 10.2.0.0/16:9254 10.3.0.0/16:9254 {
Expand Down
5 changes: 5 additions & 0 deletions cluster/manifests/coredns-local/daemonset-coredns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ spec:
- name: coredns
image: registry.opensource.zalan.do/teapot/coredns:1.8.4
args: [ "-conf", "/etc/coredns/Corefile" ]
env:
- name: ZONE
valueFrom:
fieldRef:
fieldPath: metadata.annotations['topology.kubernetes.io/zone']
volumeMounts:
- name: config-volume
mountPath: /etc/coredns
Expand Down