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

lively-dinner-8285

03/18/2024, 7:17 AM
below is the code:
Copy code
import pulumi
from pulumi_kubernetes.helm.v3 import Release, ReleaseArgs, RepositoryOptsArgs
from typing import Optional, Dict
import pulumi_kubernetes as k8s
from pulumi import ResourceOptions


class HelmCharts:

    def __init__(
            self, release_name: str,
            chart_name: str,
            repo: Optional[str],
            version: Optional[str],
            namespace: Optional[str],
            cluster_name: str,
    ):
        self.release_name = release_name
        self.chart_name = chart_name
        self.version = version
        self.repo = repo
        self.namespace = namespace
        self.cluster_name = cluster_name

    def deploy(self, values: Optional[Dict] = None):
        k8s_provider = k8s.Provider(self.cluster_name)
        chart = Release(
            self.release_name,
            ReleaseArgs(
                chart=self.chart_name,
                version=self.version,
                namespace=self.namespace,
                verify=False,
                create_namespace=True,
                cleanup_on_fail=True,
                wait_for_jobs=True,
                repository_opts=RepositoryOptsArgs(
                    repo=self.repo,
                ),
                values=values  # used to set chart values
            ),
            opts=ResourceOptions(provider=k8s_provider),
        )
        return chart

    @staticmethod
    def export_chart_status(chart: Release):
        return pulumi.export("chart status", chart.status)
b

billions-river-87988

03/18/2024, 10:43 PM
can you show the output of Pulumi up, and also the output of
kubectl config current-context