appsody / appsody-operator

An Operator for deploying Appsody based applications to Kubernetes. This repo will be archived soon.
Apache License 2.0
18 stars 15 forks source link

appsody operator fails to deploy with knative enabled #183

Open dacleyra opened 4 years ago

dacleyra commented 4 years ago

Bug Report

What did you do?

Deploy default java-microprofile stack application using kabanero collection, with knative enabled https://github.com/kabanero-io/sample-java-microprofile

What did you expect to see?

Successful appsodyapplication deploy

What did you see instead?

failure to deploy

Events:
  Type     Reason           Age                  From              Message
  ----     ------           ----                 ----              -------
  Warning  ProcessingError  6m49s (x8 over 14m)  appsody-operator  Internal error occurred: admission webhook "webhook.serving.knative.dev" denied the request: mutation failed: expected 1 <= 0 <= 2147483647: spec.template.spec.containers[0].readinessProbe.timeoutSeconds

NAME                                        DISPLAY                          VERSION              REPLACES                              PHASE
appsody-operator.v0.2.2                     Appsody Operator                 0.2.2                appsody-operator.v0.2.1               Succeeded
eclipse-che.v7.4.0                          Eclipse Che                      7.4.0                eclipse-che.v7.3.1                    Succeeded
elasticsearch-operator.4.2.1-201910221723   Elasticsearch Operator           4.2.1-201910221723                                         Succeeded
elasticsearch-operator.4.2.4-201911050122   Elasticsearch Operator           4.2.4-201911050122                                         Failed
jaeger-operator.v1.13.1                     Jaeger Operator                  1.13.1                                                     Succeeded
kabanero-operator.v0.3.0                    Kabanero Operator                0.3.0                                                      Succeeded
kiali-operator.v1.0.7                       Kiali Operator                   1.0.7                kiali-operator.v1.0.6                 Succeeded
knative-eventing-operator.v0.9.0            Knative Eventing Operator        0.9.0                knative-eventing-operator.v0.8.0      Succeeded
openshift-pipelines-operator.v0.7.0         OpenShift Pipelines Operator     0.7.0                openshift-pipelines-operator.v0.5.2   Succeeded
serverless-operator.v1.1.0                  OpenShift Serverless Operator    1.1.0                serverless-operator.v1.0.0            Succeeded
servicemeshoperator.v1.0.2                  Red Hat OpenShift Service Mesh   1.0.2                servicemeshoperator.v1.0.1            Succeeded

Environment

Client Version: v4.3.0 Server Version: 4.2.0 Kubernetes Version: v1.14.6+2e5ed54

Possible solution

Additional context

navidsh commented 4 years ago

The AppsodyApplication specifies readinessProbe.periodSeconds but not readinessProbe.timeoutSeconds and this is invalid according to Knative serving's admission webhook.

https://github.com/kabanero-io/sample-java-microprofile/blob/d996a7e859fdf0a63959d7afa29c2e8d24b6cd93/app-deploy.yaml#L56-L62

To solve this, you'd need to specify readinessProbe.timeoutSeconds:

  readinessProbe:
    failureThreshold: 12
    httpGet:
      path: /health/ready
      port: 9080
    initialDelaySeconds: 5
    periodSeconds: 2
    timeoutSeconds: 1
navidsh commented 4 years ago

Here is the Knative Serving code validating Knative service:

https://github.com/knative/serving/blob/6da659b889aa650b00af07223855a6da3b547c46/pkg/apis/serving/k8s_validation.go#L424-L459

arthurdm commented 4 years ago

@dacleyra - can you please try out navid's suggestion as a workaround to unblock this?

@navidsh / @leochr - can you please open an issue against the appsody stack template to make this update?

navidsh commented 4 years ago

@arthurdm Seems like all the stacks except experimental/java-spring-boot2-liberty in appsody/stacks added timeoutSeconds since yesterday. I'm working with the person made the changes to microprofile stack to see if they want us to open an issue for java-spring-boot2-liberty.

arthurdm commented 4 years ago

Is this issue still valid?