Skip to content

Commit

Permalink
fix: resolve okd 3.10 installation issues (#77)
Browse files Browse the repository at this point in the history
* fix: resolve okd 3.10 installation issues

This bugfix resolves two issues. The first is that `openshift_hostname`
is no longer a valid configuration value. The second is that `systemctl
restart docker` seems to hang on the openshift nodes, it has been
replaced with a shutdown/restart.

Fixes #75, fixes #72, fixes #71.

* chore: cleaner comments in scripts

* chore: improve makefile output
  • Loading branch information
dwmkerr authored Mar 5, 2019
1 parent 13f268a commit 28d6956
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
10 changes: 5 additions & 5 deletions inventory.template.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ openshift_node_groups=[{'name': 'node-config-master', 'labels': ['node-role.kube
# is a bug with the installer when using the AWS cloud provider.
# Note that we use the master node as an infra node as well, which is not recommended for production use.
[masters]
${master_hostname} openshift_hostname=${master_hostname}
${master_hostname}

# host group for etcd
[etcd]
${master_hostname} openshift_hostname=${master_hostname}
${master_hostname}

# all nodes - along with their openshift_node_groups.
[nodes]
${master_hostname} openshift_hostname=${master_hostname} openshift_node_group_name='node-config-master-infra' openshift_schedulable=true
${node1_hostname} openshift_hostname=${node1_hostname} openshift_node_group_name='node-config-compute'
${node2_hostname} openshift_hostname=${node2_hostname} openshift_node_group_name='node-config-compute'
${master_hostname} openshift_node_group_name='node-config-master-infra' openshift_schedulable=true
${node1_hostname} openshift_node_group_name='node-config-compute'
${node2_hostname} openshift_node_group_name='node-config-compute'
11 changes: 7 additions & 4 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
infrastructure:
# Get the modules, create the infrastructure.
terraform init && terraform get && terraform apply
terraform init && terraform get && terraform apply -auto-approve

# Installs OpenShift on the cluster.
openshift:
Expand All @@ -17,9 +17,12 @@ openshift:
cat install-from-bastion.sh | ssh -o StrictHostKeyChecking=no -A ec2-user@$$(terraform output bastion-public_ip)

# Now the installer is done, run the postinstall steps on each host.
cat ./scripts/postinstall-master.sh | ssh -A ec2-user@$$(terraform output bastion-public_ip) ssh master.openshift.local
cat ./scripts/postinstall-node.sh | ssh -A ec2-user@$$(terraform output bastion-public_ip) ssh node1.openshift.local
cat ./scripts/postinstall-node.sh | ssh -A ec2-user@$$(terraform output bastion-public_ip) ssh node2.openshift.local
# Note: these scripts cause a restart, so we use a hyphen to ignore the ssh
# connection termination.
- cat ./scripts/postinstall-master.sh | ssh -A ec2-user@$$(terraform output bastion-public_ip) ssh master.openshift.local
- cat ./scripts/postinstall-node.sh | ssh -A ec2-user@$$(terraform output bastion-public_ip) ssh node1.openshift.local
- cat ./scripts/postinstall-node.sh | ssh -A ec2-user@$$(terraform output bastion-public_ip) ssh node2.openshift.local
echo "Complete! Wait a minute for hosts to restart, then run 'make browse-openshift' to login."

# Destroy the infrastructure.
destroy:
Expand Down
7 changes: 6 additions & 1 deletion scripts/postinstall-master.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@ sudo su

# Create an htpasswd file, we'll use htpasswd auth for OpenShift.
htpasswd -cb /etc/origin/master/htpasswd admin 123
echo "Password for 'admin' set to '123'"

# Update the docker config to allow OpenShift's local insecure registry. Also
# use json-file for logging, so our Splunk forwarder can eat the container logs.
# json-file for logging
sed -i '/OPTIONS=.*/c\OPTIONS="--selinux-enabled --insecure-registry 172.30.0.0/16 --log-driver=json-file --log-opt max-size=1M --log-opt max-file=3"' /etc/sysconfig/docker
systemctl restart docker
echo "Docker configuration updated..."

# It seems that with OKD 3.10, systemctl restart docker will hang. So just reboot.
echo "Restarting host..."
shutdown -r now "restarting post docker configuration"
6 changes: 5 additions & 1 deletion scripts/postinstall-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ sudo su
# use json-file for logging, so our Splunk forwarder can eat the container logs.
# json-file for logging
sed -i '/OPTIONS=.*/c\OPTIONS="--selinux-enabled --insecure-registry 172.30.0.0/16 --log-driver=json-file --log-opt max-size=1M --log-opt max-file=3"' /etc/sysconfig/docker
systemctl restart docker
echo "Docker configuration updated..."

# It seems that with OKD 3.10, systemctl restart docker will hang. So just reboot.
echo "Restarting host..."
shutdown -r now "restarting post docker configuration"

0 comments on commit 28d6956

Please sign in to comment.