pforsthoff
pforsthoff

Reputation: 532

Azure Devops install helm chart to local kubernetes cluster in pipeline

Is it possible to create a task in an azure devops pipeline to install a helm chart to a local kubernetes cluster?

I have been able to package the chart in the pipeline using...

        helm package ./<projectname>/yaml/helm/sample-app

I would imagine something similar to this would work (this does not work currently)

- task: HelmDeploy@0
            inputs:
              connectionType: 'Kubernetes Service Connection'
              kubernetesServiceConnection: 'myk8sserviceconnection'
              namespace: 'staging'
              command: 'upgrade'
              chartType: 'FilePath'
              chartPath: $(Build.ArtifactStagingDirectory)/sample-app

When I try this it warns that I'm missing properties...

enter image description here

Azure devops is deployed locally v2020 update 1.1

I dont want to deploy to azure or use an azure container registry, I just want to take the helm chart in the repo, package it and install it in my cluster.

I have access to my kubernetes cluster using a service connection in devops, I am able to deploy to kubernetes using @KubernetesManifest@0 task.

*** UPDATE see answer below ***

Upvotes: 1

Views: 2489

Answers (1)

pforsthoff
pforsthoff

Reputation: 532

Thanks for the suggestion, these values are not required. Here is my final pipeline stage that's working well:

- task: HelmDeploy@0
      inputs:
        connectionType: 'Kubernetes Service Connection'
        kubernetesServiceConnection: 'myk8sserviceconnection'
        namespace: 'staging'
        command: 'upgrade'
        chartType: FilePath
        chartPath: ./sample-app/yaml/helm/sample-app
        releaseName: sample-app
        install: true
        waitForExecution: false

Upvotes: 1

Related Questions