summaryrefslogtreecommitdiffstats
path: root/roles/openshift_gcp
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2017-10-24 20:04:02 -0700
committerGitHub <noreply@github.com>2017-10-24 20:04:02 -0700
commitc6bde33f155ed6c0c7d7edfd78678f912131e86f (patch)
tree4e3b77bbd36d49d8480d3dc08a99ce931f0c6c12 /roles/openshift_gcp
parentf0da12b7292cddabfc7c33206cabf0ff34aa9852 (diff)
parent5547e39983a154829c56df0961eeab54c3933bd4 (diff)
downloadopenshift-c6bde33f155ed6c0c7d7edfd78678f912131e86f.tar.gz
openshift-c6bde33f155ed6c0c7d7edfd78678f912131e86f.tar.bz2
openshift-c6bde33f155ed6c0c7d7edfd78678f912131e86f.tar.xz
openshift-c6bde33f155ed6c0c7d7edfd78678f912131e86f.zip
Merge pull request #5780 from smarterclayton/allow_per_node_group_bootstrap_and_image
Automatic merge from submit-queue. Handle bootstrap behavior in GCP template Allow each node group to request bootstrap, allow per node group image override, and ensure the provision logic does not wait for bootstrapping node groups before continuing. This is an incremental step to allow GCP clusters to use bootstrap logic on cluster deploy without having fully baked images. We will switch over slowly and ensure both code paths function. Then we can remove this as necessary. For metadata, we set the cluster id and bootstrap state into instance metadata. On GCP, we'll use project metadata to set the bootstrap kubeconfig file and a startup-script to call it (not in a PR yet). Pairs with openshift/origin-gce#54 @kwoodson
Diffstat (limited to 'roles/openshift_gcp')
-rw-r--r--roles/openshift_gcp/templates/provision.j2.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/roles/openshift_gcp/templates/provision.j2.sh b/roles/openshift_gcp/templates/provision.j2.sh
index 64c7cd019..5ed6d9f84 100644
--- a/roles/openshift_gcp/templates/provision.j2.sh
+++ b/roles/openshift_gcp/templates/provision.j2.sh
@@ -125,10 +125,11 @@ fi ) &
if ! gcloud --project "{{ openshift_gcp_project }}" compute instance-templates describe "{{ openshift_gcp_prefix }}instance-template-{{ node_group.name }}" &>/dev/null; then
gcloud --project "{{ openshift_gcp_project }}" compute instance-templates create "{{ openshift_gcp_prefix }}instance-template-{{ node_group.name }}" \
--machine-type "{{ node_group.machine_type }}" --network "{{ openshift_gcp_network_name }}" \
- --tags "{{ openshift_gcp_prefix }}ocp,ocp,{{ node_group.tags }}" \
+ --tags "{{ openshift_gcp_prefix }}ocp,ocp,{{ 'ocp-bootstrap,' if (node_group.bootstrap | default(False)) else '' }}{{ node_group.tags }}" \
--boot-disk-size "{{ node_group.boot_disk_size }}" --boot-disk-type "pd-ssd" \
--scopes "logging-write,monitoring-write,useraccounts-ro,service-control,service-management,storage-ro,compute-rw" \
- --image "${image}" ${metadata}
+ --image "{{ node_group.image | default('${image}') }}" ${metadata} \
+ --metadata "bootstrap={{ node_group.bootstrap | default(False) | bool | to_json }},cluster-id={{ openshift_gcp_prefix + openshift_gcp_clusterid }},node-group={{ node_group.name }}"
else
echo "Instance template '{{ openshift_gcp_prefix }}instance-template-{{ node_group.name }}' already exists"
fi
@@ -312,8 +313,12 @@ fi
# wait until all node groups are stable
{% for node_group in openshift_gcp_node_group_config %}
+{% if node_group.bootstrap | default(False) %}
+# not waiting for {{ node_group.name }} due to bootstrapping
+{% else %}
# wait for stable {{ node_group.name }}
( gcloud --project "{{ openshift_gcp_project }}" compute instance-groups managed wait-until-stable "{{ openshift_gcp_prefix }}ig-{{ node_group.suffix }}" --zone "{{ openshift_gcp_zone }}" --timeout=600 ) &
+{% endif %}
{% endfor %}