-
Notifications
You must be signed in to change notification settings - Fork 2
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
Support a Builder
resource for managing builders via Pulumi
#65
Comments
Builder
resource for managing builders via Pulumi
This needs significant clarification around how this would model The The
How would my local
None of what you've described here seems relevant or even possible for The functionality gap exists when users need to run
The provider does not create unmanaged Kubernetes Deployments. It will only create a |
I'm finding myself wanting something that wraps Like, imagine setting up a k8s cluster to run cloud builds, passing that into Except, you're right that it makes absolutely no sense to store Resource state about these things in a way that should be shared among hosts. So you might be right that provider options that work in this resource-ish fashion might be the right pattern? Or just a provider helper function that does this resource-ish behavior? It's either that or a very wonky resource that always refreshes itself. |
Hello!
Issue description
As seen in #55, the
docker-build.Image
resource by default creates a builder, which may create an unmanaged compute resource (container, Kubernetes Deployment, etc.) that is managed outside of the lifecycle of the Docker provider. As these are unmanaged, they are persistent beyond the life of any Pulumi program and can pollute shared compute resources.A second challenge is that the
docker-build.Image
resource provides no mechanism to create other kinds of builders. This means users need to use another provider (likely more than one) to both create the compute resources and to connect a Docker client to the shared builder.Proposal
Support a
docker-image.Builder
resource for explicitly configuring a persistent, shared Builder, whose lifecycle is managed as a Pulumi resource. This resource could be created in the same stack and used as a dependency fordocker-image.Image
resources, or in a shared stack consumed viaStackReference
.And modify
docker-image.Image
to support passing a more verbose configuration - the configuration for connecting a builder.It may be that the
docker-build.Image
resource should be extended to take a "builder config" to add, if not present.A
pulumi destroy
on thedocker-build.Builder
should be equivalent todocker builder rm ...
, that is, the Builder becomes a lifecycle managed resource.This would be useful whether the Builder is a Kubernetes builder, a Docker container builder, etc.
Background, example in Docker CLI
Suppose we have a kube cluster and configure a builder on it.
This command, creating the builder, both changes the local docker engine state by creating a file here:
~/.docker/buildx/instances/kube
(named the name of the builder).And it creates a Deployment on the Kubernetes cluster. This is a durable, permanent change on the remote cluster:
Users may want to manage the durable part of this (the long-lived Kubernetes deployment, a container on a remote Docker Engine) separate from the local part (the local Docker configuration connecting to it.)
Such that they can declare a single builder in one stack and use it from multiple other stacks. That is, a stack can declare a
docker-build.Builder
which is used for zero or manydocker-build.Image
resources in that stack, or used via StackReference from other stacks.Originally posted by @AaronFriel in #55 (comment)
The text was updated successfully, but these errors were encountered: