3

How to deploy on K8 via Pulumi using the ArgoCD Helm Chart?

Pulumi up Diagnostics:

  kubernetes:helm.sh/v3:Release (argocd):
    error: failed to create chart from template: chart requires kubeVersion: >=1.22.0-0 which is incompatible with Kubernetes v1.20.0

THE CLUSTER VERSION IS: v1.23.0 verified on AWS. And NOT 1.20.0

ArgoCD install yaml used with CRD2Pulumi: https://raw.githubusercontent.com/argoproj/argo-cd/master/manifests/core-install.yaml

Source:

...

cluster = eks.Cluster("argo-example") # version="1.23"

# Cluster provider
provider = k8s.Provider(
    "eks",
    kubeconfig=cluster.kubeconfig.apply(lambda k: json.dumps(k))
    #kubeconfig=cluster.kubeconfig
)

ns = k8s.core.v1.Namespace(
    'argocd',
    metadata={
        "name": "argocd", 
    },

    opts=pulumi.ResourceOptions( 
        provider=provider
    )
)

argo = k8s.helm.v3.Release(
    "argocd",  
    args=k8s.helm.v3.ReleaseArgs(
        chart="argo-cd",
        namespace=ns.metadata.name,
        repository_opts=k8s.helm.v3.RepositoryOptsArgs(
            repo="https://argoproj.github.io/argo-helm"
        ),
        values={
            "server": {
                "service": {
                    "type": "LoadBalancer",
                }
            }
        },
    ),
    opts=pulumi.ResourceOptions(provider=provider, parent=ns),
)

Any ideas as to fixing this oddity between the version error and the actual cluster version?

I've tried:

  • Deleting everything and starting over.
  • Updating to the latest ArgoCD install yaml.

3 Answers3

1

I could reproduce your issue, though I am not quite sure what causes the mismatch between versions. Better open an issue at pulumi's k8s repository.

Looking at the history of https://github.com/argoproj/argo-helm/blame/main/charts/argo-cd/Chart.yaml, you can see that the kubeversion requirement has been added after 5.9.1. So using that version successfully deploys the helm chart. E.g.

import * as k8s from "@pulumi/kubernetes";

const namespaceName = "argo";

const namespace = new k8s.core.v1.Namespace("namespace", {
  metadata: {
    name: namespaceName,
  }
});

const argo = new k8s.helm.v3.Release("argo", {
  repositoryOpts: {
    repo: "https://argoproj.github.io/argo-helm"
  },
  chart: "argo-cd",
  version: "5.9.1",
  namespace: namespace.metadata.name,
})

(Not Recommended) Alternatively, you could also clone the source code of the chart, comment out the kubeVersion requirement in Chart.yaml and install the chart from your local path.

samox
  • 134
  • 8
1

Upgrade helm. I had a similar issue where my k8s was 1.25 but helm complained it was 1.20. Tried everything else, upgrading helm worked.

Jason Hughes
  • 2,612
  • 1
  • 10
  • 10
0

Yes, This is helm issue.

Error:- warning: Skipped ready replica check: not known during preview -- will test after apply error: Error: invocation of kubernetes:helm:template returned an error: failed to generate YAML for specified Helm chart: failed to create chart from template: chart requires kubeVersion: >= 1.22.0-0 which is incompatible with Kubernetes v1.20.0

Solotion :-

enter image description here

saurabh raj
  • 470
  • 4
  • 4