You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by om...@apache.org on 2019/09/13 07:28:41 UTC

[incubator-dlab] branch DLAB-1086 updated: fixed issue with terminating;

This is an automated email from the ASF dual-hosted git repository.

omartushevskyi pushed a commit to branch DLAB-1086
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git


The following commit(s) were added to refs/heads/DLAB-1086 by this push:
     new 1bbcdc6  fixed issue with terminating;
1bbcdc6 is described below

commit 1bbcdc69205e7921f4cc07e753558d51e7aed764
Author: Oleh Martushevskyi <Ol...@epam.com>
AuthorDate: Fri Sep 13 10:28:32 2019 +0300

    fixed issue with terminating;
---
 .../terraform/gcp/ssn-gke/main/main.tf             | 26 ------------------
 .../gcp/ssn-gke/main/modules/gke/outputs.tf        | 20 --------------
 .../gcp/ssn-gke/main/modules/helm_charts/main.tf   | 32 ++++++++++++++++++++++
 .../ssn-gke/main/modules/helm_charts/variables.tf  | 10 -------
 4 files changed, 32 insertions(+), 56 deletions(-)

diff --git a/infrastructure-provisioning/terraform/gcp/ssn-gke/main/main.tf b/infrastructure-provisioning/terraform/gcp/ssn-gke/main/main.tf
index e193ea5..b05616f 100644
--- a/infrastructure-provisioning/terraform/gcp/ssn-gke/main/main.tf
+++ b/infrastructure-provisioning/terraform/gcp/ssn-gke/main/main.tf
@@ -26,27 +26,6 @@ provider "google" {
   zone        = var.zone
 }
 
-provider "helm" {
-
-  kubernetes {
-    host                   = module.gke_cluster.k8s_gke_endpoint
-    token                  = module.gke_cluster.k8s_gke_client_access_token
-    client_certificate     = base64decode(module.gke_cluster.k8s_gke_clinet_cert)
-    client_key             = base64decode(module.gke_cluster.k8s_gke_client_key)
-    cluster_ca_certificate = base64decode(module.gke_cluster.k8s_gke_cluster_ca)
-  }
-  install_tiller = true
-  service_account = "tiller"
-}
-
-provider "kubernetes" {
-  host = module.gke_cluster.k8s_gke_endpoint
-
-  client_certificate     = base64decode(module.gke_cluster.k8s_gke_clinet_cert)
-  client_key             = base64decode(module.gke_cluster.k8s_gke_client_key)
-  cluster_ca_certificate = base64decode(module.gke_cluster.k8s_gke_cluster_ca)
-}
-
 module "gke_cluster" {
   source = "./modules/gke"
   additional_tag = var.additional_tag
@@ -90,9 +69,4 @@ module "helm_charts" {
   mongo_node_port = var.mongo_node_port
   ssn_keystore_password = var.ssn_keystore_password
   endpoint_keystore_password = var.endpoint_keystore_password
-  k8s_gke_endpoint = module.gke_cluster.k8s_gke_endpoint
-  k8s_gke_clinet_cert = module.gke_cluster.k8s_gke_clinet_cert
-  k8s_gke_client_key = module.gke_cluster.k8s_gke_client_key
-  k8s_gke_cluster_ca = module.gke_cluster.k8s_gke_cluster_ca
-  access_token = module.gke_cluster.k8s_gke_client_access_token
 }
\ No newline at end of file
diff --git a/infrastructure-provisioning/terraform/gcp/ssn-gke/main/modules/gke/outputs.tf b/infrastructure-provisioning/terraform/gcp/ssn-gke/main/modules/gke/outputs.tf
index 7bcd372..c4a5e27 100644
--- a/infrastructure-provisioning/terraform/gcp/ssn-gke/main/modules/gke/outputs.tf
+++ b/infrastructure-provisioning/terraform/gcp/ssn-gke/main/modules/gke/outputs.tf
@@ -25,24 +25,4 @@ output "ssn_keystore_password" {
 
 output "endpoint_keystore_password" {
   value = random_string.endpoint_keystore_password.result
-}
-
-output "k8s_gke_endpoint" {
-  value = data.google_container_cluster.ssn_k8s_gke_cluster.endpoint
-}
-
-output "k8s_gke_client_access_token" {
-  value = data.google_client_config.current.access_token
-}
-
-output "k8s_gke_clinet_cert" {
-  value = google_container_cluster.ssn_k8s_gke_cluster.master_auth.0.client_certificate
-}
-
-output "k8s_gke_client_key" {
-  value = google_container_cluster.ssn_k8s_gke_cluster.master_auth.0.client_key
-}
-
-output "k8s_gke_cluster_ca" {
-  value = google_container_cluster.ssn_k8s_gke_cluster.master_auth.0.cluster_ca_certificate
 }
\ No newline at end of file
diff --git a/infrastructure-provisioning/terraform/gcp/ssn-gke/main/modules/helm_charts/main.tf b/infrastructure-provisioning/terraform/gcp/ssn-gke/main/modules/helm_charts/main.tf
index b23415b..56eef5e 100644
--- a/infrastructure-provisioning/terraform/gcp/ssn-gke/main/modules/helm_charts/main.tf
+++ b/infrastructure-provisioning/terraform/gcp/ssn-gke/main/modules/helm_charts/main.tf
@@ -19,6 +19,38 @@
 #
 # ******************************************************************************
 
+locals {
+  gke_name = "${var.service_base_name}-cluster"
+}
+
+data "google_container_cluster" "ssn_k8s_gke_cluster" {
+  name       = local.gke_name
+  location   = var.region
+}
+
+data "google_client_config" "current" {}
+
+provider "helm" {
+
+  kubernetes {
+    host                   = data.google_container_cluster.ssn_k8s_gke_cluster.endpoint
+    token                  = data.google_client_config.current.access_token
+    client_certificate     = data.google_container_cluster.ssn_k8s_gke_cluster.master_auth.0.client_certificate
+    client_key             = data.google_container_cluster.ssn_k8s_gke_cluster.master_auth.0.client_key
+    cluster_ca_certificate = data.google_container_cluster.ssn_k8s_gke_cluster.master_auth.0.cluster_ca_certificate
+  }
+  install_tiller = true
+  service_account = "tiller"
+}
+
+provider "kubernetes" {
+  host = data.google_container_cluster.ssn_k8s_gke_cluster.endpoint
+
+  client_certificate     = data.google_container_cluster.ssn_k8s_gke_cluster.master_auth.0.client_certificate
+  client_key             = data.google_container_cluster.ssn_k8s_gke_cluster.master_auth.0.client_key
+  cluster_ca_certificate = data.google_container_cluster.ssn_k8s_gke_cluster.master_auth.0.cluster_ca_certificate
+}
+
 resource "kubernetes_service_account" "example" {
   metadata {
     name = "tiller"
diff --git a/infrastructure-provisioning/terraform/gcp/ssn-gke/main/modules/helm_charts/variables.tf b/infrastructure-provisioning/terraform/gcp/ssn-gke/main/modules/helm_charts/variables.tf
index c532bf6..af89add 100644
--- a/infrastructure-provisioning/terraform/gcp/ssn-gke/main/modules/helm_charts/variables.tf
+++ b/infrastructure-provisioning/terraform/gcp/ssn-gke/main/modules/helm_charts/variables.tf
@@ -70,16 +70,6 @@ variable "mongo_node_port" {}
 variable "ssn_keystore_password" {}
 
 variable "endpoint_keystore_password" {}
-
-variable "k8s_gke_endpoint" {}
-
-variable "k8s_gke_clinet_cert" {}
-
-variable "k8s_gke_client_key" {}
-
-variable "k8s_gke_cluster_ca" {}
-
-variable "access_token" {}
 //variable "nginx_http_port" {
 //    default = "31080"
 //    description = "Sets the nodePort that maps to the Ingress' port 80"


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org