Skip to content

Commit

Permalink
Remove working directory as it can't be found
Browse files Browse the repository at this point in the history
  • Loading branch information
MennaTullahTaha committed Mar 11, 2024
1 parent 28e5b35 commit 0985eb0
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 14 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,18 @@ jobs:
# Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc.
- name: Terraform Init
run: terraform init
working-directory: Terraform

# formats the file
- name: Terraform Format
run: terraform fmt
working-directory: Terraform

# Generates an execution plan for Terraform
- name: Terraform Plan
run: terraform plan -var 'gcp_credentials=${{ secrets.GCP_SA_KEY }}' -var 'gke_cluster_name=${{ github.event.inputs.clusterName }}" -var 'gcp_region=${{ github.event.inputs.gkeRegion }}'
working-directory: Terraform
run: terraform plan -var 'gcp_credentials=${{ secrets.GCP_SA_KEY }}' -var 'gke_cluster_name=${{ github.event.inputs.clusterName }}' -var 'gcp_region=${{ github.event.inputs.gkeRegion }}'

# Apply terraform
- name: Terraform Apply
run: terraform apply -auto-approve
working-directory: Terraform
run: terraform apply -var 'gcp_credentials=${{ secrets.GCP_SA_KEY }}' -var 'gke_cluster_name=${{ github.event.inputs.clusterName }}' -var 'gcp_region=${{ github.event.inputs.gkeRegion }}' -auto-approve

destroy_cluster:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -90,14 +86,11 @@ jobs:
# Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc.
- name: Terraform Init
run: terraform init
working-directory: Terraform

# formats the file
- name: Terraform Format
run: terraform fmt
working-directory: Terraform

# Destroy cluster
- name: Terraform Destroy
run: terraform destroy -var 'gcp_credentials=${{ secrets.GCP_SA_KEY }}' -var 'gke_cluster_name=${{ github.event.inputs.clusterName }}" -var 'gcp_region=${{ github.event.inputs.gkeRegion }}' -auto-approve
working-directory: Terraform
run: terraform destroy -var 'gcp_credentials=${{ secrets.GCP_SA_KEY }}' -var 'gke_cluster_name=${{ github.event.inputs.clusterName }}' -var 'gcp_region=${{ github.event.inputs.gkeRegion }}' -auto-approve
8 changes: 4 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ module "gke" {
network_policy = false
horizontal_pod_autoscaling = true
filestore_csi_driver = false
ip_range_services = "europe-west1-01-gke-01-services"
ip_range_pods = "europe-west1-01-gke-01-pods"
ip_range_services = "default"
ip_range_pods = "default"
node_pools = [
{
name = var.gke_default_nodepools_name
machine_type = "e2-medium"
machine_type = "e2-micro"
min_count = 1
max_count = 3
local_ssd_count = 0
spot = false
disk_size_gb = 100
disk_size_gb = 30
disk_type = "pd-standard"
image_type = "COS_CONTAINERD"
enable_gcfs = false
Expand Down
41 changes: 41 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
output "kubernetes_endpoint" {
description = "The cluster endpoint"
sensitive = true
value = module.gke.endpoint
}

output "client_token" {
description = "The bearer token for auth"
sensitive = true
value = base64encode(data.google_client_config.default.access_token)
}

output "ca_certificate" {
description = "The cluster ca certificate (base64 encoded)"
value = module.gke.ca_certificate
}

output "service_account" {
description = "The default service account used for running nodes."
value = module.gke.service_account
}

output "cluster_name" {
description = "Cluster name"
value = module.gke.name
}

output "network_name" {
description = "The name of the VPC being created"
value = module.gcp-network.network_name
}

output "subnet_name" {
description = "The name of the subnet being created"
value = module.gcp-network.subnets_names
}

output "subnet_secondary_ranges" {
description = "The secondary ranges associated with the subnet"
value = module.gcp-network.subnets_secondary_ranges
}

0 comments on commit 0985eb0

Please sign in to comment.