I use google deployment manager to create:
This works like a charm (I used this tutorial). However, I fail to define an instance template that runs a docker container (fwiw: the google cloud web console looks as that when one creates such an instance template).
I tried several things (some might be dumb):
Take a look at the description of the working instance template and try to reproduce it.
gcloud compute instance-templates describe <working-template>
to get an extensive definition of the working instance templateDo not use Container-Optimized OS (aka. copy this example )
spec containers image
by my gcr.io hosted docker image.Confirm that something is wrong with previous approaches: get the gcloud
console util command, duplicate the working instance template. Update the deployment so that the instance group uses this manually copied instance template.
Confirm that the google deployment manager is not messing around.
Am I going in the wrong direction here ?
To make it work with Container-Optimized OS I defined a template with a metadata "user-data" that contains a "cloud-config" file that creates a systemd service that runs the expected container.
I published the result on gist, to make it work you'll have to (a) specify the dockerImage
in the deploy.yaml
file and (b) if you need special scopes update set them in instance_template.py
along with your developer.gserviceaccount.com account.
Hope it helps.