I’ve created a container-based Instance template from the GCP Console. When I apply this template to a group of instances it works correctly. Port 8080 appears exposed when I run NMAP, and I can access the service.
When I create the same type of template using Gcloud, the port is inaccessible despite specifying the same tags for the firewall, and the configuration is the same.
gcloud compute instance-templates create-with-container gcloudtemplate
--project=test
--machine-type=e2-medium
--network-interface=network=default,network-tier=PREMIUM
--service-account=XXXXXXXXXXX-compute@developer.gserviceaccount.com
--scopes=https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/logging.write,https://www.googleapis.com/auth/monitoring.write,https://www.googleapis.com/auth/servicecontrol,https://www.googleapis.com/auth/service.management.readonly,https://www.googleapis.com/auth/trace.append
--tags=http-server,https-server,lb-health-check
--container-image=eu.gcr.io/repo-test/sameimage
--container-restart-policy=always
--container-privileged
--container-stdin
--create-disk=auto-delete=yes,device-name=gcloudtemplate,image=projects/cos-cloud/global/images/cos-stable-109-17800-147-60,mode=rw,size=10,type=pd-balanced
--no-shielded-secure-boot
--shielded-vtpm
--shielded-integrity-monitoring
--labels=container-vm=cos-stable-109-17800-147-60
Is there any configuration parameter for deployment from Gcloud that I’m missing? I’m sure there’s no issue with the firewall because I have a rule allowing traffic to those instances on port 8080, and it works for the template created from the GCP Console, which also includes the instance created from Gcloud.
I’ve also noticed that when trying to create the template, some parameters that appear when clicking on ‘Equivalent Rest’ are deprecated or don’t work.
I’m completely lost, and I don’t know what else to try. Any help will be greatly appreciated.