-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7154b30
commit db446fd
Showing
10 changed files
with
136 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# airy.co GKS terraform installation source | ||
|
||
### Title | ||
|
||
The current referenced project link is ; | ||
|
||
|
||
https://github.com/hashicorp/learn-terraform-provision-gke-cluster | ||
|
||
``` | ||
$ some code | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module "gcp-gke" { | ||
#source = "github.com/airyhq/airy.git/infrastructure/terraform/modules/gcp-gke" | ||
source = "/Users/bilge/Documents/AiryProjects/airy/infrastructure/terraform/modules/gcp-gke" | ||
|
||
|
||
project_id = var.project_id | ||
region = var.region | ||
|
||
|
||
#kubeconfig_output_path = "../kube.conf" | ||
} |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
variable "project_id" { | ||
description = "The project is airy-core-gke" | ||
} | ||
|
||
variable "region" { | ||
description = "The region is us-central1" | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
provider "google" { | ||
project = var.project_id | ||
region = var.region | ||
} | ||
|
||
# VPC | ||
resource "google_compute_network" "vpc" { | ||
name = "${var.project_id}-vpc" | ||
auto_create_subnetworks = "false" | ||
} | ||
|
||
# Subnet | ||
resource "google_compute_subnetwork" "subnet" { | ||
name = "${var.project_id}-subnet" | ||
region = var.region | ||
network = google_compute_network.vpc.name | ||
ip_cidr_range = "10.10.0.0/24" | ||
} | ||
|
||
|
||
# GKE cluster | ||
resource "google_container_cluster" "primary" { | ||
name = "${var.project_id}-gke" | ||
location = var.region | ||
|
||
# We can't create a cluster with no node pool defined, but we want to only use | ||
# separately managed node pools. So we create the smallest possible default | ||
# node pool and immediately delete it. | ||
remove_default_node_pool = true | ||
initial_node_count = 1 | ||
|
||
network = google_compute_network.vpc.name | ||
subnetwork = google_compute_subnetwork.subnet.name | ||
} | ||
|
||
# Separately Managed Node Pool | ||
resource "google_container_node_pool" "primary_nodes" { | ||
name = "${google_container_cluster.primary.name}-node-pool" | ||
location = var.region | ||
cluster = google_container_cluster.primary.name | ||
node_count = var.gke_num_nodes | ||
|
||
node_config { | ||
oauth_scopes = [ | ||
"https://www.googleapis.com/auth/logging.write", | ||
"https://www.googleapis.com/auth/monitoring", | ||
] | ||
|
||
labels = { | ||
env = var.project_id | ||
} | ||
|
||
# preemptible = true | ||
machine_type = "n1-standard-1" | ||
tags = ["gke-node", "${var.project_id}-gke"] | ||
metadata = { | ||
disable-legacy-endpoints = "true" | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
output "kubernetes_endpoint" { | ||
sensitive = true | ||
value = module.gke_auth.host | ||
} | ||
|
||
output "client_token" { | ||
sensitive = true | ||
value = module.gke_auth.token | ||
} | ||
|
||
output "ca_certificate" { | ||
value = module.gke_auth.cluster_ca_certificate | ||
} | ||
|
||
output "kubeconfig_raw" { | ||
value = module.gke_auth.kubeconfig_raw | ||
} | ||
|
||
output "service_account" { | ||
description = "The default service account used for running nodes." | ||
value = module.gke.service_account | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
variable "project_id" { | ||
description = "The project is airy-core-gke" | ||
} | ||
|
||
variable "region" { | ||
description = "The region is us-central1" | ||
} | ||
|
||
variable "gke_username" { | ||
default = "" | ||
description = "gke username" | ||
} | ||
|
||
variable "gke_password" { | ||
default = "" | ||
description = "gke password" | ||
} | ||
|
||
variable "gke_num_nodes" { | ||
default = 2 | ||
description = "number of gke nodes" | ||
} |