From e3e391639cfc7d6b685a3dda1a2a3155f1cf817a Mon Sep 17 00:00:00 2001 From: JarredOlson Date: Wed, 11 Jul 2018 14:13:16 -0400 Subject: [PATCH] SMRT-216 Updating Jenkinsfile to deploy tiller and copy kube config for jupyterhub co-authored-by: Brandon Cromer --- Jenkinsfile | 11 ++++++++++- env/main_variables.tf | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3382da10..079cadc2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -41,6 +41,7 @@ node('master') { withCredentials([sshUserPrivateKey(credentialsId: "k8s-no-pass", keyFileVariable: 'keyfile')]) { sh("mkdir -p ~/.kube/") + sh("mkdir -p /var/jenkins_home/.kube") sh("echo '====> WAITING FOR KUBERNETES TO START... <===='") retry(24) { sleep(10) @@ -51,9 +52,17 @@ node('master') { sh("kubectl get nodes") } } + + stage('Deploy Tiller') { + dir('env') { + sh("kubectl --namespace kube-system create serviceaccount tiller") + sh("kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller") + } + } } } def copyKubeConfig(kubernetes_master_ip) { sh("""scp -o ConnectTimeout=30 -o StrictHostKeyChecking=no -i $keyfile centos@${kubernetes_master_ip}:~/kubeconfig ~/.kube/config""") -} \ No newline at end of file + sh("""scp -o ConnectTimeout=30 -o StrictHostKeyChecking=no -i $keyfile centos@${kubernetes_master_ip}:~/kubeconfig /var/jenkins_home/.kube/config""") +} diff --git a/env/main_variables.tf b/env/main_variables.tf index ee384572..da48e53d 100644 --- a/env/main_variables.tf +++ b/env/main_variables.tf @@ -72,7 +72,7 @@ variable "vpc_enable_dns_hostnames" { } variable "dns_zone_name" { - description = "Name of private DNS Route53 zone" + description = "Name of public and private DNS Route53 zone" } variable "kubernetes_cluster_name" {