Skip to content

Commit

Permalink
update how to set libvirt master memory via machineconfigs and add wa…
Browse files Browse the repository at this point in the history
…it-for installer-complete
  • Loading branch information
sallyom committed Apr 2, 2020
1 parent 9ea13b7 commit 0e9ee53
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ Note: this script uses scp to copy pull-secret to gcp instance. Alternative is
add pull-secret to metadata when creating the instance. However, metadata is printed
in the gcp console. This is why this setup uses scp instead.
```
Check out `create-gcp-resources.sh` for individual commands or run the script like so:
You can either run the commands from `create-gcp-resources.sh` individually or run the script like so:

```shell
$ export INSTANCE=mytest
$ export GCP_USER=<your gcp username>, used to scp pull-secret to $HOME/pull-secret in gcp instance
$ export GCP_USER=<whatever name you login as to gcp instance>, used to scp pull-secret to $HOME/pull-secret in gcp instance
$ export PULL_SECRET=/path/to/pull-secret-one-liner.json
$ ./create-gcp-resources.sh
```
Expand Down
11 changes: 10 additions & 1 deletion create-gcp-resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,23 @@ if [[ -z "$GCP_USER" ]]; then
fi
set -euo pipefail
set -x

# 1 - create network
gcloud compute networks create "${INSTANCE}" \
--subnet-mode=custom \
--bgp-routing-mode=regional

# 2 - create network subnet
gcloud compute networks subnets create "${INSTANCE}" \
--network "${INSTANCE}" \
--range=10.0.0.0/9

# 3 - create firewall rules
gcloud compute firewall-rules create "${INSTANCE}" \
--network "${INSTANCE}" \
--allow tcp:22,icmp


# 4 - create instance, see IMAGES.md for info about openshift4-libvirt image
gcloud compute instances create "${INSTANCE}" \
--image-family openshift4-libvirt \
--zone us-east1-c \
Expand All @@ -40,6 +44,11 @@ gcloud compute instances create "${INSTANCE}" \
--network "${INSTANCE}" \
--subnet "${INSTANCE}"

# pause for ssh for a few seconds
echo pause for 10s before copying the pull-secret
sleep 10s

# 5 - copy the pull-secret over to the gcp instance
ZONE=$(gcloud config get-value compute/zone)
PROJECT=$(gcloud config get-value project)
gcloud compute --project "${PROJECT}" scp \
Expand Down
11 changes: 8 additions & 3 deletions tools/create-cluster
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ EOF
# Create manifests and modify route domain
openshift-install --dir="$CLUSTER_DIR" create manifests
# Workaround for https://github.com/openshift/installer/issues/1007
yq w -i $CLUSTER_DIR/manifests/cluster-ingress-02-config.yml spec[domain] apps.$BASE_DOMAIN
# Add custom domain to cluster-ingress
yq write --inplace $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"
# Add master memory to 12 GB
# This is only valid for openshift 4.3 onwards
yq write --inplace ${CLUSTER_DIR}/openshift/99_openshift-cluster-api_master-machines-0.yaml spec.providerSpec.value[domainMemory] 14336

openshift-install create cluster --log-level=debug --dir="$CLUSTER_DIR" || true
openshift-install wait-for install-complete --log-level=debug --dir="$CLUSTER_DIR"

0 comments on commit 0e9ee53

Please sign in to comment.