Hi together, what does I have to do if I have 3 se...
# kubernetes
b
Hi together, what does I have to do if I have 3 self hosted k8s clusters and I should configure everything with one "pulumi up" command. Is that in general possible?
b
yes, you need to explicitly configure the different k8s providers for each cluster and pass those providers to relevant resources
b
Is there an example / tutorial available?
b
almost every pulumi resource has args and options. Options generally contain some pulumi stuff (like
parent
and
dependsOn
etc etc) and may contain platform-specific things (like region for e.g. aws provider or in this case kube cluster config) You can create a provider from kubeconfig like
Copy code
const clusterAProvider = new k8s.Provider("foo", {
            kubeconfig: clusterAKubeConfig,
        }, )
and then give it to your resource like
Copy code
const service = new k8s.core.v1.Service(`foo-svc`, {
            spec: { <svc spec> },
        }, {provider: clusterAProvider})
there even may be some syntax sugar to help you, e.g.
eks.Cluster
object already has the
provider
property
https://github.com/pulumi/pulumi-kubernetes this README is somewhat helpful