Search code examples
kubernetesjenkinsjenkins-plugins

Deploy helm chart from remote repository


Is it possible to run a deployment job that downloads helm chart from bitbucket repository and applies the helm chart into kubernetes:

pipeline {
    agent  any
    stages {
        stage('test') {
            steps {
    
                 script {
                    withKubeConfig([credentialsId: 'my_kubeconfig']) {
                        sh '''
                        helm upgrade --install // download and install helm chart here                           
             
                        '''
                    }
                 }
                
            }
        }
    } //
}

If possible I want first to download the helm chart from bitbucket repository and then using kubernetes service account to apply the chart.


Solution

  • Yes you are right first need to clone the Helm template repo build the files

    You can review this file although i am not using Helm but mostly steps are similar might need to do last step tweaks : https://github.com/harsh4870/node-js-aws-codebuild-basic-ci-cd/blob/main/Jenkinsfile