Ao criar um conjunto de nós regionais com gcloud. Os nós não se registram

1

Ao executar o seguinte comando gcloud no meu cluster existente do GKE

SCOPES=(
https://www.googleapis.com/auth/compute
https://www.googleapis.com/auth/devstorage.read_write
https://www.googleapis.com/auth/monitoring.write
https://www.googleapis.com/auth/logging.write
https://www.googleapis.com/auth/monitoring
https://www.googleapis.com/auth/pubsub
https://www.googleapis.com/auth/servicecontrol
https://www.googleapis.com/auth/service.management
https://www.googleapis.com/auth/sqlservice.admin
https://www.googleapis.com/auth/trace.append
https://www.googleapis.com/auth/cloud_debugger
https://www.googleapis.com/auth/cloud-platform
)

gcloud beta container node-pools create $POOL_NAME \
--machine-type $MACHINE_TYPE \
--disk-size $DISK_SIZE \
--enable-autorepair \
--enable-autoscaling \
--min-nodes 1 --max-nodes 4 \
--cluster $CLUSTER \
--zone $ZONE \
--num-nodes 1 \
--scopes $(printf ",%s" "${SCOPES[@]}")

(Observe que isso é regional, portanto, usando o comando beta - suspeito que isso não aconteça com clusters não regionais) Eu recebo o seguinte erro:

    Creating node pool pool-alpha...done.                                                                                                                                                                                                         
ERROR: (gcloud.beta.container.node-pools.create) Operation [<Operation
 endTime: u'2018-03-29T08:56:14.989660264Z'
 name: u'operation-1522311735033-87b12027'
 operationType: OperationTypeValueValuesEnum(CREATE_NODE_POOL, 7)
 selfLink: u'https://container.googleapis.com/v1beta1/projects/xxxxxxxxx/zones/europe-west1-d/operations/operation-1522311735033-87b12027'
 startTime: u'2018-03-29T08:22:15.03391313Z'
 status: StatusValueValuesEnum(DONE, 3)
 statusMessage: u'All cluster resources were brought up, but the cluster API is reporting that only 0 nodes out of 3 have registered. Cluster may be unhealthy.'
 targetLink: u'https://container.googleapis.com/v1beta1/projects/xxxxxxxxxx/zones/europe-west1-d/clusters/digibet-prod/nodePools/pool-alpha'
 zone: u'europe-west1-d'>] finished with error: All cluster resources were brought up, but the cluster API is reporting that only 0 nodes out of 3 have registered. Cluster may be unhealthy.

E, de fato, os nós são criados, mas não são registrados no cluster. Um bug com o GKE?

    
por Stan Bondi 29.03.2018 / 11:22

1 resposta

0

Anton Kostenko deu a resposta no StackOverflow:

link

Foi um problema com minha linha --scopes $(printf ",%s" "${SCOPES[@]}") , que adicionava uma vírgula extra no final que (de forma compreensível) não é validada no gcloud cli e interrompe o processo interno de registro de nó do GKE

Eu mudei para --scopes $(IFS=','; echo "${SCOPES[*]}") (sem vírgula final) e agora funciona

    
por 15.05.2018 / 12:57