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 } + } - } + } } }