knative / serving

Kubernetes-based, scale-to-zero, request-driven compute
https://knative.dev/docs/serving/
Apache License 2.0
5.55k stars 1.16k forks source link

when exec `ko apply -Rf config/core/`, there is not the image of domain-mapping #11813

Closed jwcesign closed 3 years ago

jwcesign commented 3 years ago

when I exec ko apply -Rf config/core/, here is the output:

jw@cci-network-0003:~/workspace/src/knative.dev/serving$ ko apply -Rf config/core/
2021/08/17 15:28:22 Using base gcr.io/distroless/static:nonroot for knative.dev/serving/cmd/queue
2021/08/17 15:28:22 Using base gcr.io/distroless/static:nonroot for knative.dev/serving/cmd/domain-mapping
2021/08/17 15:28:22 Using base gcr.io/distroless/static:nonroot for knative.dev/serving/cmd/domain-mapping-webhook
2021/08/17 15:28:22 Using base gcr.io/distroless/static:nonroot for knative.dev/serving/cmd/webhook
2021/08/17 15:28:23 Using base gcr.io/distroless/static:nonroot for knative.dev/serving/cmd/controller
2021/08/17 15:28:23 Using base gcr.io/distroless/static:nonroot for knative.dev/serving/cmd/autoscaler
2021/08/17 15:28:23 Using base gcr.io/distroless/static:nonroot for knative.dev/serving/cmd/activator
2021/08/17 15:28:26 Building knative.dev/serving/cmd/webhook for linux/amd64
2021/08/17 15:28:26 Building knative.dev/serving/cmd/domain-mapping-webhook for linux/amd64
2021/08/17 15:28:26 Building knative.dev/serving/cmd/domain-mapping for linux/amd64
2021/08/17 15:28:27 Building knative.dev/serving/cmd/controller for linux/amd64
2021/08/17 15:28:27 Building knative.dev/serving/cmd/activator for linux/amd64
2021/08/17 15:28:28 Building knative.dev/serving/cmd/queue for linux/amd64
2021/08/17 15:28:28 Building knative.dev/serving/cmd/autoscaler for linux/amd64
2021/08/17 15:28:31 Loading ko.local/domain-mapping-webhook-a127ae3e896f4e4bc1179581011b7824:fc7a4a0aee0dcaca3276fc9789e1ab07ac6dc206efb3800bf7f362c51902f51e
2021/08/17 15:28:32 Loading ko.local/queue-39be6f1d08a095bd076a71d288d295b6:5008d985446fd67d6f15d3afb5d791f40716dd321e69c5f06a552d47d8cb9fd8
2021/08/17 15:28:32 Loading ko.local/webhook-261c6506fca17bc41be50b3461f98f1c:9e0df89a4cc843a3fd316c68fb981cba27c334c94a19ae446ea614f837cacabc
2021/08/17 15:28:32 Loading ko.local/domain-mapping-82f8626be89c35bcd6c666fd2fc8ccb7:8312aaadc759b71408dca8c2e5311825b951c04ab26c52668b4f11475afbbcad
2021/08/17 15:28:33 Loading ko.local/activator-ecd51ca5034883acbe737fde417a3d86:e0f6e711bce43c7cda60078b761ebc513f545213a3a10b2ac7e90b114d23fc71
2021/08/17 15:28:33 Loading ko.local/controller-f6fdb41c6acbc726e29a3104ff2ef720:e0244f734d83357cc0a20b52ba11419e83b46bc1d6c9b2fd3d0ee71ae27edfb5
2021/08/17 15:28:33 Loading ko.local/autoscaler-12c0fa24db31956a7cfa673210e4fa13:8f593aa52edd334d8e475a7b380d04ecebf874c6cb8b2ddd5ef94802de080498
2021/08/17 15:28:43 Loaded ko.local/domain-mapping-webhook-a127ae3e896f4e4bc1179581011b7824:fc7a4a0aee0dcaca3276fc9789e1ab07ac6dc206efb3800bf7f362c51902f51e
2021/08/17 15:28:43 Adding tag latest
2021/08/17 15:28:43 Added tag latest
2021/08/17 15:29:50 Loaded ko.local/queue-39be6f1d08a095bd076a71d288d295b6:5008d985446fd67d6f15d3afb5d791f40716dd321e69c5f06a552d47d8cb9fd8
2021/08/17 15:29:50 Adding tag latest
2021/08/17 15:29:50 Added tag latest
2021/08/17 15:29:50 Loaded ko.local/webhook-261c6506fca17bc41be50b3461f98f1c:9e0df89a4cc843a3fd316c68fb981cba27c334c94a19ae446ea614f837cacabc
2021/08/17 15:29:50 Adding tag latest
2021/08/17 15:29:50 Added tag latest
2021/08/17 15:29:52 Loaded ko.local/domain-mapping-82f8626be89c35bcd6c666fd2fc8ccb7:8312aaadc759b71408dca8c2e5311825b951c04ab26c52668b4f11475afbbcad
2021/08/17 15:29:52 Adding tag latest
2021/08/17 15:29:52 Added tag latest
2021/08/17 15:29:55 Loaded ko.local/controller-f6fdb41c6acbc726e29a3104ff2ef720:e0244f734d83357cc0a20b52ba11419e83b46bc1d6c9b2fd3d0ee71ae27edfb5
2021/08/17 15:29:55 Adding tag latest
2021/08/17 15:29:55 Loaded ko.local/activator-ecd51ca5034883acbe737fde417a3d86:e0f6e711bce43c7cda60078b761ebc513f545213a3a10b2ac7e90b114d23fc71
2021/08/17 15:29:55 Adding tag latest
2021/08/17 15:29:55 Added tag latest
2021/08/17 15:29:55 Added tag latest
2021/08/17 15:29:55 Loaded ko.local/autoscaler-12c0fa24db31956a7cfa673210e4fa13:8f593aa52edd334d8e475a7b380d04ecebf874c6cb8b2ddd5ef94802de080498
2021/08/17 15:29:55 Adding tag latest
2021/08/17 15:29:55 Added tag latest
namespace/knative-serving created
clusterrole.rbac.authorization.k8s.io/knative-serving-aggregated-addressable-resolver created
clusterrole.rbac.authorization.k8s.io/knative-serving-addressable-resolver created
clusterrole.rbac.authorization.k8s.io/knative-serving-namespaced-admin created
clusterrole.rbac.authorization.k8s.io/knative-serving-namespaced-edit created
clusterrole.rbac.authorization.k8s.io/knative-serving-namespaced-view created
clusterrole.rbac.authorization.k8s.io/knative-serving-core created
clusterrole.rbac.authorization.k8s.io/knative-serving-podspecable-binding created
serviceaccount/controller created
clusterrole.rbac.authorization.k8s.io/knative-serving-admin created
clusterrolebinding.rbac.authorization.k8s.io/knative-serving-controller-admin created
clusterrolebinding.rbac.authorization.k8s.io/knative-serving-controller-addressable-resolver created
customresourcedefinition.apiextensions.k8s.io/images.caching.internal.knative.dev created
customresourcedefinition.apiextensions.k8s.io/certificates.networking.internal.knative.dev created
customresourcedefinition.apiextensions.k8s.io/configurations.serving.knative.dev created
customresourcedefinition.apiextensions.k8s.io/clusterdomainclaims.networking.internal.knative.dev created
customresourcedefinition.apiextensions.k8s.io/domainmappings.serving.knative.dev created
customresourcedefinition.apiextensions.k8s.io/ingresses.networking.internal.knative.dev created
customresourcedefinition.apiextensions.k8s.io/metrics.autoscaling.internal.knative.dev created
customresourcedefinition.apiextensions.k8s.io/podautoscalers.autoscaling.internal.knative.dev created
customresourcedefinition.apiextensions.k8s.io/revisions.serving.knative.dev created
customresourcedefinition.apiextensions.k8s.io/routes.serving.knative.dev created
customresourcedefinition.apiextensions.k8s.io/serverlessservices.networking.internal.knative.dev created
customresourcedefinition.apiextensions.k8s.io/services.serving.knative.dev created
image.caching.internal.knative.dev/queue-proxy created
configmap/config-autoscaler created
configmap/config-defaults created
configmap/config-deployment created
configmap/config-domain created
configmap/config-features created
configmap/config-gc created
configmap/config-leader-election created
configmap/config-logging created
configmap/config-network created
configmap/config-observability created
configmap/config-tracing created
horizontalpodautoscaler.autoscaling/activator created
Warning: policy/v1beta1 PodDisruptionBudget is deprecated in v1.21+, unavailable in v1.25+; use policy/v1 PodDisruptionBudget
poddisruptionbudget.policy/activator-pdb created
deployment.apps/activator created
service/activator-service created
deployment.apps/autoscaler created
service/autoscaler created
deployment.apps/controller created
service/controller created
deployment.apps/domain-mapping created
deployment.apps/domainmapping-webhook created
service/domainmapping-webhook created
horizontalpodautoscaler.autoscaling/webhook created
poddisruptionbudget.policy/webhook-pdb created
deployment.apps/webhook created
service/webhook created
validatingwebhookconfiguration.admissionregistration.k8s.io/config.webhook.serving.knative.dev created
mutatingwebhookconfiguration.admissionregistration.k8s.io/webhook.serving.knative.dev created
mutatingwebhookconfiguration.admissionregistration.k8s.io/webhook.domainmapping.serving.knative.dev created
secret/domainmapping-webhook-certs created
validatingwebhookconfiguration.admissionregistration.k8s.io/validation.webhook.domainmapping.serving.knative.dev created
validatingwebhookconfiguration.admissionregistration.k8s.io/validation.webhook.serving.knative.dev created
secret/webhook-certs created

I can find in the output log:

021/08/17 15:28:32 Loading ko.local/domain-mapping-82f8626be89c35bcd6c666fd2fc8ccb7:8312aaadc759b71408dca8c2e5311825b951c04ab26c52668b4f11475afbbcad
2021/08/17 15:29:52 Loaded ko.local/domain-mapping-82f8626be89c35bcd6c666fd2fc8ccb7:8312aaadc759b71408dca8c2e5311825b951c04ab26c52668b4f11475afbbcad
2021/08/17 15:29:52 Adding tag latest

but when I exec docker images to check, there isn't this image. other works ok.

jw@cci-network-0003:~/workspace/testyaml$ docker images
REPOSITORY                                                         TAG                                                                IMAGE ID       CREATED         SIZE
ko.local/webhook-261c6506fca17bc41be50b3461f98f1c                  9e0df89a4cc843a3fd316c68fb981cba27c334c94a19ae446ea614f837cacabc   45e1bc126bb5   51 years ago    55.2MB
ko.local/webhook-261c6506fca17bc41be50b3461f98f1c                  latest                                                             45e1bc126bb5   51 years ago    55.2MB
ko.local/activator-ecd51ca5034883acbe737fde417a3d86                e0f6e711bce43c7cda60078b761ebc513f545213a3a10b2ac7e90b114d23fc71   9cc029ce49d5   51 years ago    56.2MB
ko.local/activator-ecd51ca5034883acbe737fde417a3d86                latest                                                             9cc029ce49d5   51 years ago    56.2MB
ko.local/domain-mapping-webhook-a127ae3e896f4e4bc1179581011b7824   fc7a4a0aee0dcaca3276fc9789e1ab07ac6dc206efb3800bf7f362c51902f51e   33269cb2a404   51 years ago    53.4MB
ko.local/domain-mapping-webhook-a127ae3e896f4e4bc1179581011b7824   latest                                                             33269cb2a404   51 years ago    53.4MB
ko.local/queue-39be6f1d08a095bd076a71d288d295b6                    5008d985446fd67d6f15d3afb5d791f40716dd321e69c5f06a552d47d8cb9fd8   c877700b7819   51 years ago    34.7MB
ko.local/queue-39be6f1d08a095bd076a71d288d295b6                    latest                                                             c877700b7819   51 years ago    34.7MB
ko.local/controller-f6fdb41c6acbc726e29a3104ff2ef720               e0244f734d83357cc0a20b52ba11419e83b46bc1d6c9b2fd3d0ee71ae27edfb5   e79e910a8b14   51 years ago    63.7MB
ko.local/controller-f6fdb41c6acbc726e29a3104ff2ef720               latest                                                             e79e910a8b14   51 years ago    63.7MB
ko.local/autoscaler-12c0fa24db31956a7cfa673210e4fa13               8f593aa52edd334d8e475a7b380d04ecebf874c6cb8b2ddd5ef94802de080498   e912eb3b9e97   51 years ago    56.9MB
ko.local/autoscaler-12c0fa24db31956a7cfa673210e4fa13               latest                                                             e912eb3b9e97   51 years ago    56.9MB

How to fix this?

julz commented 3 years ago

This is very weird! Do you also see the domain mapping controller pod failing to start or it only the docker images output? (what does kubectl get pods -nknative-serving show?)

julz commented 3 years ago

Could you also confirm that you're running at HEAD of knative (what does git rev-parse HEAD say?)

jwcesign commented 3 years ago

kubectl get pods show ImagePullBackOff, the error like(here is queue img, same with domain-mapping):

Events:
  Type     Reason     Age                  From               Message
  ----     ------     ----                 ----               -------
  Normal   Scheduled  3m49s                default-scheduler  Successfully assigned default/helloworld-go-00001-deployment-575b7cb9fd-fvjmk to minikube
  Normal   Pulled     3m48s                kubelet            Container image "dev.local/knative-samples/helloworld-go:latest" already present on machine
  Normal   Created    3m48s                kubelet            Created container user-container
  Normal   Started    3m48s                kubelet            Started container user-container
  Normal   Pulling    82s (x3 over 3m48s)  kubelet            Pulling image "ko.local/queue-39be6f1d08a095bd076a71d288d295b6:71f73134640f50b0601424a65bd75e01862ae9c04193ba7a4a3f6f4821631498"
  Warning  Failed     37s (x3 over 2m48s)  kubelet            Failed to pull image "ko.local/queue-39be6f1d08a095bd076a71d288d295b6:71f73134640f50b0601424a65bd75e01862ae9c04193ba7a4a3f6f4821631498": rpc error: code = Unknown desc = Error response from daemon: Get https://ko.local/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
  Warning  Failed     37s (x3 over 2m48s)  kubelet            Error: ErrImagePull
  Normal   BackOff    1s (x5 over 2m47s)   kubelet            Back-off pulling image "ko.local/queue-39be6f1d08a095bd076a71d288d295b6:71f73134640f50b0601424a65bd75e01862ae9c04193ba7a4a3f6f4821631498"
  Warning  Failed     1s (x5 over 2m47s)   kubelet            Error: ImagePullBackOff

for serving repo, I just clone it. nothing did. Here is the output.

jw@cci-network-0003:~/workspace/src/knative.dev/serving$ git rev-parse HEA
HEA
fatal: ambiguous argument 'HEA': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
jw@cci-network-0003:~/workspace/src/knative.dev/serving$

does it have connection with ko delete --ignore-not-found=true -Rf config/core/? I use ctrl+c to stop this, because this sometimes stop at some steps so long time.

julz commented 3 years ago

does it have connection with ko delete --ignore-not-found=true -Rf config/core/? I use ctrl+c to stop this, because this sometimes stop at some steps so long time.

It's a rather strange bug, so I wouldn't be surprised if this was the problem. It's possible deleting half-way could have got things in to an odd state where the sha is still there in docker (so ko doesn't try to recreate the image) but the image metadata isn't. This might be more of an issue to discuss with http://github.com/google/ko, though. It's possible docker image prune -a may clean up dangling references, allowing the next run of ko to work properly, if this is indeed the problem.

jwcesign commented 3 years ago

@julz I will try docker image prune -a if I meet the situation again.