0

我在 GKE 集群上运行 Knative。Knative 网站上提供的示例图像可以工作,但是当我切换到其他一些图像时,它会停止工作。3 个容器中只有 2 个容器工作,并且路由的就绪状态保持“未知”,原因显示为“RevisionMissing”。

我尝试了多个图像,k8s.gcr.io/hpa-example 就是其中之一。

编辑:集群有一个配置类型为 n1-standard-4 的两个节点(4 个 vCPU,15 GB 内存)。我使用带有最新版本 kubernetes 的 GCP 控制台创建了这个集群,并选中了 Enable Istio 复选框。我使用以下命令安装 Knative:

kubectl apply --selector knative.dev/crd-install=true \
-f https://github.com/knative/serving/releases/download/v0.8.0/serving.yaml \
-f https://github.com/knative/eventing/releases/download/v0.8.0/release.yaml \
-f https://github.com/knative/serving/releases/download/v0.8.0/monitoring.yaml

kubectl apply \
-f https://github.com/knative/serving/releases/download/v0.8.0/serving.yaml \
-f https://github.com/knative/eventing/releases/download/v0.8.0/release.yaml \
-f https://github.com/knative/serving/releases/download/v0.8.0/monitoring.yaml

谢谢

4

2 回答 2

1

好的,我发现了问题。我尝试发布自定义图像。一切正常,直到我将端口(内部图像)更改为 80。此图像不仅可以用作 Knative 服务,而且它也不适用于 Cloud run 服务。底线是,要么从环境变量中提取端口号,要么将其硬编码到 80 以外的任何其他端口。

于 2019-09-04T13:53:07.120 回答
0

感谢您的精确度。

当您安装 Knative 时,您应该会看到此类错误

# Without CRD 
unable to recognize "https://github.com/knative/serving/releases/download/v0.8.0/serving.yaml": no matches for kind "Gateway" in version "networking.istio.io/v1alpha3"
unable to recognize "https://github.com/knative/serving/releases/download/v0.8.0/serving.yaml": no matches for kind "Gateway" in version "networking.istio.io/v1alpha3"
unable to recognize "https://github.com/knative/serving/releases/download/v0.8.0/serving.yaml": no matches for kind "Image" in version "caching.internal.knative.dev/v1alpha1"
unable to recognize "https://github.com/knative/eventing/releases/download/v0.8.0/release.yaml": no matches for kind "ClusterChannelProvisioner" in version "eventing.knative.dev/v1alpha1"


# Without CRD 
Error from server (NotFound): error when creating "https://github.com/knative/serving/releases/download/v0.8.0/monitoring.yaml": namespaces "istio-system" not found
Error from server (NotFound): error when creating "https://github.com/knative/serving/releases/download/v0.8.0/monitoring.yaml": namespaces "istio-system" not found
Error from server (NotFound): error when creating "https://github.com/knative/serving/releases/download/v0.8.0/monitoring.yaml": namespaces "istio-system" not found
Error from server (NotFound): error when creating "https://github.com/knative/serving/releases/download/v0.8.0/monitoring.yaml": namespaces "istio-system" not found

你没有安装 Istio。这样做,重新启动 knative 安装(有和没有 CRD)以解决以前的错误并享受!

于 2019-09-04T06:03:53.220 回答