Skip to content

Commit

Permalink
Merge pull request kubernetes#30870 from piosz/rescheduler-setup
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue

Salt configuration for Rescheduler

ref kubernetes#29023
  • Loading branch information
Kubernetes Submit Queue authored Aug 19, 2016
2 parents 30b180e + 1f3fdab commit a24df66
Show file tree
Hide file tree
Showing 11 changed files with 83 additions and 0 deletions.
1 change: 1 addition & 0 deletions build/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,7 @@ function kube::release::package_kube_manifests_tarball() {
cp "${salt_dir}/kube-controller-manager/kube-controller-manager.manifest" "${dst_dir}"
cp "${salt_dir}/kube-addons/kube-addon-manager.yaml" "${dst_dir}"
cp "${salt_dir}/l7-gcp/glbc.manifest" "${dst_dir}"
cp "${salt_dir}/rescheduler/rescheduler.manifest" "${dst_dir}/"
cp "${KUBE_ROOT}/cluster/gce/trusty/configure-helper.sh" "${dst_dir}/trusty-configure-helper.sh"
cp "${KUBE_ROOT}/cluster/gce/gci/configure-helper.sh" "${dst_dir}/gci-configure-helper.sh"
cp "${KUBE_ROOT}/cluster/gce/gci/health-monitor.sh" "${dst_dir}/health-monitor.sh"
Expand Down
1 change: 1 addition & 0 deletions cluster/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ ENABLE_CLUSTER_LOGGING: $(yaml-quote ${ENABLE_CLUSTER_LOGGING:-false})
ENABLE_CLUSTER_UI: $(yaml-quote ${ENABLE_CLUSTER_UI:-false})
ENABLE_NODE_PROBLEM_DETECTOR: $(yaml-quote ${ENABLE_NODE_PROBLEM_DETECTOR:-false})
ENABLE_NODE_LOGGING: $(yaml-quote ${ENABLE_NODE_LOGGING:-false})
ENABLE_RESCHEDULER: $(yaml-quote ${ENABLE_RESCHEDULER:-false})
LOGGING_DESTINATION: $(yaml-quote ${LOGGING_DESTINATION:-})
ELASTICSEARCH_LOGGING_REPLICAS: $(yaml-quote ${ELASTICSEARCH_LOGGING_REPLICAS:-})
ENABLE_CLUSTER_DNS: $(yaml-quote ${ENABLE_CLUSTER_DNS:-false})
Expand Down
3 changes: 3 additions & 0 deletions cluster/gce/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ if [[ "${ENABLE_CLUSTER_AUTOSCALER}" == "true" ]]; then
AUTOSCALER_ENABLE_SCALE_DOWN="${KUBE_AUTOSCALER_ENABLE_SCALE_DOWN:-true}"
fi

# Optional: Enable Rescheduler
ENABLE_RESCHEDULER="${KUBE_ENABLE_RESCHEDULER:-false}"

# Admission Controllers to invoke prior to persisting objects in cluster
# If we included ResourceQuota, we should keep it at the end of the list to prevent incremeting quota usage prematurely.
ADMISSION_CONTROL=NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,ResourceQuota
Expand Down
3 changes: 3 additions & 0 deletions cluster/gce/config-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ if [[ "${ENABLE_CLUSTER_AUTOSCALER}" == "true" ]]; then
AUTOSCALER_ENABLE_SCALE_DOWN="${KUBE_AUTOSCALER_ENABLE_SCALE_DOWN:-false}"
fi

# Optional: Enable Rescheduler
ENABLE_RESCHEDULER="${KUBE_ENABLE_RESCHEDULER:-false}"

# If we included ResourceQuota, we should keep it at the end of the list to prevent incremeting quota usage prematurely.
ADMISSION_CONTROL="${KUBE_ADMISSION_CONTROL:-NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,ResourceQuota}"

Expand Down
1 change: 1 addition & 0 deletions cluster/gce/configure-vm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ enable_cluster_ui: '$(echo "$ENABLE_CLUSTER_UI" | sed -e "s/'/''/g")'
enable_node_problem_detector: '$(echo "$ENABLE_NODE_PROBLEM_DETECTOR" | sed -e "s/'/''/g")'
enable_l7_loadbalancing: '$(echo "$ENABLE_L7_LOADBALANCING" | sed -e "s/'/''/g")'
enable_node_logging: '$(echo "$ENABLE_NODE_LOGGING" | sed -e "s/'/''/g")'
enable_rescheduler: '$(echo "$ENABLE_RESCHEDULER" | sed -e "s/'/''/g")'
logging_destination: '$(echo "$LOGGING_DESTINATION" | sed -e "s/'/''/g")'
elasticsearch_replicas: '$(echo "$ELASTICSEARCH_LOGGING_REPLICAS" | sed -e "s/'/''/g")'
enable_cluster_dns: '$(echo "$ENABLE_CLUSTER_DNS" | sed -e "s/'/''/g")'
Expand Down
11 changes: 11 additions & 0 deletions cluster/gce/gci/configure-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,16 @@ function start-lb-controller {
fi
}

# Starts rescheduler.
function start-rescheduler {
if [[ "${ENABLE_RESCHEDULER:-}" == "true" ]]; then
echo "Starting Rescheduler"
prepare-log-file /var/log/rescheduler.log
cp "${KUBE_HOME}/kube-manifests/kubernetes/gci-trusty/rescheduler.manifest" \
/etc/kubernetes/manifests/
fi
}

function reset-motd {
# kubelet is installed both on the master and nodes, and the version is easy to parse (unlike kubectl)
local -r version="$(/usr/bin/kubelet --version=true | cut -f2 -d " ")"
Expand Down Expand Up @@ -1053,6 +1063,7 @@ if [[ "${KUBERNETES_MASTER:-}" == "true" ]]; then
start-kube-addons
start-cluster-autoscaler
start-lb-controller
start-rescheduler
else
start-kube-proxy
# Kube-registry-proxy.
Expand Down
9 changes: 9 additions & 0 deletions cluster/gce/trusty/configure-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,15 @@ start_cluster_autoscaler() {
fi
}

# Starts rescheduler.
start-rescheduler() {
if [[ "${ENABLE_RESCHEDULER:-}" == "true" ]]; then
prepare-log-file /var/log/rescheduler.log
cp "${KUBE_HOME}/kube-manifests/kubernetes/gci-trusty/rescheduler.manifest" \
/etc/kubernetes/manifests/
fi
}

# Starts a fluentd static pod for logging.
start_fluentd() {
if [ "${ENABLE_NODE_LOGGING:-}" = "true" ]; then
Expand Down
1 change: 1 addition & 0 deletions cluster/gce/trusty/master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ script
start_kube_scheduler
start_kube_addons
start_cluster_autoscaler
start_rescheduler
reset_motd
} 2>&1 | logger --priority daemon.info -t ${UPSTART_JOB}
end script
Expand Down
15 changes: 15 additions & 0 deletions cluster/saltbase/salt/rescheduler/init.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/etc/kubernetes/manifests/rescheduler.manifest:
file.managed:
- source: salt://rescheduler/rescheduler.manifest
- template: jinja
- user: root
- group: root
- mode: 644
- makedirs: true
- dir_mode: 755

/var/log/rescheduler.log:
file.managed:
- user: root
- group: root
- mode: 644
35 changes: 35 additions & 0 deletions cluster/saltbase/salt/rescheduler/rescheduler.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: v1
kind: Pod
metadata:
name: rescheduler-v0.1.0
namespace: kube-system
labels:
k8s-app: rescheduler
version: v0.1.0
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "Rescheduler"
spec:
hostNetwork: true
containers:
- image: gcr.io/google_containers/rescheduler:v0.1.0
name: rescheduler
volumeMounts:
- mountPath: /var/log/rescheduler.log
name: logfile
readOnly: false
resources:
limits:
cpu: 100m
memory: 300Mi
requests:
cpu: 10m
memory: 100Mi
command:
# TODO: split this out into args when we no longer need to pipe stdout to a file #6428
- sh
- -c
- '/rescheduler --running-in-cluster=false 1>>/var/log/rescheduler.log 2>&1'
volumes:
- hostPath:
path: /var/log/rescheduler.log
name: logfile
3 changes: 3 additions & 0 deletions cluster/saltbase/salt/top.sls
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ base:
{% if pillar.get('enable_cluster_autoscaler', '').lower() == 'true' %}
- cluster-autoscaler
{% endif %}
{% if pillar.get('enable_rescheduler', '').lower() == 'true' %}
- rescheduler
{% endif %}
{% if pillar.get('network_policy_provider', '').lower() == 'calico' %}
- calico.master
{% endif %}

0 comments on commit a24df66

Please sign in to comment.