From ee4746c74b520a588a6269f30a1dce6c8240fa4d Mon Sep 17 00:00:00 2001 From: crusader Date: Fri, 3 Feb 2023 15:02:51 +0000 Subject: [PATCH] environment test --- Jenkinsfile | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8eca6f9..d48c703 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -95,14 +95,18 @@ podTemplate( stage('Deploy Application on K8s') { container('kubectl') { - withKubeConfig([ - credentialsId: 'jenkins-admin-secret', - serverUrl: 'https://192.168.50.10:16443', - contextName: 'microk8s', - clusterName: 'microk8s-cluster']) { - sh 'kubectl config view' + withKubeCredentials(kubectlCredentials: [[ + caCertificate: '', + clusterName: 'microk8s', + contextName: '', + credentialsId: 'jenkins-admin-secret', + namespace: 'kube-system', + serverUrl: 'https://192.168.50.10:16443']]) { + + kubectl config view } + } - } + } } }