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

CoreDNS Autoscaler #1023

Closed
davidnuzik opened this issue May 19, 2021 · 6 comments
Closed

CoreDNS Autoscaler #1023

davidnuzik opened this issue May 19, 2021 · 6 comments
Assignees
Labels
kind/dev-validation Dev will be validating this issue kind/rke1-feature-parity

Comments

@davidnuzik
Copy link
Contributor

CoreDNS Autoscaler work for Rancher 2.6.x

@davidnuzik davidnuzik added this to the Rancher 2.6.x milestone May 19, 2021
@davidnuzik davidnuzik added this to To Triage in Development [DEPRECATED] via automation May 19, 2021
@davidnuzik davidnuzik moved this from To Triage to Backlog in Development [DEPRECATED] May 19, 2021
@cjellick cjellick moved this from Backlog to Next Up in Development [DEPRECATED] Jul 14, 2021
@cjellick
Copy link
Contributor

RKE1 did this. @superseb can give more context. Or perhaps @Oats87 can.

If feasible, we should also do in k3s.

@manuelbuil
Copy link
Contributor

Need some clarification. The code is already present in the coredns chart that rke2 is using but the variable to enable this feature was set to false. Should I enable it by default?

@manuelbuil
Copy link
Contributor

manuelbuil commented Jul 19, 2021

Apart from that, I guess the tasks for this issue are:

  • Use an internal rancher image for the autoscaler (e.g. what rke is using) instead of the upstream image
  • Update the coredns hardened image version (1.6.9) so that it is aligned with the rke autoscaler image (1.8.3)
  • Document what is the dns autoscaler and how to enable/disable it
  • Add new images into rke2 airgap
  • Update coredns helm chart
  • Enable it by default? Yes. https://rancher.slack.com/archives/CRF4B1J8H/p1626792513234700

@manuelbuil
Copy link
Contributor

Tested and works. To test:

  • Verify there is a new deployment : rke2-coredns-rke2-coredns-autoscaler on namespace kube-system
  • Verify there is a new configMap: rke2-coredns-rke2-coredns-autoscaler on namespace kube-system
  • Check the logs of the autoscaler and verfy there are no errors. Working logs:
I0720 09:38:52.055732       1 autoscaler.go:49] Scaling Namespace: kube-system, Target: deployment/rke2-coredns-rke2-coredns
I0720 09:38:53.056094       1 plugin.go:50] Set control mode to linear
I0720 09:38:53.056343       1 linear_controller.go:60] ConfigMap version change (old:  new: 1967) - rebuilding params
I0720 09:38:53.056532       1 linear_controller.go:61] Params from apiserver: 
{
  "coresPerReplica": 256,
  "nodesPerReplica": 16,
  "preventSinglePointFailure": true
}
I0720 09:38:53.056771       1 linear_controller.go:80] Defaulting min replicas count to 1 for linear controller

@manuelbuil manuelbuil moved this from Working to To Test in Development [DEPRECATED] Jul 26, 2021
@manuelbuil manuelbuil moved this from To Test to Working in Development [DEPRECATED] Jul 27, 2021
@manuelbuil manuelbuil moved this from Working to Peer Review in Development [DEPRECATED] Jul 27, 2021
@manuelbuil manuelbuil moved this from Peer Review to To Test in Development [DEPRECATED] Jul 27, 2021
@bmdepesa bmdepesa added the kind/dev-validation Dev will be validating this issue label Aug 12, 2021
@galal-hussein
Copy link
Contributor

Verified against master commit ID: 09bb5c2

Steps to verify:

  • Install rke2 with commit ID:
curl https://get.rke2.io | INSTALL_RKE2_COMMIT=09bb5c27f29cf3dd831653543d274c948a225385 sh -
  • verified that autoscaler deployement exists in kube-system namespace:
root@ip-172-31-15-16:~# kubectl get deployments -n kube-system
NAME                                   READY   UP-TO-DATE   AVAILABLE   AGE
rke2-coredns-rke2-coredns              1/1     1            1           8m39s
rke2-coredns-rke2-coredns-autoscaler   1/1     1            1           8m39s
rke2-metrics-server                    1/1     1            1           7m59s
  • verified that configmap created for autoscaler in kube-system namespace:
kubectl get configmap -n kube-system rke2-coredns-rke2-coredns-autoscaler -o yaml
apiVersion: v1
data:
  linear: |-
    {
      "coresPerReplica": 256,
      "nodesPerReplica": 16,
      "preventSinglePointFailure": true,
      "min": 0,
      "max": 0,
      "includeUnschedulableNodes": false
    }
kind: ConfigMap
metadata:
  annotations:
    meta.helm.sh/release-name: rke2-coredns
    meta.helm.sh/release-namespace: kube-system
  creationTimestamp: "2021-09-22T20:21:03Z"
  labels:
    app.kubernetes.io/instance: rke2-coredns
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: rke2-coredns-autoscaler
    helm.sh/chart: rke2-coredns-1.16.201-build2021072308
    k8s-app: kube-dns-autoscaler
    kubernetes.io/cluster-service: "true"
    kubernetes.io/name: CoreDNS
  name: rke2-coredns-rke2-coredns-autoscaler
  namespace: kube-system
  resourceVersion: "586"
  uid: 1e270506-9937-41c0-9732-83d7f909526f
  • verified that there are no error logs in the coredns pod:
kubectl logs -n kube-system rke2-coredns-rke2-coredns-autoscaler-7c58bd5b6c-qk2rl
I0922 20:21:42.401801       1 autoscaler.go:49] Scaling Namespace: kube-system, Target: deployment/rke2-coredns-rke2-coredns
I0922 20:21:42.752449       1 plugin.go:50] Set control mode to linear
I0922 20:21:42.752473       1 linear_controller.go:60] ConfigMap version change (old:  new: 586) - rebuilding params
I0922 20:21:42.752479       1 linear_controller.go:61] Params from apiserver: 
{
  "coresPerReplica": 256,
  "nodesPerReplica": 16,
  "preventSinglePointFailure": true,
  "min": 0,
  "max": 0,
  "includeUnschedulableNodes": false
}
I0922 20:21:42.752547       1 linear_controller.go:80] Defaulting min replicas count to 1 for linear controller

@galal-hussein
Copy link
Contributor

Verified against rke2 v1.21.5-rc2+rke2r1

Steps to verify:

  • Install rke2 server version v1.21.5-rc2+rke2r1
  • Verified that deployment exists for coredns autoscaler:
root@ip-172-31-15-16:~# kubectl get deployments -n kube-system
NAME                                   READY   UP-TO-DATE   AVAILABLE   AGE
rke2-coredns-rke2-coredns              1/1     1            1           15m
rke2-coredns-rke2-coredns-autoscaler   1/1     1            1           15m
rke2-metrics-server                    1/1     1            1           14m
  • Verified that Configmap exists for coredns autoscaler:
# kubectl get configmap -n kube-system rke2-coredns-rke2-coredns-autoscaler -o yaml
apiVersion: v1
data:
  linear: |-
    {
      "coresPerReplica": 256,
      "nodesPerReplica": 16,
      "preventSinglePointFailure": true,
      "min": 0,
      "max": 0,
      "includeUnschedulableNodes": false
    }
kind: ConfigMap
metadata:
  annotations:
    meta.helm.sh/release-name: rke2-coredns
    meta.helm.sh/release-namespace: kube-system
  creationTimestamp: "2021-09-22T20:38:33Z"
  labels:
    app.kubernetes.io/instance: rke2-coredns
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: rke2-coredns-autoscaler
    helm.sh/chart: rke2-coredns-1.16.201-build2021072308
    k8s-app: kube-dns-autoscaler
    kubernetes.io/cluster-service: "true"
    kubernetes.io/name: CoreDNS
  name: rke2-coredns-rke2-coredns-autoscaler
  namespace: kube-system
  resourceVersion: "580"
  uid: a4cc6245-d6cf-4f8e-b773-dd40f0016764
  • Verified that there are no error logs in the coredns pod:
# kubectl logs rke2-coredns-rke2-coredns-autoscaler-7c58bd5b6c-vndcd -n kube-system
I0922 20:39:07.103041       1 autoscaler.go:49] Scaling Namespace: kube-system, Target: deployment/rke2-coredns-rke2-coredns
I0922 20:39:07.596034       1 plugin.go:50] Set control mode to linear
I0922 20:39:07.596173       1 linear_controller.go:60] ConfigMap version change (old:  new: 580) - rebuilding params
I0922 20:39:07.596205       1 linear_controller.go:61] Params from apiserver: 
{
  "coresPerReplica": 256,
  "nodesPerReplica": 16,
  "preventSinglePointFailure": true,
  "min": 0,
  "max": 0,
  "includeUnschedulableNodes": false
}
I0922 20:39:07.596363       1 linear_controller.go:80] Defaulting min replicas count to 1 for linear controller

Development [DEPRECATED] automation moved this from To Test to Done Issue / Merged PR Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/dev-validation Dev will be validating this issue kind/rke1-feature-parity
Projects
No open projects
Development [DEPRECATED]
Done Issue / Merged PR
Development

No branches or pull requests

7 participants