研究Google在GCE執行datalab的範例中,發現了個頗有趣的事情... 不久前Google針對Optimized Container出了一個container-vm,雖然目前已經預計要deprecate這個image,不過在datalab執行於GCE的範例中M還是使用這個image來執行... 有趣的地方是,datalab-service.yaml是一個k8s的pod描述檔... 下面是instance執行的gcloud腳本: gcloud compute instances create "instance-name" \ --project "project-id" \ --zone "zone" \ --network "datalab-network" \ --image-family "container-vm" \ --image-project "google-containers" \ --metadata-from-file "google-container-manifest=datalab-server.yaml" \ --machine-type "n1-highmem-2" \ --scopes "cloud-platform" 打開datalab-server.yaml檢視,內容如下: apiVersion: v1 kind: Pod metadata: name: 'datalab-server' spec: containers: - name: datalab image: gcr.io/cloud-datalab/datalab:local command: ['/datalab/run.sh'] imagePullPolicy: Always ports: - containerPort: 8080 hostPort: 8080 hostIP: 12