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

Split docker host config for remote and local hosts #1266

Open
pythoninthegrass opened this issue Oct 31, 2024 · 2 comments
Open

Split docker host config for remote and local hosts #1266

pythoninthegrass opened this issue Oct 31, 2024 · 2 comments
Labels
awaiting-feedback Blocked on input from the author kind/question Questions about existing features

Comments

@pythoninthegrass
Copy link

This is more of a question. Looking through the docs, I'm not sure if it's possible to split the docker host (DOCKER_HOST) configuration in Pulumi.yml:

name: pulumi_docker
runtime:
  name: python
  options:
    toolchain: poetry
    virtualenv: .venv
    typechecker: mypy
description: Use the docker provider to setup local and remote containers
config:
  docker:host:
    value: unix:///var/run/docker.sock
  docker:host:
    value: ssh://user@remote-host:22
  docker:sshOpts:
    value:
        - -o
        - StrictHostKeyChecking=no
        - -o
        - UserKnownHostsFile=/dev/null
  pulumi:tags:
    value:
      pulumi:template: https://www.pulumi.com/ai/api/project/52d80566-92ad-49af-8b0c-0e5eb4f3d53e.zip

This of course fails as it's a duplicate key

λ pulumi config
error: could not unmarshal '/Users/lance.stephens/git/pulumi_docker/Pulumi.yml': yaml: unmarshal errors:
  line 12: mapping key "docker:host" already defined at line 10

My use case is that I want some containers to be local while others are remote (or both). An example of this workflow is that on the pulumi host (controller?), it needs prometheus, grafana, and the node-exporter for linux. But on remote nodes, certain prometheus exporters will be deployed (e.g., mongo, redis, elasticsearch, etc.)

The business logic can easily handle this, but not sure how pulumi abstracts the underlying terraform and if that's possible without writing separate stacks.

@pulumi-bot pulumi-bot added the needs-triage Needs attention from the triage team label Oct 31, 2024
@blampe
Copy link
Contributor

blampe commented Nov 11, 2024

To use multiple hosts you'll want to explicitly configure different remote/local providers and pass those as resource options to the relevant images.

Consider also checking out the new docker-build provider.

@blampe blampe added kind/question Questions about existing features awaiting-feedback Blocked on input from the author and removed needs-triage Needs attention from the triage team labels Nov 11, 2024
@pythoninthegrass
Copy link
Author

Appreciate the response! I'll see if I can figure it out and get back to you.

@pulumi-bot pulumi-bot added needs-triage Needs attention from the triage team and removed awaiting-feedback Blocked on input from the author labels Nov 12, 2024
@blampe blampe added awaiting-feedback Blocked on input from the author and removed needs-triage Needs attention from the triage team labels Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-feedback Blocked on input from the author kind/question Questions about existing features
Projects
None yet
Development

No branches or pull requests

3 participants