Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need to mess with the admin .kubeconfig anymore

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to handle the cleanup separately, since the current issue being addressed in this PR is a blocker. However, if you are sure about this line no longer being required, I can remove it in this PR.


# 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 All @@ -66,8 +69,8 @@ systemctl enable openshift-node.service
systemctl start openshift-node.service

# Set up the KUBECONFIG environment variable for use by the client
echo 'export KUBECONFIG=/openshift.local.certificates/admin/.kubeconfig' >> /root/.bash_profile
echo 'export KUBECONFIG=/openshift.local.certificates/admin/.kubeconfig' >> /home/vagrant/.bash_profile
echo 'export KUBECONFIG=/openshift.local.certificates/node-${minion_name}/.kubeconfig' >> /root/.bash_profile
echo 'export KUBECONFIG=/openshift.local.certificates/node-${minion_name}/.kubeconfig' >> /home/vagrant/.bash_profile

# Register with the master
#curl -X POST -H 'Accept: application/json' -d "{\"kind\":\"Minion\", \"id\":"${MINION_IP}", \"apiVersion\":\"v1beta1\", \"hostIP\":"${MINION_IP}" }" http://${MASTER_IP}:8080/api/v1beta1/minions