Hello! im getting started with Pulumi, and im stuc...
# getting-started
e
Hello! im getting started with Pulumi, and im stuck with a minor problem. Im working with Python, Digital Ocean and Kubernetes, everything have been smooth until now, my problem is the following: I have deployed a Kubernetes Cluster to Digital Ocean:
Copy code
import pulumi_digitalocean as do

from source.project import project
from source.utils import append_stack


kubernetes_cluster = do.KubernetesCluster(
    append_stack('k8s-cluster'),
    region="nyc1",
    version="1.28.2-do.0",
    node_pool={
        "name": append_stack("k8s-cluster-default-node-pool"),
        "size": "s-2vcpu-2gb",
        "node_count": 3,
    }
)


project_resource = do.ProjectResources(
    "project-resource",
    project=project.id,
    resources=[kubernetes_cluster.cluster_urn]
)


kubeconfig = kubernetes_cluster.kube_configs[0]
It works good, as expected, my problem comes when i try to deploy stuff to the cluster using the Kubernetes package:
Copy code
import pulumi_kubernetes as kubernetes

from source.kubernetes import kubeconfig
from source.utils import append_stack


kubernetes_provider = kubernetes.Provider(
    append_stack("kubernetes-provider"),
    kubeconfig=kubeconfig
)


# Use Helm to install the Nginx ingress controller
qdrant_cluster = kubernetes.helm.v3.Release(
    append_stack("qdrant-cluster"),
    chart="qdrant",
    repository_opts=kubernetes.helm.v3.RepositoryOptsArgs(
        repo="<https://qdrant.github.io/qdrant-helm>",
    ),
    version="0.6.1"
)
Notice how im importing the kubeconfig from the kubernetes declaration, and using it to create this provider hoping it will help me to deploy stuff to kubernetes without relaying on the kubectl configuration. I read an article in Digital Ocean doing this (https://www.digitalocean.com/community/tutorials/how-to-manage-digitalocean-and-kubernetes-infrastructure-with-pulumi) the relevant snippet is teh following:
Copy code
const provider = new kubernetes.Provider("do-k8s", { kubeconfig })

const appLabels = { "app": "app-nginx" };
const app = new kubernetes.apps.v1.Deployment("do-app-dep", {
    spec: {
        selector: { matchLabels: appLabels },
        replicas: 5,
        template: {
            metadata: { labels: appLabels },
            spec: {
                containers: [{
                    name: "nginx",
                    image: "nginx",
                }],
            },
        },
    },
}, { provider });
const appService = new kubernetes.core.v1.Service("do-app-svc", {
    spec: {
        type: "LoadBalancer",
        selector: app.spec.template.metadata.labels,
        ports: [{ port: 80 }],
    },
}, { provider });

export const ingressIp = appService.status.loadBalancer.ingress[0].ip;
You can see how the provider is used as argument to create the nginx resources. Im trying to do the same in Python, but cant find how to do it in the docs nor exploring the kubernetes provider code. Could you give me a hand on this? Thanks in advance!
After reading previous questions, i saw that this thread have the answer: https://pulumi-community.slack.com/archives/C01PF3E1B8V/p1697553564723759
b
yeah you need to specify
opts=