gruntwork-io / website-comments

This repository captures all comments written in the guides
Other
1 stars 8 forks source link

guides/kubernetes/deploying-a-dockerized-app-on-gcp-gke/ #4

Open utterances-bot opened 4 years ago

utterances-bot commented 4 years ago

Deploying a Dockerized app on GCP and GKE

Learn how to deploy a Dockerized app to a Kubernetes (GKE) cluster running on Google Cloud Platform (GCP).

https://gruntwork.io/guides/kubernetes/deploying-a-dockerized-app-on-gcp-gke/

golubitsky commented 4 years ago

First of all, thank you for putting this together! As a developer, I'm very excited about the premise of terraform.

I have followed the guide up to the terraform init command, at which point I get the following output:

$ terraform init
Initializing modules...

Initializing the backend...

Initializing provider plugins...
- Checking for available provider plugins...

Provider "google" v2.3.0 is not compatible with Terraform 0.12.8.

Provider version 2.5.0 is the earliest compatible version. Select it with
the following version constraint:

    version = "~> 2.5"

Terraform checked all of the plugin versions matching the given constraint:
    ~> 2.3.0

Consult the documentation for this provider for more information on
compatibility between provider and Terraform versions.

Provider "google-beta" v2.3.0 is not compatible with Terraform 0.12.8.

Provider version 2.5.0 is the earliest compatible version. Select it with
the following version constraint:

    version = "~> 2.5"

Terraform checked all of the plugin versions matching the given constraint:
    ~> 2.3.0

Consult the documentation for this provider for more information on
compatibility between provider and Terraform versions.

Error: incompatible provider version

Error: incompatible provider version

I briefly tried following the helpful suggestions in the output to change the versions for both the google and google-beta providers to "~> 2.5.0". While that does allow an exit code 0 terraform init command, we see different errors during terraform plan:

$ terraform plan

Error: Incorrect attribute value type

  on .terraform/modules/gke_cluster/modules/gke-cluster/main.tf line 51, in resource "google_container_cluster" "cluster":
  51:       disabled = "${var.http_load_balancing ? 0 : 1}"

Inappropriate value for attribute "disabled": bool required.

Error: Incorrect attribute value type

  on .terraform/modules/gke_cluster/modules/gke-cluster/main.tf line 55, in resource "google_container_cluster" "cluster":
  55:       disabled = "${var.horizontal_pod_autoscaling ? 0 : 1}"

Inappropriate value for attribute "disabled": bool required.

Error: Incorrect attribute value type

  on .terraform/modules/gke_cluster/modules/gke-cluster/main.tf line 59, in resource "google_container_cluster" "cluster":
  59:       disabled = "${var.enable_kubernetes_dashboard ? 0 : 1}"

Inappropriate value for attribute "disabled": bool required.

Error: Incorrect attribute value type

  on .terraform/modules/gke_cluster/modules/gke-cluster/main.tf line 63, in resource "google_container_cluster" "cluster":
  63:       disabled = "${var.enable_network_policy ? 0 : 1}"

Inappropriate value for attribute "disabled": bool required.

Error: Unsupported argument

  on .terraform/modules/gke_cluster/modules/gke-cluster/main.tf line 83, in resource "google_container_cluster" "cluster":
  83:   master_authorized_networks_config = "${var.master_authorized_networks_config}"

An argument named "master_authorized_networks_config" is not expected here.
Did you mean to define a block of type "master_authorized_networks_config"?

Would you recommend trying to make the existing main.tf compatible with the newer version of terraform? Or to downgrade terraform to another version? I'll try to dig in more later, but any help much appreciated!

Thank you, Mike

robmorgan commented 4 years ago

@golubitsky Yes, I originally wrote this guide for an earlier version of both Terraform and our GCP modules. I'll upgrade it to use the latest versions and hope to ship something this week.

robmorgan commented 4 years ago

Fixed in https://github.com/gruntwork-io/gruntwork-io.github.io/pull/221 [Preview URL]

cc @golubitsky

robmorgan commented 4 years ago

Deployed: https://gruntwork.io/guides/kubernetes/deploying-a-dockerized-app-on-gcp-gke/

arinzemomife commented 4 years ago

Hello Rbo- So far i followed these steps and everything worked good but not the terraform part of it. I encountered the following error: Error: Failed to download module

Could not download module "gke_service_account" (connections.tf:127) source code from "git::git@github.com:gruntwork-io/terraform-google-gke.git?ref=v0.3.8": error downloading 'ssh://git@github.com/gruntwork-io/terraform-google-gke.git?ref=v0.3.8': git must be available and on the PATH

please I need some help here

jahangirali555 commented 2 years ago

I have the same issue as @arinemomife mentioned