Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google cloud platform GCP云运行:未能创建服务_Google Cloud Platform_Google Kubernetes Engine_Istio_Google Cloud Run_Knative - Fatal编程技术网

Google cloud platform GCP云运行:未能创建服务

Google cloud platform GCP云运行:未能创建服务,google-cloud-platform,google-kubernetes-engine,istio,google-cloud-run,knative,Google Cloud Platform,Google Kubernetes Engine,Istio,Google Cloud Run,Knative,我正在尝试使用私有GKE集群的云运行。 我使用以下命令创建了集群: gcloud beta container clusters create cluster-name \ --create-subnetwork name=cloud-run-subnet \ --enable-master-authorized-networks \ --enable-ip-alias \ --enable-private-nodes \ --enable-private

我正在尝试使用私有GKE集群的云运行。 我使用以下命令创建了集群:

gcloud beta container clusters create cluster-name \
    --create-subnetwork name=cloud-run-subnet \
    --enable-master-authorized-networks \
    --enable-ip-alias \
    --enable-private-nodes \
    --enable-private-endpoint \
    --master-ipv4-cidr 172.16.0.32/28 \
    --no-enable-basic-auth \
    --no-issue-client-certificate \
    --addons=HorizontalPodAutoscaling,HttpLoadBalancing,Istio,CloudRun \
    --machine-type=n1-standard-1 \
    --enable-stackdriver-kubernetes \
    --scopes cloud-platform \
    --zone us-central1-a
gcloud compute instances create bastion \
 --zone us-central1-a \
 --subnet cloud-run-subnet \
 --machine-type=g1-small \
 --scopes cloud-platform
kubectl label namespace default istio-injection=enabled
我在同一VPC和子网中创建了一个堡垒主机,可以使用以下命令联系此群集:

gcloud beta container clusters create cluster-name \
    --create-subnetwork name=cloud-run-subnet \
    --enable-master-authorized-networks \
    --enable-ip-alias \
    --enable-private-nodes \
    --enable-private-endpoint \
    --master-ipv4-cidr 172.16.0.32/28 \
    --no-enable-basic-auth \
    --no-issue-client-certificate \
    --addons=HorizontalPodAutoscaling,HttpLoadBalancing,Istio,CloudRun \
    --machine-type=n1-standard-1 \
    --enable-stackdriver-kubernetes \
    --scopes cloud-platform \
    --zone us-central1-a
gcloud compute instances create bastion \
 --zone us-central1-a \
 --subnet cloud-run-subnet \
 --machine-type=g1-small \
 --scopes cloud-platform
kubectl label namespace default istio-injection=enabled
我在bastion主机上安装了kubectl,并使用
gcloud container clusters get credentials
命令将上下文切换到此集群

我使用以下命令确保在默认命名空间上启用了Istio:

gcloud beta container clusters create cluster-name \
    --create-subnetwork name=cloud-run-subnet \
    --enable-master-authorized-networks \
    --enable-ip-alias \
    --enable-private-nodes \
    --enable-private-endpoint \
    --master-ipv4-cidr 172.16.0.32/28 \
    --no-enable-basic-auth \
    --no-issue-client-certificate \
    --addons=HorizontalPodAutoscaling,HttpLoadBalancing,Istio,CloudRun \
    --machine-type=n1-standard-1 \
    --enable-stackdriver-kubernetes \
    --scopes cloud-platform \
    --zone us-central1-a
gcloud compute instances create bastion \
 --zone us-central1-a \
 --subnet cloud-run-subnet \
 --machine-type=g1-small \
 --scopes cloud-platform
kubectl label namespace default istio-injection=enabled
现在,当我尝试使用以下命令部署服务时,我得到一个错误:

gcloud beta run deploy hello \
    --image=gcr.io/projectname/hello-world \
    --platform=gke \
    --cluster=cluster-name \
    --cluster-location=us-central1-a \
    --connectivity=internal
错误:

ERROR: (gcloud.beta.run.deploy) Error:                                                                                                                                                                             
failed calling webhook "webhook.serving.knative.dev": Post https://webhook.knative-serving.svc:443/?timeout=30s: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting he
aders)
我尝试了
--connectivity=internal
--connectivity=external
两种方法,得到了相同的错误

尝试使用控制台创建服务时,出现以下错误:

Failed to create a service

Tracking number: d123456789
我已经确保为容器注册表(gcr.io)和GKE集群保留相同的项目

精确的东西在公共集群中运行良好。 我无法找到具体的文档来让它与私有GKE集群一起工作。有什么我遗漏的吗?
我做错了什么吗?

你能尝试用yaml文件部署云运行服务吗

这是文件

apiVersion: serving.knative.dev/v1alpha1
kind: Service
metadata:
  name: hello
  namespace: default
spec:
  traffic:
  - percent: 100
    latestRevision: true
  template:
    spec:
      containers:
      - image: gcr.io/projectname/hello-world

只需在你的堡垒执行一个
kubectl apply-f


如果它工作,这意味着gcloud命令无法与私有集群通信(您可以就此打开一个问题)。

在这个GitHub线程中解决了类似的问题:

主要原因是在私有GKE集群中,默认情况下只有GKE主机可以访问端口443或80处的服务


您是否可以尝试使用端口
8443
而不是
443
,并将端口
8443
列为白名单


没有。这不起作用,它从服务器发出
错误(InternalError):创建“knative.yaml”时出错:发生内部错误:调用webhook“webhook.service.knative.dev”失败:Posthttps://webhook.knative-serving.svc:443/?timeout=30s: 拨tcp xx.xx.x.xx:8443:i/o超时
我尝试了私有集群和公共集群。它适用于公共集群,但对私有集群无效。K8S有时很神秘。。。对不起,我的技能到此为止。我从未管理过这样的私有集群。我赞成你的问题,它真的很有趣。谢谢你的来信。我现在有点忙,其他任务,我会尝试一下,让你知道它是否在几天内工作。