Added flag to set cluster class B network address for pods, add flag to disable allocation CIDRs for Pods. Fixed synchornization bug in NodeController registerNodes().

This commit is contained in:
Jerzy Szczepkowski
2015-04-28 17:02:45 +02:00
committed by CJ Cullen
parent 290c7b94ef
commit e967ffd522
12 changed files with 97 additions and 53 deletions

View File

@@ -53,7 +53,9 @@ type GCECloud struct {
projectID string
zone string
instanceID string
networkName string
// We assume here that nodes and master are in the same network. TODO(cjcullen) Fix it.
networkName string
// Used for accessing the metadata server
metadataAccess func(string) (string, error)
@@ -243,6 +245,7 @@ func waitForOp(op *compute.Operation, getOperation func() (*compute.Operation, e
pollOp := op
for pollOp.Status != "DONE" {
var err error
// TODO: add some backoff here.
time.Sleep(time.Second)
pollOp, err = getOperation()
if err != nil {
@@ -569,6 +572,7 @@ func (gce *GCECloud) Configure(name string, spec *api.NodeSpec) error {
}
return ErrMetadataConflict
}
// We are setting the metadata, so they can be picked-up by the configure-vm.sh script to start docker with the given CIDR for Pods.
instance.Metadata.Items = append(instance.Metadata.Items,
&compute.MetadataItems{
Key: podCIDRMetadataKey,