Commit b7666dd0 authored by Reb's avatar Reb 🥓 Committed by DJ Mountney

Added the "gcloud create" "--network" flag to GKE cluster creation

to optionally select the network space to be used within the cluster.
Updated the documentation to add the new configuration parameter, INT_NETWORK
parent 5345dade
---
title: Add ability to specify network to use when creating a GKE cluster
merge_request: 799
author:
type: added
......@@ -42,7 +42,7 @@ The table below describes all variables.
| Variable | Description | Default value |
|-----------------|-----------------------------------------------------------------------------|----------------------------------|
| REGION | The region where your cluster lives | us-central1 |
| ZONE | The zone where your cluster instances lives | us-central1-a |
| ZONE | The zone where your cluster instances lives | us-central1-a |
| CLUSTER_NAME | The name of the cluster | gitlab-cluster |
| CLUSTER_VERSION | The version of your GKE cluster | GKE default, check the [GKE release notes](https://cloud.google.com/kubernetes-engine/release-notes) |
| MACHINE_TYPE | The cluster instances' type | n1-standard-4 |
......@@ -51,6 +51,7 @@ The table below describes all variables.
| RBAC_ENABLED | If you know whether your cluster has RBAC enabled set this variable. | true |
| PREEMPTIBLE | Cheaper, clusters live at *most* 24 hrs. No SLA on nodes/disks | false |
| USE_STATIC_IP | Create a static IP for Gitlab instead of an ephemeral IP with managed DNS | false |
| INT_NETWORK | The IP space to use within this cluster | default |
Run the script, by passing in your desired parameters. It can work with the
default parameters except for `PROJECT` which is required:
......
......@@ -12,6 +12,7 @@ CLUSTER_NAME=${CLUSTER_NAME-gitlab-cluster}
MACHINE_TYPE=${MACHINE_TYPE-n1-standard-4}
RBAC_ENABLED=${RBAC_ENABLED-true}
NUM_NODES=${NUM_NODES-2}
INT_NETWORK=${INT_NETWORK-default}
PREEMPTIBLE=${PREEMPTIBLE-false}
EXTRA_CREATE_ARGS=${EXTRA_CREATE_ARGS-""}
USE_STATIC_IP=${USE_STATIC_IP-false};
......@@ -45,6 +46,7 @@ function bootstrap(){
--scopes "https://www.googleapis.com/auth/ndev.clouddns.readwrite","https://www.googleapis.com/auth/compute","https://www.googleapis.com/auth/devstorage.read_only","https://www.googleapis.com/auth/logging.write","https://www.googleapis.com/auth/monitoring","https://www.googleapis.com/auth/servicecontrol","https://www.googleapis.com/auth/service.management.readonly","https://www.googleapis.com/auth/trace.append" \
--node-version $CLUSTER_VERSION --num-nodes $NUM_NODES \
--enable-ip-alias \
--network $INT_NETWORK \
--project $PROJECT --enable-basic-auth $EXTRA_CREATE_ARGS;
if ${USE_STATIC_IP}; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment