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

Vagrant fixup for etcd 2.0 regression, and other issues #3972

Merged
merged 2 commits into from
Jan 30, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions cluster/saltbase/salt/etcd/default
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
{% set hostname = grains.host %}
DAEMON_ARGS="-peer-addr {{hostname}}:7001 -name {{hostname}}"
{% set etcd_servers = "127.0.0.1" -%}
{% if grains.etcd_servers is defined -%}
{% set etcd_servers = grains.etcd_servers -%}
{% endif -%}

DAEMON_ARGS="-addr {{etcd_servers}}:4001 -bind-addr {{etcd_servers}}:4001 -data-dir /var/etcd"
2 changes: 2 additions & 0 deletions cluster/saltbase/salt/etcd/etcd.service
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Documentation=https://github.com/coreos/etcd
Type=simple
EnvironmentFile=/etc/default/etcd
ExecStart=/usr/local/bin/etcd $DAEMON_ARGS
Restart=always
RestartSec=30

[Install]
WantedBy=multi-user.target
4 changes: 2 additions & 2 deletions cluster/saltbase/salt/kube-addons/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
- user: root
- group: root

/usr/lib/systemd/scripts/kube-addons:
/etc/kubernetes/kube-addons.sh:
file.managed:
- source: salt://kube-addons/initd
- source: salt://kube-addons/kube-addons.sh
- user: root
- group: root
- mode: 755
Expand Down
2 changes: 1 addition & 1 deletion cluster/saltbase/salt/kube-addons/kube-addons.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Description=Kubernetes Addon Object Manager
Documentation=https://github.com/GoogleCloudPlatform/kubernetes

[Service]
ExecStart=/usr/lib/systemd/scripts/kube-addons start
ExecStart=/etc/kubernetes/kube-addons.sh

[Install]
WantedBy=multi-user.target
40 changes: 40 additions & 0 deletions cluster/saltbase/salt/kube-addons/kube-addons.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

# Copyright 2014 Google Inc. All rights reserved.
#
# 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.

# The business logic for whether a given object should be created
# was already enforced by salt, and /etc/kubernetes/addons is the
# managed result is of that. Start everything below that directory.
echo "== Kubernetes addon manager started at $(date -Is) =="
KUBECTL=/usr/local/bin/kubectl
for obj in $(find /etc/kubernetes/addons -name \*.yaml); do
${KUBECTL} --server="127.0.0.1:8080" create -f ${obj} &
echo "++ addon ${obj} started in pid $! ++"
done
noerrors="true"
for pid in $(jobs -p); do
wait ${pid} || noerrors="false"
echo "++ pid ${pid} complete ++"
done
if [ ${noerrors} == "true" ]; then
echo "== Kubernetes addon manager completed successfully at $(date -Is) =="
else
echo "== Kubernetes addon manager completed with errors at $(date -Is) =="
fi

# We stay around so that status checks by salt make it look like
# the service is good. (We could do this is other ways, but this
# is simple.)
sleep infinity
4 changes: 4 additions & 0 deletions cluster/saltbase/salt/monit/init.sls
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{% if grains['os_family'] != 'RedHat' %}

monit:
pkg:
- installed
Expand All @@ -17,3 +19,5 @@ monit-service:
- watch:
- pkg: monit
- file: /etc/monit/conf.d/etcd

{% endif %}