https://pulumi.com logo
#kubernetes
Title
# kubernetes
b

bored-vr-79323

11/29/2023, 10:33 AM
Hello. We have a little error we’d love some guidance on 🙂. We’re trying to install cert-manager with this package. Getting this error:
Copy code
kubernetes:<http://helm.sh/v3:Release|helm.sh/v3:Release> (cert-manager-helm):
    error: kubernetes:<http://helm.sh/v3:Release|helm.sh/v3:Release> resource 'cert-manager-helm': property chart value {cert-manager} has a problem: chart requires kubeVersion: >= 1.22.0-0 which is incompatible with Kubernetes v1.20.0; check the chart name and repository configuration.
This is our code:
Copy code
k8sProvider, err := kubernetes.NewProvider(pulumiContext, "k8sprovider", &kubernetes.ProviderArgs{
		Kubeconfig: pulumi.String(kubeconfigPath),
	})
	if err ...

	certManagerProvider, err := certmanager.NewProvider(pulumiContext, "cert-manager", &certmanager.ProviderArgs{}, pulumi.Provider(k8sProvider))
	if err ...

	certmanagerArgs := certmanager.CertManagerArgs{
		HelmOptions: certmanager.ReleaseArgs{
			Namespace:       pulumi.String("cert-manager"),
			CreateNamespace: pulumi.Bool(true),
		},
		InstallCRDs: pulumi.Bool(true),
	}

	_, err := certmanager.NewCertManager(pulumiContext, "cert-manager", &certmanagerArgs, pulumi.Provider(certManagerProvider))
This might be the closest problem I found. It mentions to upgrade helm and maybe there’s no access to the cluster. But Helm is latest version for us and we’re able to create namespaces, install Vault, create ingresses, etc. Following the same pattern with this cert-manager package but only getting the error. K8s is v1.25.2. Are we doing it wrong? Should we be using another package or installation method? Thanks!
d

dry-keyboard-94795

11/29/2023, 11:13 AM
This should be resolved with the v4.5.4 release of pulumi kubernetes, can you check your version please
b

bored-vr-79323

11/29/2023, 2:21 PM
Copy code
❯ go list -m all | grep pulumi-kubernetes/sdk
<http://github.com/pulumi/pulumi-kubernetes/sdk/v3|github.com/pulumi/pulumi-kubernetes/sdk/v3> v3.30.2
<http://github.com/pulumi/pulumi-kubernetes/sdk/v4|github.com/pulumi/pulumi-kubernetes/sdk/v4> v4.5.5
I updated the pulumi-kubernetes package to 4.5.5 but it seems
<http://github.com/pulumi/pulumi-kubernetes-cert-manager|github.com/pulumi/pulumi-kubernetes-cert-manager> v0.0.5
is using 3.30.2
d

dry-keyboard-94795

11/29/2023, 2:34 PM
That's odd. The error you're seeing is a regression in 4.5.0. I'm not familiar enough with the golang systems to help on that. I've always implemented cert-manager without the provided component resource, you could take a look at the code for how to do it yourself. It should just be the helm release + YamlFile resources
b

bored-vr-79323

11/29/2023, 2:35 PM
I might end up doing just that. Thanks for responding on this though 🙂
s

stale-answer-34162

11/29/2023, 2:56 PM
I had this issue a couple weeks ago and a pulumi upgrade fixed it
b

bored-vr-79323

11/29/2023, 3:11 PM
Already using latest version for that though:
<http://github.com/pulumi/pulumi/sdk/v3|github.com/pulumi/pulumi/sdk/v3> v3.94.2
m

mammoth-alligator-18983

11/30/2023, 9:58 AM
Is there a difference between NewChart and NewRelease, or do we need to use them together in some way? https://www.pulumi.com/registry/packages/kubernetes/api-docs/helm/v3/release/ https://www.pulumi.com/registry/packages/kubernetes/api-docs/helm/v3/chart/ To me it looks like both installs a helm chart, or am I wrong?
d

dry-keyboard-94795

11/30/2023, 10:12 AM
Release will use
helm install
internally, so everything is managed by helm. Chart will use
helm template
, then pulumi will load the resources into the stack. Worth reading this: https://www.pulumi.com/registry/packages/kubernetes/how-to-guides/choosing-the-right-helm-resource-for-your-use-case/
m

mammoth-alligator-18983

11/30/2023, 10:35 AM
For now we did yaml.NewConfigFile and fetch the crd and put a pulumi.DependsOn on the configfile at the end of the call to NewChart. Seems to work.
d

dry-keyboard-94795

11/30/2023, 10:59 AM
Yep this is the recommended way for cert-manager. It's a relatively simple chart, so Chart and Release can be used interchangeably here.
s

stale-answer-34162

11/30/2023, 2:48 PM
is that better to use then this?
k8s.yaml.ConfigFile
d

dry-keyboard-94795

11/30/2023, 3:05 PM
@stale-answer-34162 it's the same thing, just named differently in the go-sdk
m

mammoth-alligator-18983

11/30/2023, 7:40 PM
@dry-keyboard-94795 thank you for the link to the article above.
14 Views