Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Gitlab Terraform Gke
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ronick Romulus
Gitlab Terraform Gke
Commits
fb6c31bf
Commit
fb6c31bf
authored
4 years ago
by
Viktor Nagy
Browse files
Options
Downloads
Patches
Plain Diff
Move variables to variables.tf
parent
792de803
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
gke.tf
+7
-11
7 additions, 11 deletions
gke.tf
outpus.tf
+3
-0
3 additions, 0 deletions
outpus.tf
variables.tf
+29
-0
29 additions, 0 deletions
variables.tf
with
39 additions
and
11 deletions
gke.tf
+
7
−
11
View file @
fb6c31bf
// Configure the Google Cloud resources
provider
"google"
{
project
=
"gcp-project"
// Override to use your GCP project
region
=
"us-central1"
// Override to use your preferred regtion
zone
=
"us-central1-c"
// Override to use your preferred zone
project
=
var
.
gcp_project
}
resource
"google_container_cluster"
"primary"
{
name
=
"iac-demo-gke"
// Override to your preferred cluster name
name
=
var
.
cluster_name
location
=
var
.
gcp_region
remove_default_node_pool
=
true
initial_node_count
=
1
min_master_version
=
"1.19"
description
=
var
.
description
}
resource
"google_container_node_pool"
"primary_preemptible_nodes"
{
name
=
"
my-
node-pool"
name
=
"
${
var
.
cluster-name
}
-
node-pool"
cluster
=
google_container_cluster
.
primary
.
name
location
=
var
.
gcp_region
node_count
=
3
node_config
{
preemptible
=
true
machine_type
=
"n1-standard-4"
machine_type
=
var
.
machine_type
metadata
=
{
disable-legacy-endpoints
=
"true"
...
...
@@ -31,7 +31,3 @@ resource "google_container_node_pool" "primary_preemptible_nodes" {
]
}
}
output
"env-dynamic-url"
{
value
=
"https://
${
google_container_cluster
.
primary
.
endpoint
}
"
}
This diff is collapsed.
Click to expand it.
outpus.tf
0 → 100644
+
3
−
0
View file @
fb6c31bf
output
"env-dynamic-url"
{
value
=
"https://
${
google_container_cluster
.
primary
.
endpoint
}
"
}
This diff is collapsed.
Click to expand it.
variables.tf
0 → 100644
+
29
−
0
View file @
fb6c31bf
variable
"gcp_project"
{
type
=
string
default
=
"gcp-project"
description
=
"The name of the Google Cloud Project where the cluster is to be provisioned"
}
variable
"gcp_region"
{
type
=
string
default
=
"us-central1"
description
=
"The name of the Google region where the cluster nodes are to be provisioned"
}
variable
"cluster_name"
{
type
=
string
default
=
"GitLab group level cluster"
description
=
"The name of the cluster to appear on the Google Cloud Console"
}
variable
"machine_type"
{
type
=
string
default
=
"n1-standard-4"
description
=
"The name of the machine type to use for the cluster nodes"
}
variable
"cluster_description"
{
type
=
string
default
=
"This cluster is defined in GitLab"
description
=
"A description for the cluster. We recommend adding the
\$
CI_PROJECT_URL variable to describe where the cluster is configured."
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment