Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defaulting to a k8s provider if enabled #391

Open
kylepl opened this issue Oct 28, 2023 · 0 comments
Open

Defaulting to a k8s provider if enabled #391

kylepl opened this issue Oct 28, 2023 · 0 comments

Comments

@kylepl
Copy link

kylepl commented Oct 28, 2023

I have a rough flow in my Pulumi config of:

  1. Configure a k8s cluster
  2. Set up several things (deployments, configmaps) in it.

To do this, I get the kubeConfig like:

val k8sProvider = kubernetesProvider("k8sprovider") {
  args {
    kubeconfig(cluster.kubeConfigs.applyValue { kubeConfigs -> kubeConfigs.get(0).rawConfig })
  }
}

and then later on reference it like:

serviceAccount("my-service-account") {
  opts {
    // Specifies which cluster to apply it to.
    provider(k8sProvider)
  }
}

so that it uses those credentials.

If I forget, it uses the kubectl last-used properties, which is not ideal.

I'm wondering if there is some way to "install" or put the k8s provider as the default for a scope? For instance:

using(k8sProvider) {
  serviceAccount("my-service-account") {}
  deployment("some-deployment") {...}
}

I'm new to Kotlin, so not just trying to ask a language question - perhaps this needs library support?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants