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

Creation of instance template with container image #227

Open
SamyPesse opened this issue Nov 4, 2021 · 5 comments
Open

Creation of instance template with container image #227

SamyPesse opened this issue Nov 4, 2021 · 5 comments

Comments

@SamyPesse
Copy link

GCP supports creating instance template to deploy docker container: https://cloud.google.com/compute/docs/containers/deploying-containers#managedinstancegroupcontainer / https://cloud.google.com/sdk/gcloud/reference/beta/compute/instance-templates/create-with-container

But it doesn't seem possible to do it with Pulumi at the moment (with native or the classic). Am I missing something?

@SamyPesse SamyPesse added the kind/enhancement Improvements or new features label Nov 4, 2021
@mikhailshilkov
Copy link
Member

Thank you for your question! It looks like the example you linked uses the beta API of the compute service but, indeed, I don't see any container-related properties in the Discovery Document (the API spec) that Google provides, see here.

I will ask Google folks to check why.

@mikhailshilkov
Copy link
Member

@SamyPesse One option to figure out what is going on: if you have a gcloud CLI command that works for you, you could run it with --log-http parameter and see the actual HTTP requests that it issues. If you paste those in this issue, it would be super helpful.

@m-strzelczyk
Copy link

Hello! I work with GCP and I can share some insights here.

Unfortunately, creating instances and templates that run containers is currently limited to Cloud Console and gcloud tool only. If you go into Cloud Console, click through the Instance creation page and click "Equivalent REST", you'll see the API request with:

"metadata": {
    "items": [
      {
        "key": "gce-container-declaration",
        "value": "spec:\n  containers:\n  - name: instance-1\n    image: ngingx\n    stdin: false\n    tty: false\n  restartPolicy: Always\n# This container declaration format is not public API and may change without notice. Please\n# use gcloud command-line tool or Google Cloud Console to run Containers on Google Compute Engine."
      }
    ]
  },

Most important is the comment:

This container declaration format is not public API and may change without notice. Please use gcloud command-line tool or Google Cloud Console to run Containers on Google Compute Engine.

As you can see, the way we create instances hosting containers is not fully finalized yet and the way it's done is subject to change. Obviously, with the REST preview, you can reverse engineer how it's done right now, but it's not really recommended.

Let me know if you have any further questions.

@simenandre
Copy link
Contributor

simenandre commented Jul 28, 2022

How about we create an experimental Pulumi Package to handle this? We can release this under Pulumiverse, and I would love to contribute to it.

@nonylene
Copy link

nonylene commented Apr 29, 2024

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

6 participants