Skip to content

Commit

Permalink
provision.sh: Add yq binary and domain entry to NM configuration
Browse files Browse the repository at this point in the history
Right now auth route is not accessible by default and need to be add as
part of NetworkManager configuration. Also to make this whole route stuff works
with libvirt we need to add a different domain `.apps.openshift.testing`.

(Tested with installer 0.14.0 tag)
  • Loading branch information
praveenkumar authored and sallyom committed Jun 23, 2020
1 parent a34b5d3 commit 0390ba4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
18 changes: 14 additions & 4 deletions provision.sh
Expand Up @@ -33,6 +33,13 @@ curl -s https://mirror.go-repo.io/centos/go-repo.repo | sudo tee /etc/yum.repos.
# TODO: find the GPG key for SIG-Virt stuff
sudo yum install -y --nogpg libvirt libvirt-devel libvirt-client git golang libvirt-daemon-kvm qemu-kvm bind-utils jq

# Install yq to manipulate manifest file created by installer.
if [[ ! -e /usr/local/bin/yq ]]; then
curl -L https://github.com/mikefarah/yq/releases/download/2.2.1/yq_linux_amd64 -o yq
chmod +x yq
sudo mv yq /usr/local/bin/yq
fi

# Enable IP forwarding
# https://github.com/openshift/installer/blob/master/docs/dev/libvirt-howto.md#enable-ip-forwarding
sudo sysctl net.ipv4.ip_forward=1
Expand Down Expand Up @@ -76,8 +83,10 @@ sudo firewall-cmd --zone=trusted --add-port=16509/tcp

# Enable NetworkManager DNS overlay
# https://github.com/openshift/installer/blob/master/docs/dev/libvirt-howto.md#set-up-networkmanager-dns-overlay
sudo sed -i -z 's/\[main\]\n/\[main\]\ndns=dnsmasq\n/' /etc/NetworkManager/NetworkManager.conf
echo -e "[main]\ndns=dnsmasq" | sudo tee /etc/NetworkManager/conf.d/openshift.conf
echo server=/openshift.testing/192.168.126.1 | sudo tee /etc/NetworkManager/dnsmasq.d/openshift.conf
# Create new domain for ingress to make sure it able to resolve auth route URL
echo address=/.apps.openshift.testing/192.168.126.51 | sudo tee -a /etc/NetworkManager/dnsmasq.d/openshift.conf
sudo systemctl restart NetworkManager

# Configure the default libvirt storage pool
Expand All @@ -98,9 +107,10 @@ update-rhcos-image

echo "Installing oc client"
cd $HOME
curl -OL https://github.com/openshift/origin/releases/download/v3.11.0/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz
tar -zxf openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz
sudo mv $HOME/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit/oc /usr/local/bin
curl -OL http://mirror.openshift.com/pub/openshift-v3/clients/4.0.22/linux/oc.tar.gz
tar -zxf oc.tar.gz
rm -fr oc.tar.gz
sudo mv $HOME/oc /usr/local/bin

echo "Installing kubectl binary"
sudo ln -s /usr/local/bin/oc /usr/local/bin/kubectl
Expand Down
15 changes: 12 additions & 3 deletions tools/create-cluster
Expand Up @@ -34,15 +34,24 @@ controlPlane:
metadata:
name: "${CLUSTER_NAME}"
networking:
clusterNetworks:
- cidr: 10.128.0.0/14
hostSubnetLength: 9
machineCIDR: 192.168.126.0/24
serviceCIDR: 172.30.0.0/16
type: OpenShiftSDN
platform:
libvirt:
defaultMachinePlatform:
image: "https://releases-rhcos.svc.ci.openshift.org/storage/releases/maipo/${BUILD}/redhat-coreos-maipo-${BUILD}-qemu.qcow2.gz"
network:
if: tt0
pullSecret: '$(curl http://metadata.google.internal/computeMetadata/v1/instance/attributes/openshift-pull-secret -H "Metadata-Flavor: Google")'
sshKey: |
$(cat "${PUB_SSH_KEY}")
EOF

# Create manifests and modify route domain
openshift-install --dir="$CLUSTER_DIR" create manifests
yq w -i $CLUSTER_DIR/manifests/cluster-ingress-02-config.yml spec[domain] apps.$BASE_DOMAIN

export TF_VAR_libvirt_master_memory=11024
openshift-install create cluster --log-level=debug --dir="$CLUSTER_DIR" 2>&1 | tee /tmp/installer.log

0 comments on commit 0390ba4

Please sign in to comment.