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/07/17 09:23:34 UTC

[incubator-dlab] branch DLAB-terraform updated: refactored helm charts

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

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


The following commit(s) were added to refs/heads/DLAB-terraform by this push:
     new 4be0381  refactored helm charts
4be0381 is described below

commit 4be038160b72ac3e5fecc0116daa5157f1ce22db
Author: Oleh Martushevskyi <Ol...@epam.com>
AuthorDate: Wed Jul 17 12:23:26 2019 +0300

    refactored helm charts
---
 .../terraform/aws/ssn-helm-charts/main/dlab-ui.tf  |   1 +
 .../main/files/keycloak_values.yaml                |  25 +++++
 .../ssn-helm-charts/main/files/mongo_values.yaml   |  13 +++
 .../ssn-helm-charts/main/files/mysql_values.yaml   |   4 +
 .../ssn-helm-charts/main/files/nginx_values.yaml   |   6 ++
 .../aws/ssn-helm-charts/main/ingress.yaml          |  35 -------
 .../terraform/aws/ssn-helm-charts/main/keycloak.tf | 102 +++++++++++----------
 .../terraform/aws/ssn-helm-charts/main/main.tf     |   4 +
 .../terraform/aws/ssn-helm-charts/main/mongo.tf    |  73 ++++++++-------
 .../terraform/aws/ssn-helm-charts/main/mysql.tf    |  42 +++++----
 .../terraform/aws/ssn-helm-charts/main/nginx.tf    |  31 ++++---
 .../aws/ssn-helm-charts/main/variables.tf          |  56 +++++------
 12 files changed, 214 insertions(+), 178 deletions(-)

diff --git a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/dlab-ui.tf b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/dlab-ui.tf
index fd818e8..3431a90 100644
--- a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/dlab-ui.tf
+++ b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/dlab-ui.tf
@@ -23,4 +23,5 @@ resource "helm_release" "dlab-ui" {
     name      = "dlab-ui"
     chart     = "./dlab-ui-chart"
     depends_on = [helm_release.mongodb]
+    wait = true
 }
diff --git a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/files/keycloak_values.yaml b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/files/keycloak_values.yaml
new file mode 100644
index 0000000..c41b1a1
--- /dev/null
+++ b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/files/keycloak_values.yaml
@@ -0,0 +1,25 @@
+keycloak:
+  username: dlab-admin
+  password: 12345o
+
+  persistence:
+    dbVendor: mysql
+    dbName: keycloak
+    dbHost: keycloak-mysql
+    dbPort: 3306
+    dbUser: keycloak
+    dbPassword: 1234567890o
+
+  service:
+    type: NodePort
+    nodePort: 31088
+
+  ingress:
+    enabled: true
+    annotations:
+      kubernetes.io/ingress.class: nginx
+      nginx.ingress.kubernetes.io/ssl-redirect: "false"
+      nginx.ingress.kubernetes.io/rewrite-target: /keycloak
+    path: /keycloak
+    hosts:
+      - "*"
\ No newline at end of file
diff --git a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/files/mongo_values.yaml b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/files/mongo_values.yaml
new file mode 100644
index 0000000..59052a3
--- /dev/null
+++ b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/files/mongo_values.yaml
@@ -0,0 +1,13 @@
+replicaSet:
+  enabled: true
+
+mongodbRootPassword: $tr0ng_r00T-passworI)
+mongodbUsername: admin
+mongodbPassword: $tr0ng_N0N=r00T-passworI)
+mongodbDatabase: dlabdb
+
+image:
+  tag: 4.0.10-debian-9-r13
+
+persistence:
+  enabled: false
\ No newline at end of file
diff --git a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/files/mysql_values.yaml b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/files/mysql_values.yaml
new file mode 100644
index 0000000..a061895
--- /dev/null
+++ b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/files/mysql_values.yaml
@@ -0,0 +1,4 @@
+mysqlRootPassword: 1234567890o
+mysqlUser: keycloak
+mysqlPassword: 1234567890o
+mysqlDatabase: keycloak
\ No newline at end of file
diff --git a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/files/nginx_values.yaml b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/files/nginx_values.yaml
new file mode 100644
index 0000000..39805e1
--- /dev/null
+++ b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/files/nginx_values.yaml
@@ -0,0 +1,6 @@
+controller:
+  service:
+    nodePorts:
+      http: 31080
+      https: 31443
+    type: NodePort
\ No newline at end of file
diff --git a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/ingress.yaml b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/ingress.yaml
deleted file mode 100644
index 3d6bb35..0000000
--- a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/ingress.yaml
+++ /dev/null
@@ -1,35 +0,0 @@
-# *****************************************************************************
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-# ******************************************************************************
-
-apiVersion: extensions/v1beta1
-kind: Ingress
-metadata:
-  name: ingress-keycloak
-  #annotations:
-  #  ingress.kubernetes.io/rewrite-target: /
-spec:
-  rules:
-  - http:
-      paths:
-        - path: /keycloak
-          backend:
-            serviceName: keycloak
-            servicePort: 31088
\ No newline at end of file
diff --git a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/keycloak.tf b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/keycloak.tf
index ada495a..91a056c 100644
--- a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/keycloak.tf
+++ b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/keycloak.tf
@@ -22,56 +22,60 @@
 resource "helm_release" "keycloak" {
   name = "keycloak"
   chart = "stable/keycloak"
-  wait = false
+  wait = true
 
-  set {
-    name = "keycloak.username"
-    value = "dlab-admin"
-  }
+  values = [
+    file("files/keycloak_values.yaml")
+  ]
 
-  set {
-    name = "keycloak.password"
-    value = "12345o"
-  }
-
-  set {
-    name = "keycloak.persistence.dbVendor"
-    value = "mysql"
-  }
-
-  set {
-    name = "keycloak.persistence.dbName"
-    value = "keycloak"
-  }
-
-  set {
-    name = "keycloak.persistence.dbHost"
-    value = "keycloak-mysql"
-  }
-
-  set {
-    name = "keycloak.persistence.dbPort"
-    value = "3306"
-  }
-
-  set {
-    name = "keycloak.persistence.dbUser"
-    value = "keycloak"
-  }
-
- set {
-    name = "keycloak.persistence.dbPassword"
-    value = "1234567890o"
-  }
-
-  set {
-    name = "keycloak.service.type"
-    value = "NodePort"
-  }
-
-  set {
-    name = "keycloak.service.nodePort"
-    value = "31088"
-  }
+//  set {
+//    name = "keycloak.username"
+//    value = "dlab-admin"
+//  }
+//
+//  set {
+//    name = "keycloak.password"
+//    value = "12345o"
+//  }
+//
+//  set {
+//    name = "keycloak.persistence.dbVendor"
+//    value = "mysql"
+//  }
+//
+//  set {
+//    name = "keycloak.persistence.dbName"
+//    value = "keycloak"
+//  }
+//
+//  set {
+//    name = "keycloak.persistence.dbHost"
+//    value = "keycloak-mysql"
+//  }
+//
+//  set {
+//    name = "keycloak.persistence.dbPort"
+//    value = "3306"
+//  }
+//
+//  set {
+//    name = "keycloak.persistence.dbUser"
+//    value = "keycloak"
+//  }
+//
+// set {
+//    name = "keycloak.persistence.dbPassword"
+//    value = "1234567890o"
+//  }
+//
+//  set {
+//    name = "keycloak.service.type"
+//    value = "NodePort"
+//  }
+//
+//  set {
+//    name = "keycloak.service.nodePort"
+//    value = "31088"
+//  }
   depends_on = [helm_release.keycloak-mysql]
 }
\ No newline at end of file
diff --git a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/main.tf b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/main.tf
index aa9282f..a6691b3 100644
--- a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/main.tf
+++ b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/main.tf
@@ -23,4 +23,8 @@ provider "helm" {
     namespace       = "kube-system"
     service_account = "tiller"
     tiller_image    = "gcr.io/kubernetes-helm/tiller:v2.14.1"
+}
+
+output "mongo_dlabdb_password" {
+    value = var.mongo_db_pwd
 }
\ No newline at end of file
diff --git a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/mongo.tf b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/mongo.tf
index ec9b400..735dace 100644
--- a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/mongo.tf
+++ b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/mongo.tf
@@ -20,41 +20,46 @@
 # ******************************************************************************
 
 resource "helm_release" "mongodb" {
-    name      = "mongo-ha"
-    chart     = "stable/mongodb"
+    name  = "mongo-ha"
+    chart = "stable/mongodb"
+    wait = true
 
-    set {
-        name  = "replicaSet.enabled"
-        value = "true"
-    }
+    values = [
+        file("files/mongo_values.yaml")
+    ]
 
-    set {
-        name = "mongodbRootPassword"
-        value = "${var.mongo_root_pwd}"
-    }
-
-    set {
-        name = "mongodbUsername"
-        value = "${var.mongo_db_username}"
-    }
-
-    set {
-        name = "mongodbPassword"
-        value = "${var.mongo_db_pwd}"
-    }
-
-    set {
-        name = "mongodbDatabase"
-        value = "${var.mongo_dbname}"
-    }
-    set {
-        name = "image.tag"
-        value = "${var.image_tag}"
-    }
-    set {
-        # temporary. PV should be implemented
-        name = "persistence.enabled"
-        value = "false"
-    }
+//    set {
+//        name  = "replicaSet.enabled"
+//        value = "true"
+//    }
+//
+//    set {
+//        name = "mongodbRootPassword"
+//        value = "${var.mongo_root_pwd}"
+//    }
+//
+//    set {
+//        name = "mongodbUsername"
+//        value = "${var.mongo_db_username}"
+//    }
+//
+//    set {
+//        name = "mongodbPassword"
+//        value = "${var.mongo_db_pwd}"
+//    }
+//
+//    set {
+//        name = "mongodbDatabase"
+//        value = "${var.mongo_dbname}"
+//    }
+//    set {
+//        name = "image.tag"
+//        value = "${var.image_tag}"
+//    }
+//    set {
+//        # temporary. PV should be implemented
+//        name = "persistence.enabled"
+//        value = "false"
+//    }
     depends_on = [helm_release.nginx]
 }
diff --git a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/mysql.tf b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/mysql.tf
index b0c84a7..a352cc3 100644
--- a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/mysql.tf
+++ b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/mysql.tf
@@ -22,27 +22,31 @@
 resource "helm_release" "keycloak-mysql" {
   name = "keycloak-mysql"
   chart = "stable/mysql"
-  wait = false
+  wait = true
 
-  set {
-    name = "mysqlRootPassword"
-    value = "1234567890o"
-  }
-
-  set {
-    name = "mysqlUser"
-    value = "keycloak"
-  }
+  values = [
+    file("files/mysql_values.yaml")
+  ]
 
-  set {
-    name = "mysqlPassword"
-    value = "1234567890o"
-  }
-
-  set {
-    name = "mysqlDatabase"
-    value = "keycloak"
-  }
+//  set {
+//    name = "mysqlRootPassword"
+//    value = "1234567890o"
+//  }
+//
+//  set {
+//    name = "mysqlUser"
+//    value = "keycloak"
+//  }
+//
+//  set {
+//    name = "mysqlPassword"
+//    value = "1234567890o"
+//  }
+//
+//  set {
+//    name = "mysqlDatabase"
+//    value = "keycloak"
+//  }
 
   set {
     name = "persistence.existingClaim"
diff --git a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/nginx.tf b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/nginx.tf
index 9b51e84..59cd32b 100644
--- a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/nginx.tf
+++ b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/nginx.tf
@@ -22,20 +22,25 @@
 resource "helm_release" "nginx" {
     name      = "nginx-ingress"
     chart     = "stable/nginx-ingress"
+    wait = true
 
-    set {
-        name = "controller.service.nodePorts.http"
-        value = "${var.nginx_http_port}"
-    }
+    values = [
+        file("files/nginx_values.yaml")
+    ]
 
-    set {
-        name = "controller.service.nodePorts.https"
-        value = "${var.nginx_https_port}"
-    }
-
-    set {
-        name = "controller.service.type"
-        value = "NodePort"
-    }
+//    set {
+//        name = "controller.service.nodePorts.http"
+//        value = "${var.nginx_http_port}"
+//    }
+//
+//    set {
+//        name = "controller.service.nodePorts.https"
+//        value = "${var.nginx_https_port}"
+//    }
+//
+//    set {
+//        name = "controller.service.type"
+//        value = "NodePort"
+//    }
 
 }
diff --git a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/variables.tf b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/variables.tf
index 1837993..ab78b47 100644
--- a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/variables.tf
+++ b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/variables.tf
@@ -18,32 +18,32 @@
 # under the License.
 #
 # ******************************************************************************
-variable "nginx_http_port" {
-    default = "31080"
-    description = "Sets the nodePort that maps to the Ingress' port 80"
-}
-variable "nginx_https_port" {
-    default = "31443"
-    description = "Sets the nodePort that maps to the Ingress' port 443"
-}
+//variable "nginx_http_port" {
+//    default = "31080"
+//    description = "Sets the nodePort that maps to the Ingress' port 80"
+//}
+//variable "nginx_https_port" {
+//    default = "31443"
+//    description = "Sets the nodePort that maps to the Ingress' port 443"
+//}
 
-variable "mongo_root_pwd" {
-    default = "$tr0ng_r00T-passworI)"
-    description = "Password for MongoDB root user"
-}
-variable "mongo_db_username" {
-    default = "admin"
-    description = "Password for MongoDB root user"
-}
-variable "mongo_db_pwd" {
-    default = "$tr0ng_N0N=r00T-passworI)"
-    description = "Password for MongoDB root user"
-}
-variable "mongo_dbname" {
-    default = "dlabdb"
-    description = "Password for MongoDB root user"
-}
-variable "image_tag" {
-    default = "4.0.10-debian-9-r13"
-    description = "MongoDB Image tag"
-}
\ No newline at end of file
+//variable "mongo_root_pwd" {
+//    default = "$tr0ng_r00T-passworI)"
+//    description = "Password for MongoDB root user"
+//}
+//variable "mongo_db_username" {
+//    default = "admin"
+//    description = "Password for MongoDB root user"
+//}
+//variable "mongo_db_pwd" {
+//    default = "$tr0ng_N0N=r00T-passworI)"
+//    description = "Password for MongoDB root user"
+//}
+//variable "mongo_dbname" {
+//    default = "dlabdb"
+//    description = "Password for MongoDB root user"
+//}
+//variable "image_tag" {
+//    default = "4.0.10-debian-9-r13"
+//    description = "MongoDB Image tag"
+//}
\ No newline at end of file


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