Skip to content

Commit

Permalink
SMRT-216 Updating Jenkinsfile to deploy tiller and copy kube config f…
Browse files Browse the repository at this point in the history
…or jupyterhub

co-authored-by: Brandon Cromer <[email protected]>
  • Loading branch information
JarredOlson and Brandon Cromer committed Jul 11, 2018
1 parent 6e931cb commit e3e3916
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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""")
}
sh("""scp -o ConnectTimeout=30 -o StrictHostKeyChecking=no -i $keyfile centos@${kubernetes_master_ip}:~/kubeconfig /var/jenkins_home/.kube/config""")
}
2 changes: 1 addition & 1 deletion env/main_variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down

0 comments on commit e3e3916

Please sign in to comment.