Knative deployment

337 views
Skip to first unread message

Rupinder Singh

unread,
Sep 15, 2021, 1:12:15 AM9/15/21
to quark...@googlegroups.com
Hi,
With issue #19950  fixed by #20016
I'm trying knative deployment of the kubernetes-quickstart ( guide https://quarkus.io/guides/deploying-to-kubernetes ) with 999-SNAPSHOT ( https://github.com/quarkusio/quarkus/blob/main/CONTRIBUTING.md#checking-an-issue-is-fixed-in-main  & https://github.com/quarkusio/quarkus/blob/main/CONTRIBUTING.md#usage ). The only additional property required being  quarkus.kubernetes.deployment-target=knative. On minikube.

It seems io.quarkus.kubernetes.deployment.KubernetesDeployer#deploy is unable to read deployment manifest knative.json of kind service even though it is very much present in target/kubernetes.  With one-step deployment ( ./mvnw clean package -Dquarkus.kubernetes.deploy=true ), I get this in the log:

[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:999-SNAPSHOT:build (default) on project kubernetes-quickstart: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR] [error]: Build step io.quarkus.kubernetes.deployment.KubernetesDeployer#deploy threw an exception: io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: GET at: https://192.168.39.30:8443/apis/serving.knative.dev/v1/namespaces/default/services?fieldSelector=metadata.name%3Dkubernetes-quickstart. Message: 404 page not found
[ERROR] .
[ERROR] at io.fabric8.kubernetes.client.dsl.base.OperationSupport.requestFailure(OperationSupport.java:686)
[ERROR] at io.fabric8.kubernetes.client.dsl.base.OperationSupport.assertResponseCode(OperationSupport.java:625)
[ERROR] at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:565)
[ERROR] at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:526)
[ERROR] at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:509)
[ERROR] at io.fabric8.kubernetes.client.dsl.base.BaseOperation.listRequestHelper(BaseOperation.java:137)
[ERROR] at io.fabric8.kubernetes.client.dsl.base.BaseOperation.list(BaseOperation.java:524)
[ERROR] at io.fabric8.kubernetes.client.dsl.base.BaseOperation.list(BaseOperation.java:513)
[ERROR] at io.fabric8.kubernetes.client.dsl.base.BaseOperation.list(BaseOperation.java:88)
[ERROR] at io.fabric8.kubernetes.client.informers.cache.Reflector.getList(Reflector.java:53)
[ERROR] at io.fabric8.kubernetes.client.informers.cache.Reflector.listSyncAndWatch(Reflector.java:77)
[ERROR] at io.fabric8.kubernetes.client.informers.impl.DefaultSharedIndexInformer.run(DefaultSharedIndexInformer.java:146)
[ERROR] at io.fabric8.kubernetes.client.dsl.base.BaseOperation.informOnCondition(BaseOperation.java:1007)
[ERROR] at io.fabric8.kubernetes.client.dsl.base.BaseOperation.waitUntilCondition(BaseOperation.java:946)
[ERROR] at io.fabric8.kubernetes.client.dsl.base.BaseOperation.waitUntilCondition(BaseOperation.java:88)
[ERROR] at io.fabric8.kubernetes.client.dsl.internal.NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableImpl.waitUntilCondition(NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableImpl.java:221)
[ERROR] at io.fabric8.kubernetes.client.dsl.internal.NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableImpl.waitUntilCondition(NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableImpl.java:64)
[ERROR] at io.quarkus.kubernetes.deployment.KubernetesDeployer.lambda$deploy$3(KubernetesDeployer.java:177)
[ERROR] at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
[ERROR] at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
[ERROR] at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
[ERROR] at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
[ERROR] at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
[ERROR] at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
[ERROR] at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
[ERROR] at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
[ERROR] at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
[ERROR] at io.quarkus.kubernetes.deployment.KubernetesDeployer.deploy(KubernetesDeployer.java:173)
[ERROR] at io.quarkus.kubernetes.deployment.KubernetesDeployer.deploy(KubernetesDeployer.java:103)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR] at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:820)
[ERROR] at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
[ERROR] at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
[ERROR] at java.base/java.lang.Thread.run(Thread.java:829)
[ERROR] at org.jboss.threads.JBossThread.run(JBossThread.java:501)

With two-step deployment ( ./mvnw clean package followed  kubectl apply -f ./target/kubernetes/knative.json ):

configmap/config-autoscaler unchanged
error: unable to recognize "./target/kubernetes/knative.json": no matches for kind "Service" in version "serving.knative.dev/v1"

With about 3-4 hours spent looking for something amiss, I decided to ask here :)  Request help.

regards
Rupinder



On Sat, Sep 11, 2021 at 7:11 PM Georgios Andrianakis <notifi...@github.com> wrote:

Fixed by #20016

 —
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

Ioannis Canellos

unread,
Sep 15, 2021, 1:25:54 AM9/15/21
to rupi...@gmail.com, Quarkus Development mailing list
Can you please provide some more details on how you installed knative on minkube?

The errors that you see imply wrong version installed it no installation at all.

--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/CAKguLS74MeKz%3Drd5Neww6a9mnhY8nsnAsD3qQ5bK0OivzPEbjg%40mail.gmail.com.

Rupinder Singh

unread,
Sep 15, 2021, 1:41:32 AM9/15/21
to Ioannis Canellos, Quarkus Development mailing list
Hi Ioannis,
I've already given those details :)

settings.xml of maven and kubernetes-quickstart pom adjusted as per https://github.com/quarkusio/quarkus/blob/main/CONTRIBUTING.md#checking-an-issue-is-fixed-in-main  & https://github.com/quarkusio/quarkus/blob/main/CONTRIBUTING.md#usage . Both knative.json and knative.yml do get generated in target/kubernetes. Here is what knative.json looks like.

{
  "apiVersion" : "serving.knative.dev/v1",
  "kind" : "Service",
  "metadata" : {
    "annotations" : {
      "app.quarkus.io/build-timestamp" : "2021-09-15 - 03:49:20 +0000"
    },
    "labels" : {
      "app.kubernetes.io/version" : "1.0.0-SNAPSHOT",
      "app.kubernetes.io/name" : "kubernetes-quickstart"
    },
    "name" : "kubernetes-quickstart"
  },
  "spec" : {
    "template" : {
      "metadata" : {
        "labels" : {
          "app.kubernetes.io/version" : "1.0.0-SNAPSHOT",
          "app.kubernetes.io/name" : "kubernetes-quickstart"
        }
      },
      "spec" : {
        "containers" : [ {
          "image" : "rupinder/kubernetes-quickstart:1.0.0-SNAPSHOT",
          "name" : "kubernetes-quickstart",
          "ports" : [ {
            "containerPort" : 8080,
            "name" : "http1",
            "protocol" : "TCP"
          } ]
        } ]
      }
    }
  }
}{
  "apiVersion" : "v1",
  "kind" : "ConfigMap",
  "metadata" : {
    "name" : "config-autoscaler"
  }
}

I'll re-run and give you more log of what it does from the beginning if you like.

regards
Rupinder

Ioannis Canellos

unread,
Sep 15, 2021, 1:58:18 AM9/15/21
to Rupinder Singh, Quarkus Development mailing list
I am more interested in how you installed knative itself, rather than how you are generating / deploying`knative.yml` for your quarkus application.

Let`s take a step back.

Minikube does not support knative straight out of the box. This means that if you try to deploy the `knative.yml` it will fail (possibly with an error message similar to the one you got).
So, users need to install knative to minikube first, before they are actually able to deploy the `knative.yml`.


Have you done something similar? If so, can you please let me know which version of knative you installed?



--

Rupinder Singh

unread,
Sep 18, 2021, 12:17:14 PM9/18/21
to Ioannis Canellos, Quarkus Development mailing list
Hi Ioannis,

Thanks for your advice and tips.

Yes, it required knative installation. I'm sorry, I wasn't aware. While I'm trying to work through problems in installing knative on minikube ( those instructions didn't work well; I'm checking some others as well), I thought of checking out this application on knative on kind. Following knative quickstart ( https://knative.dev/docs/getting-started/ ), I have a knative installation that works. It works as per that getting-started and deploys a working hello-world. It gives me a cluster "knative" with a namespace default.
However, this is what I get.  It might be something  requiring knative fix. Could you take a look? :)

"ContainerMissing : Unable to fetch image..." The application properties that I set are:

quarkus.kubernetes.deployment-target=knative

quarkus.kubernetes-client.master-url=https://127.0.0.1:44069

quarkus.kubernetes-client.trust-certs=true

[org.jboss.threads] JBoss Threads version 3.4.2.Final
[WARNING] [io.quarkus.kubernetes.deployment.KubernetesDeployer] A Kubernetes deployment was requested, but the container image to be built will not be pushed to any registry because "quarkus.container-image.registry" has not been set. The Kubernetes deployment will only work properly if the cluster is using the local Docker daemon. For that reason 'ImagePullPolicy' is being force-set to 'IfNotPresent'.
[INFO] Checking for existing resources in: /home/rupinder/mswork/quarkus-guides/kubernetes_quickstart/Tried_with_knative_PR_20016/kubernetes-quickstart/src/main/kubernetes.
[INFO] [io.quarkus.kubernetes.deployment.KubernetesDeploy] Kubernetes API Server at 'https://127.0.0.1:44069/' successfully contacted.
[INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] Starting container image build
[WARNING] [io.quarkus.container.image.jib.deployment.JibProcessor] Base image 'fabric8/java-alpine-openjdk11-jre' does not use a specific image digest - build may not be reproducible
[INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] The base image requires auth. Trying again for fabric8/java-alpine-openjdk11-jre...
[INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] Using base image with digest: sha256:b459cc59d6c7ddc9fd52f981fc4c187f44a401f2433a1b4110810d2dd9e98a07
[INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] Container entrypoint set to [java, -Djava.util.logging.manager=org.jboss.logmanager.LogManager, -jar, quarkus-run.jar]
[INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] Created container image rupinder/kubernetes-quickstart:1.0.0-SNAPSHOT (sha256:e38bb06aadc5651c73ae9390df6df78e047f0df858bfb82879b624b9b1cbde55)

[INFO] [io.quarkus.kubernetes.deployment.KubernetesDeployer] Deploying to knative server: https://127.0.0.1:44069/ in namespace: default.
[INFO] [io.quarkus.kubernetes.deployment.KubernetesDeployer] Applied: Service kubernetes-quickstart.
[INFO] [io.quarkus.kubernetes.deployment.KubernetesDeployer] Applied: ConfigMap config-autoscaler.
[INFO] [io.quarkus.deployment.QuarkusAugmentor] Quarkus augmentation completed in 11938ms
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  19.295 s
[INFO] Finished at: 2021-09-18T20:31:26+05:30
[INFO] ------------------------------------------------------------------------

$ kn revisions list
NAME                          SERVICE                 TRAFFIC   TAGS   GENERATION   AGE   CONDITIONS   READY   REASON
kubernetes-quickstart-00001   kubernetes-quickstart                    1            97s   0 OK / 3     False   ContainerMissing : Unable to fetch image "rupi ...

Thanks and regards
Rupinder

Rupinder Singh

unread,
Oct 9, 2021, 2:06:24 PM10/9/21
to Ioannis Canellos, Quarkus Development mailing list
Hi,

I have now Knative on minikube as well. The hello-world service tested ok. Now I have tried with Quarkus 2.3.0.Final.

The application properties are
quarkus.kubernetes.deployment-target=knative

quarkus.kubernetes-client.trust-certs=true

I didn't have to specify API server url this time. I get the same status/error as with kind. 

False   ContainerMissing : Unable to fetch image "rupi ..

Building jar: /home/rupinder/mswork/quarkus-guides/kubernetes_quickstart/Trial_with_knative_2.3.0.Final/kubernetes-quickstart/target/kubernetes-quickstart-1.0.0-SNAPSHOT.jar
[INFO]
[INFO] --- quarkus-maven-plugin:2.3.0.Final:build (default) @ kubernetes-quickstart ---
[INFO] [org.jboss.threads] JBoss Threads version 3.4.2.Final

[WARNING] [io.quarkus.kubernetes.deployment.KubernetesDeployer] A Kubernetes deployment was requested, but the container image to be built will not be pushed to any registry because "quarkus.container-image.registry" has not been set. The Kubernetes deployment will only work properly if the cluster is using the local Docker daemon. For that reason 'ImagePullPolicy' is being force-set to 'IfNotPresent'.
[INFO] Checking for existing resources in: /home/rupinder/mswork/quarkus-guides/kubernetes_quickstart/Trial_with_knative_2.3.0.Final/kubernetes-quickstart/src/main/kubernetes.
[INFO] [io.quarkus.kubernetes.deployment.KubernetesDeploy] Kubernetes API Server at 'https://192.168.39.40:8443/' successfully contacted.

[INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] Starting container image build
[WARNING] [io.quarkus.container.image.jib.deployment.JibProcessor] Base image 'fabric8/java-alpine-openjdk11-jre' does not use a specific image digest - build may not be reproducible
[INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] The base image requires auth. Trying again for fabric8/java-alpine-openjdk11-jre...
[INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] Using base image with digest: sha256:b459cc59d6c7ddc9fd52f981fc4c187f44a401f2433a1b4110810d2dd9e98a07
[INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] Container entrypoint set to [java, -Djava.util.logging.manager=org.jboss.logmanager.LogManager, -jar, quarkus-run.jar]
[INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] Created container image rupinder/kubernetes-quickstart:1.0.0-SNAPSHOT (sha256:073ea9b17c6f1f99ae62273a3bcd3c90bfd9067e59fcb11bd5dd85a1d009472f)

[INFO] [io.quarkus.kubernetes.deployment.KubernetesDeployer] Deploying to knative server: https://192.168.39.40:8443/ in namespace: default.

[INFO] [io.quarkus.kubernetes.deployment.KubernetesDeployer] Applied: Service kubernetes-quickstart.
[INFO] [io.quarkus.kubernetes.deployment.KubernetesDeployer] Applied: ConfigMap config-autoscaler.
[INFO] [io.quarkus.deployment.QuarkusAugmentor] Quarkus augmentation completed in 9967ms

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  17.643 s
[INFO] Finished at: 2021-10-09T23:20:51+05:30
[INFO] ------------------------------------------------------------------------

kn revisions list
NAME                          SERVICE                 TRAFFIC   TAGS   GENERATION   AGE     CONDITIONS   READY   REASON

hello-world7                  hello                          100%                             7                                    120m                             3 OK / 4              True    

kubernetes-quickstart-00001   kubernetes-quickstart                    1                      7m48s           0 OK / 3              False   ContainerMissing : Unable to fetch image "rupi ..

Could you advise?

regards
Rupinder

Ioannis Canellos

unread,
Oct 9, 2021, 2:23:00 PM10/9/21
to Rupinder Singh, Quarkus Development mailing list
I think that before running the build you need to run:

eval $(minkube docker-env) so that the image can be found by minkube. 

Rupinder Singh

unread,
Oct 9, 2021, 3:16:39 PM10/9/21
to Ioannis Canellos, Quarkus Development mailing list
Hi

I did that. Rarely miss it :) And have now repeated it and the build. I get the same error.

Among others, the image seems to have been built.

docker images
REPOSITORY                                                               TAG              IMAGE ID       CREATED             SIZE
rupinder/kubernetes-quickstart                                           1.0.0-SNAPSHOT   998656b06a15   3 minutes ago       203MB

regards
Rupinder


Reply all
Reply to author
Forward
0 new messages