Skip to content

Commit

Permalink
Specifying the correct kubeconfig file for the minions in a cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhishek Gupta committed Mar 25, 2015
1 parent 1429ae5 commit b13a98e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vagrant/provision-minion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ source $(dirname $0)/provision-config.sh

MINION_IP=$4
OPENSHIFT_SDN=$6
MINION_INDEX=$5

# Setup hosts file to support ping by hostname to master
if [ ! "$(cat /etc/hosts | grep $MASTER_NAME)" ]; then
Expand Down Expand Up @@ -44,6 +45,8 @@ cp -r /vagrant/openshift.local.certificates /
chown -R vagrant.vagrant /openshift.local.certificates
sed -ie "s/10.0.2.15/${MASTER_IP}/g" /openshift.local.certificates/admin/.kubeconfig

# get the minion name, index is 1-based
minion_name=${MINION_NAMES[$MINION_INDEX-1]}
# Create systemd service
cat <<EOF > /usr/lib/systemd/system/openshift-node.service
[Unit]
Expand All @@ -52,7 +55,7 @@ Requires=docker.service network.service
After=network.service
[Service]
ExecStart=/usr/bin/openshift start node --kubeconfig=/openshift.local.certificates/admin/.kubeconfig
ExecStart=/usr/bin/openshift start node --kubeconfig=/openshift.local.certificates/node-${minion_name}/.kubeconfig
Restart=on-failure
RestartSec=10s
Expand Down

0 comments on commit b13a98e

Please sign in to comment.