[GKE] Can I apply the metadata "startup-script-url" to GKE instance when I create a Cluster?

2,824 views
Skip to first unread message

Shigeomi Takada

unread,
Nov 24, 2016, 8:13:56 AM11/24/16
to Kubernetes user discussion and Q&A
Hi

I use GKE.
I set the metadata "startup-script-url" to apply my startup-script file as follows. 

{
  "cluster": {
    "name": "cluster1",
    "initialNodeCount": 3,
    "nodeConfig": {
      "metadata": {
      }
    }
  }
}

But my startup-script dose not work. When I create a GCE instance with the metadata "startup-script-url", I'm able to make it work. I think that I can apply a startup-script to GKE instances in the same way to apply a startup-script to GCE instances.

I referred to this site how to apply the startup-script to the instance.

Cannot I apply the metadata "startup-script-url" to GKE instance on specifications?
Dose anyone have any idea?

Regards,
Shigeomi

Robert Bailey

unread,
Nov 24, 2016, 12:44:26 PM11/24/16
to kubernet...@googlegroups.com
Startup scripts are not allowed to be specified for GKE nodes. From https://cloud.google.com/container-engine/reference/rest/v1/NodeConfig:

Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project or be one of the four reserved keys: "instance-template", "kube-env", "startup-script", and "user-data"

Take a look at https://github.com/kubernetes/contrib/tree/master/startup-script for a way to replace the functionality of startup scripts with a daemonset. 

 

--
You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-users+unsubscribe@googlegroups.com.
To post to this group, send email to kubernetes-users@googlegroups.com.
Visit this group at https://groups.google.com/group/kubernetes-users.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages