quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.64k stars 2.65k forks source link

The `port` field is null in the generated Knative Service resources #32347

Open Sgitario opened 1 year ago

Sgitario commented 1 year ago

Describe the bug

Given a Quarkus application that includes the Quarkus Kubernetes and Smallrye Heatlh extensions, when generating the Knative manifests:

quarkus.kubernetes.deployment-target=knative

The generated Knative service does not set the port in the probes:

---
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  ...
  name: example
spec:
  template:
    spec:
      containers:
        - image: ...
          imagePullPolicy: Always
          livenessProbe:
            failureThreshold: 3
            httpGet:
              path: /q/health/live
              port: null
              scheme: HTTP
            initialDelaySeconds: 5
            periodSeconds: 10
            successThreshold: 1
            timeoutSeconds: 10
          name: example
          ports:
            - containerPort: 8080
              name: http1
              protocol: TCP
          readinessProbe:
            failureThreshold: 3
            httpGet:
              path: /q/health/ready
              port: null
              scheme: HTTP
            initialDelaySeconds: 5
            periodSeconds: 10
            successThreshold: 1
            timeoutSeconds: 10
          startupProbe:
            failureThreshold: 3
            httpGet:
              path: /q/health/started
              port: null
              scheme: HTTP

For Kubernetes deployment, the port is set in the Deployment resources as expected.

Also, adding the property quarkus.knative.liveness-probe.http-action-port=8888 does not seem to take any effect.

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

quarkus-bot[bot] commented 1 year ago

/cc @geoand (knative,kubernetes), @iocanel (knative,kubernetes)

Sgitario commented 1 year ago

It seems that this has been working like this for ages. @iocanel do you have any more context about why the port must be null in the Knative resources?

From Knative Serving 1.3, users can provide a different port number for the readiness probe. And also, the readiness/liveness/startup probe configuration should not be part of the Knative config.