Browse Source
Merge pull request #1093 from mattymo/scaledns
Merge pull request #1093 from mattymo/scaledns
Add autoscalers for dnsmasq and kubednspull/1109/head
Matthew Mosesohn
7 years ago
committed by
GitHub
9 changed files with 141 additions and 27 deletions
Split View
Diff Options
-
6roles/dnsmasq/defaults/main.yml
-
22roles/dnsmasq/tasks/main.yml
-
9roles/dnsmasq/tasks/pre_upgrade.yml
-
50roles/dnsmasq/templates/dnsmasq-autoscaler.yml
-
9roles/dnsmasq/templates/dnsmasq-deploy.yml
-
5roles/kubernetes-apps/ansible/defaults/main.yml
-
7roles/kubernetes-apps/ansible/tasks/main.yml
-
49roles/kubernetes-apps/ansible/templates/kubedns-autoscaler.yml
-
11roles/kubernetes-apps/ansible/templates/kubedns-deploy.yml
@ -0,0 +1,9 @@ |
|||
--- |
|||
- name: Delete legacy dnsmasq daemonset |
|||
kube: |
|||
name: dnsmasq |
|||
namespace: "{{system_namespace}}" |
|||
kubectl: "{{bin_dir}}/kubectl" |
|||
resource: "ds" |
|||
state: absent |
|||
when: inventory_hostname == groups['kube-master'][0] |
@ -0,0 +1,50 @@ |
|||
# Copyright 2016 The Kubernetes Authors. |
|||
# |
|||
# Licensed under the Apache License, Version 2.0 (the "License"); |
|||
# you may not use this file except in compliance with the License. |
|||
# You may obtain a copy of the License at |
|||
# |
|||
# http://www.apache.org/licenses/LICENSE-2.0 |
|||
# |
|||
# Unless required by applicable law or agreed to in writing, software |
|||
# distributed under the License is distributed on an "AS IS" BASIS, |
|||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|||
# See the License for the specific language governing permissions and |
|||
# limitations under the License. |
|||
|
|||
apiVersion: extensions/v1beta1 |
|||
kind: Deployment |
|||
metadata: |
|||
name: dnsmasq-autoscaler |
|||
namespace: kube-system |
|||
labels: |
|||
k8s-app: dnsmasq-autoscaler |
|||
kubernetes.io/cluster-service: "true" |
|||
addonmanager.kubernetes.io/mode: Reconcile |
|||
spec: |
|||
template: |
|||
metadata: |
|||
labels: |
|||
k8s-app: dnsmasq-autoscaler |
|||
annotations: |
|||
scheduler.alpha.kubernetes.io/critical-pod: '' |
|||
scheduler.alpha.kubernetes.io/tolerations: '[{"key":"CriticalAddonsOnly", "operator":"Exists"}]' |
|||
spec: |
|||
containers: |
|||
- name: autoscaler |
|||
image: gcr.io/google_containers/cluster-proportional-autoscaler-amd64:1.1.1 |
|||
resources: |
|||
requests: |
|||
cpu: "20m" |
|||
memory: "10Mi" |
|||
command: |
|||
- /cluster-proportional-autoscaler |
|||
- --namespace=kube-system |
|||
- --configmap=dnsmasq-autoscaler |
|||
- --target=ReplicationController/dnsmasq |
|||
# When cluster is using large nodes(with more cores), "coresPerReplica" should dominate. |
|||
# If using small nodes, "nodesPerReplica" should dominate. |
|||
- --default-params={"linear":{"nodesPerReplica":{{ dnsmasq_nodes_per_replica }},"preventSinglePointFailure":true}} |
|||
- --logtostderr=true |
|||
- --v={{ kube_log_level }} |
|||
|
@ -0,0 +1,49 @@ |
|||
# Copyright 2016 The Kubernetes Authors. |
|||
# |
|||
# Licensed under the Apache License, Version 2.0 (the "License"); |
|||
# you may not use this file except in compliance with the License. |
|||
# You may obtain a copy of the License at |
|||
# |
|||
# http://www.apache.org/licenses/LICENSE-2.0 |
|||
# |
|||
# Unless required by applicable law or agreed to in writing, software |
|||
# distributed under the License is distributed on an "AS IS" BASIS, |
|||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|||
# See the License for the specific language governing permissions and |
|||
# limitations under the License. |
|||
|
|||
apiVersion: extensions/v1beta1 |
|||
kind: Deployment |
|||
metadata: |
|||
name: kubedns-autoscaler |
|||
namespace: kube-system |
|||
labels: |
|||
k8s-app: kubedns-autoscaler |
|||
kubernetes.io/cluster-service: "true" |
|||
addonmanager.kubernetes.io/mode: Reconcile |
|||
spec: |
|||
template: |
|||
metadata: |
|||
labels: |
|||
k8s-app: kubedns-autoscaler |
|||
annotations: |
|||
scheduler.alpha.kubernetes.io/critical-pod: '' |
|||
scheduler.alpha.kubernetes.io/tolerations: '[{"key":"CriticalAddonsOnly", "operator":"Exists"}]' |
|||
spec: |
|||
containers: |
|||
- name: autoscaler |
|||
image: gcr.io/google_containers/cluster-proportional-autoscaler-amd64:1.1.1 |
|||
resources: |
|||
requests: |
|||
cpu: "20m" |
|||
memory: "10Mi" |
|||
command: |
|||
- /cluster-proportional-autoscaler |
|||
- --namespace=kube-system |
|||
- --configmap=kubedns-autoscaler |
|||
# Should keep target in sync with cluster/addons/dns/kubedns-controller.yaml.base |
|||
- --target=replicationcontroller/kubedns |
|||
- --default-params={"linear":{"nodesPerReplica":{{ kubedns_nodes_per_replica }},"min":{{ kubedns_min_replicas }}}} |
|||
- --logtostderr=true |
|||
- --v=2 |
|||
|
Write
Preview
Loading…
Cancel
Save