在Google Kubernetes Engine上部署可投入生产的GitLab时出现HTTPError 400

时间:2019-09-23 00:38:41

标签: kubernetes google-cloud-platform gitlab

我正在遵循官方的Tutorial,以在Google Kubernetes Engine上部署可投入生产的GitLab。

创建PostgreSQL实例和数据库的步骤:1.创建GitLab将用于存储其大多数元数据的Cloud SQL数据库给我以下错误:

gcloud beta sql instances create gitlab-db --network default \
    --database-version=POSTGRES_9_6 --cpu 4 --memory 15 --no-assign-ip \
    --storage-auto-increase --zone us-central1-a
ERROR: (gcloud.beta.sql.instances.create) HTTPError 400: Invalid request: Project {here_stands_my_correct_Project_ID} has invalid private network 
name https://compute.googleapis.com/compute/v1/projects/{here_stands_my_correct_Project_ID}/global/networks/default.

有什么想法,谢谢?

编辑:我使用以下命令,并在控制台中手动将gilab-db编辑为带有附加网络的私有IP(默认),在本教程的结尾出现503错误。

gcloud beta sql instances create gitlab-db --database-version=POSTGRES_9_6 --cpu 4 --memory 15 --storage-auto-increase --zone us-central1-a
$ kubectl get pods
NAME                                                   READY   STATUS                  RESTARTS   AGE
gitlab-certmanager-788c6859c6-szqqm                    1/1     Running                 0          28m
gitlab-gitaly-0                                        0/1     Pending                 0          28m
gitlab-gitlab-runner-6cfb858756-l8gxr                  0/1     CrashLoopBackOff        6          28m
gitlab-gitlab-shell-6cc87fcd4c-2mqph                   1/1     Running                 0          28m
gitlab-gitlab-shell-6cc87fcd4c-jvp8n                   1/1     Running                 0          27m
gitlab-issuer.1-cx8tm                                  0/1     Completed               0          28m
gitlab-nginx-ingress-controller-5f486c5f7b-md8rj       1/1     Running                 0          28m
gitlab-nginx-ingress-controller-5f486c5f7b-rps6m       1/1     Running                 0          28m
gitlab-nginx-ingress-controller-5f486c5f7b-xc8fv       1/1     Running                 0          28m
gitlab-nginx-ingress-default-backend-7f87d67c8-6xhhz   1/1     Running                 0          28m
gitlab-nginx-ingress-default-backend-7f87d67c8-7w2s2   1/1     Running                 0          28m
gitlab-registry-8dfc8f979-9hdbr                        0/1     Init:0/2                0          28m
gitlab-registry-8dfc8f979-qr5nd                        0/1     Init:0/2                0          27m
gitlab-sidekiq-all-in-1-88f47878-26nh8                 0/1     Init:CrashLoopBackOff   7          28m
gitlab-task-runner-74fc4ccdb9-pm592                    1/1     Running                 0          28m
gitlab-unicorn-5b74ffdff8-4kkj4                        0/2     Init:CrashLoopBackOff   7          28m
gitlab-unicorn-5b74ffdff8-nz662                        0/2     Init:CrashLoopBackOff   7          27m
kube-state-metrics-57b88466db-h7xkj                    1/1     Running                 0          27m
node-exporter-q4bpv                                    1/1     Running                 0          27m
node-exporter-x8mtj                                    1/1     Running                 0          27m
node-exporter-xrdlv                                    1/1     Running                 0          27m
prometheus-k8s-5cf4c4cf6c-hsntr                        2/2     Running                 1          27m

1 个答案:

答案 0 :(得分:0)

可能是因为它仍在beta中,并且并非所有功能和/或选项都正常工作。

我建议您检查一下是否只有一个网络可用。

您可以使用gcloud compute networks list来做到这一点。

$ gcloud compute networks list
NAME     SUBNET_MODE  BGP_ROUTING_MODE  IPV4_RANGE  GATEWAY_IPV4
default  AUTO         REGIONAL

如果仅看到default网络,则完全不必担心提供{{​​1}}标志。

此外,实例看起来还需要使用公共IP或私有IP,这样您就可以省去标记--network

工作命令可能如下所示:

--no-assign-ip

您可以阅读有关gcloud beta sql instances create上的标志和用法的文档