Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Formatted all the code and added addons #12

Merged
merged 46 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
15a4816
feat-created file structure
Tanveer143s Dec 26, 2023
ed4fb42
feat-added Networking,GKE.Addons code
Tanveer143s Dec 27, 2023
5061cff
feat-created Network & GKE template and added addons
Tanveer143s Dec 27, 2023
fcf4083
feat- Created module for GKE
Tanveer143s Dec 28, 2023
76ccdee
feat- Create module for GKE addons
Tanveer143s Dec 28, 2023
9b17f0f
feat- added terraform module for cluster autoscaler
Tanveer143s Dec 28, 2023
0b7657e
feat- added ingress code
Tanveer143s Jan 2, 2024
541074b
feat: update version.tf
Tanveer143s Jan 2, 2024
45bd1d6
feat: Initial setup
AshutoshAM2002 Jan 10, 2024
39e4e1e
feat: modified cluster autoscaler
AshutoshAM2002 Jan 10, 2024
47bfb7a
feat: Removed unnessessary attributes
AshutoshAM2002 Jan 11, 2024
e6cfb6c
feat: Created module for Ingress-Nginx
Tanveer143s Jan 11, 2024
9903446
feat: remove unneccessary data from main.tf
Tanveer143s Jan 11, 2024
364a644
Merge pull request #6 from clouddrove/feat/ingress
AshutoshAM2002 Jan 11, 2024
7041000
feat: Added cert-manager addon
AshutoshAM2002 Jan 11, 2024
e90bd77
Merge pull request #9 from clouddrove/feat/cert-manager
AshutoshAM2002 Jan 11, 2024
8a53db2
feat: Modified as per review
AshutoshAM2002 Jan 12, 2024
5941db7
feat: Modified as per review
AshutoshAM2002 Jan 12, 2024
8d7b53b
feat: Modified as per review
AshutoshAM2002 Jan 15, 2024
48b54e8
Merge pull request #11 from clouddrove/feat/review_changes
AshutoshAM2002 Jan 15, 2024
bec41b7
feat: Modified as per review comments
AshutoshAM2002 Jan 18, 2024
06d8714
feat: Modified as per review comments
AshutoshAM2002 Jan 18, 2024
504e457
feat: Modified folder names
AshutoshAM2002 Jan 18, 2024
6ad3018
feat: Modified keda addon
AshutoshAM2002 Jan 18, 2024
ff9da57
Merge pull request #13 from clouddrove/feat/keda
AshutoshAM2002 Jan 18, 2024
12e62ea
feat: Added required workflows
AshutoshAM2002 Jan 19, 2024
f1e3e48
feat: Added tags and cluster version
AshutoshAM2002 Jan 19, 2024
8542c4c
feat: Added tags to cluster
AshutoshAM2002 Jan 19, 2024
203debb
feat: Resolved tfcheck
AshutoshAM2002 Jan 19, 2024
73c4df9
feat: Resolved tfcheck
AshutoshAM2002 Jan 19, 2024
98b5908
feat: Resolved warnings
AshutoshAM2002 Jan 19, 2024
9935671
feat: Resolved warnings
AshutoshAM2002 Jan 19, 2024
1b1fb18
feat: Resolved warnings
AshutoshAM2002 Jan 19, 2024
9027917
feat: Resolved warnings
AshutoshAM2002 Jan 19, 2024
627cdf1
feat: Resolved warnings
AshutoshAM2002 Jan 19, 2024
76ca81e
feat: Resolved warnings
AshutoshAM2002 Jan 19, 2024
ddefc59
feat: Resolved warnings
AshutoshAM2002 Jan 19, 2024
858588c
feat: Resolved warnings
AshutoshAM2002 Jan 19, 2024
e0b6a8c
feat: Resolved tfchecks
AshutoshAM2002 Jan 19, 2024
5887268
feat: Resolved tfchecks
AshutoshAM2002 Jan 19, 2024
2877279
feat: Resolved warnings
AshutoshAM2002 Jan 19, 2024
0edea67
feat: Resolved warnings
AshutoshAM2002 Jan 19, 2024
f26d737
feat: Modified readme.yaml
AshutoshAM2002 Jan 19, 2024
c5f4fd9
feat: Checking readme workflow
AshutoshAM2002 Jan 19, 2024
d0dd7b1
feat: Resolved readme github workflow
AshutoshAM2002 Jan 22, 2024
22d7c68
Testing readme
AshutoshAM2002 Jan 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions _examples/basic/locals.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
locals {
name = "helm-addons-test"
environment = "test"
region = "us-central1"
cluster_version = "1.28.3-gke.1203001"
gcp_project_id = "dev-env-3b53"
cluster_name = "test-cluster"
tags = {
Name = local.name
Environment = local.environment
GithubRepo = "terraform-helm-gke-addons"
GithubOrg = "clouddrove"
}
}
199 changes: 195 additions & 4 deletions _examples/basic/main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,195 @@
# ------------------------------------------------------------------------------
# Resources
# ------------------------------------------------------------------------------
locals {}

provider "google" {
project = local.gcp_project_id
}

###############################################################################
# GCP NETWORKING RESOURCES
###############################################################################


module "vpc" {
source = "terraform-google-modules/network/google"
version = "~> 8.1"

project_id = local.gcp_project_id
network_name = "${local.name}-vpc"
routing_mode = "GLOBAL"

subnets = [
{
subnet_name = "${local.name}-subnet-public-1"
subnet_ip = "10.10.10.0/24"
subnet_region = "us-central1"
},
{
subnet_name = "${local.name}-subnet-private-1"
subnet_ip = "10.10.20.0/24"
subnet_region = "us-central1"
subnet_private_access = "true"
subnet_flow_logs = "true"
description = "This subnet has a description"
},
{
subnet_name = "${local.name}-subnet-private-2"
subnet_ip = "10.10.30.0/24"
subnet_region = "us-central1"
subnet_private_access = "true"
subnet_flow_logs = "true"
description = "This subnet has used for GKE"
}
]

secondary_ranges = {
subnet-public-1 = [
{
range_name = "${local.name}-subnet-private-1-secondary-01"
ip_cidr_range = "192.168.64.0/24"
},
],
subnet-public-2 = [
{
range_name = "${local.name}-subnet-private-2-secondary-01"
ip_cidr_range = "192.168.128.0/24"
},
]
}

routes = [
{
name = "egress-internet"
description = "route through IGW to access internet"
destination_range = "0.0.0.0/0"
tags = "egress-inet"
next_hop_internet = "true"
},
]
}

###############################################################################
# GCP GKE
###############################################################################

module "gke" {
source = "terraform-google-modules/kubernetes-engine/google//modules/beta-private-cluster"
version = "29.0.0"
project_id = local.gcp_project_id
name = local.cluster_name
region = local.region
zones = []
network = module.vpc.network_name
subnetwork = "${local.name}-subnet-private-2"
ip_range_pods = ""
ip_range_services = ""
horizontal_pod_autoscaling = true
http_load_balancing = true
filestore_csi_driver = true
istio = true
create_service_account = true
remove_default_node_pool = true
disable_legacy_metadata_endpoints = false
deletion_protection = false

node_pools = [

{
name = "general"
machine_type = "g1-small"
node_locations = "${local.region}-a"
min_count = 1
max_count = 5
local_ssd_count = 0
spot = false
disk_size_gb = 10
disk_type = "pd-standard"
image_type = "ubuntu_containerd"
enable_gcfs = false
enable_gvnic = false
logging_variant = "DEFAULT"
auto_repair = true
auto_upgrade = true
create_service_account = true
preemptible = false
initial_node_count = 1
enable_node_pool_autoscaling = true
},
{
name = "critical"
machine_type = "g1-small"
node_locations = "${local.region}-b"
min_count = 1
max_count = 3
local_ssd_count = 0
spot = false
disk_size_gb = 10
disk_type = "pd-standard"
image_type = "ubuntu_containerd"
enable_gcfs = false
enable_gvnic = false
logging_variant = "DEFAULT"
auto_repair = true
auto_upgrade = true
create_service_account = true
preemptible = false
initial_node_count = 1
enable_node_pool_autoscaling = false
},
]


node_pools_labels = {
all = {}

default-node-pool = {
default-node-pool = true
}
}

node_pools_metadata = {
all = {}

default-node-pool = {
node-pool-metadata-custom-value = "my-node-pool"
}
}

node_pools_taints = {
all = []

default-node-pool = [
{
key = "default-node-pool"
value = true
effect = "PREFER_NO_SCHEDULE"
},
]
}

node_pools_tags = {
all = []

default-node-pool = [
"default-node-pool",
]
}
}


###############################################################################
# GCP ADDONS
###############################################################################

module "addons" {
source = "../../"

depends_on = [module.gke]
gke_cluster_name = module.gke.name
project_id = local.gcp_project_id
environment = "test"
region = local.region

cluster_autoscaler = true
reloader = true
ingress_nginx = true
certification_manager = true
}
25 changes: 25 additions & 0 deletions _examples/basic/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Retrieve an access token as the Terraform runner
data "google_client_config" "provider" {}

data "google_container_cluster" "my_cluster" {
name = module.gke.name
location = "us-central1"
}

provider "kubernetes" {
host = "https://${data.google_container_cluster.my_cluster.endpoint}"
token = data.google_client_config.provider.access_token
cluster_ca_certificate = base64decode(
data.google_container_cluster.my_cluster.master_auth[0].cluster_ca_certificate,
)
}

provider "helm" {
kubernetes {
host = "https://${data.google_container_cluster.my_cluster.endpoint}"
token = data.google_client_config.provider.access_token
cluster_ca_certificate = base64decode(
data.google_container_cluster.my_cluster.master_auth[0].cluster_ca_certificate
)
}
}
Empty file added _examples/basic/version.tf
Empty file.
7 changes: 7 additions & 0 deletions _examples/complete/locals.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
locals {
name = "dev-vpc"
cluster_name = "my-test-cluster"
region = "us-central1"
# secondary-range-name = "test"
project_id = "cloud-crew-404516"
}
Loading