Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running a single docker container on Google Cloud Platform

Tags:

What is the most cost effective way of running a single docker container on GCP? I have various simple scripts which I've packaged in images and which I'd like to move to GCP and run them as containers. From the docs Google Container engine is:

A Container Engine cluster is a group of Compute Engine instances running Kubernetes. It consists of one or more node instances, and a managed Kubernetes master endpoint. A container cluster is the foundation of a Container Engine application—pods, services, and replication controllers all run on top of a cluster.

This sounds like an overkill as I only need one Compute Engine instance with the docker toolchain installed and easy access to other cloud tools (e.g. SQL). I proceeded to provision a Compute Engine VM but then had to set up docker which felt like reinventing Google Container Engine.

EDIT: I found this which is in alpha stage as of now (2017-09-06): https://cloud.google.com/compute/docs/instance-groups/deploying-docker-containers

like image 315
s5s Avatar asked Sep 06 '17 14:09

s5s


1 Answers

The most cost effective way is to run a single VM that runs your container. You can run Google's Container-Optimized OS to run the container and add a startup script to start the container when the machine boots (this OS already has docker installed and is the OS used by default in Google Container Engine).

However, you get other benefits from running on top of Google Container Engine: health checking of your container (and optionally of your VM), the ability to later trivially scale up your application to multiple replicas, the ability to easily deploy new versions of your application, support for logging / monitoring, etc. You may find that the features provided by Google Container Engine are worth the extra overhead it adds to your single node.

like image 145
Robert Bailey Avatar answered Nov 03 '22 20:11

Robert Bailey