Claudio Miranda created CAMEL-21935:
---------------------------------------
Summary: kubernetes plugin fails to run when
knative-service.enabled=true in openshift
Key: CAMEL-21935
URL: https://issues.apache.org/jira/browse/CAMEL-21935
Project: Camel
Issue Type: Bug
Components: camel-jbang
Affects Versions: 4.11.0
Environment: Camel 4.11.0-SNAPSHOT
Openshift 4.18.4
Reporter: Claudio Miranda
camel-jbang-plugin-kubernetes fails to run a http consumer as knative-service
in openshift with knative installed.
Given the route
{code}
public class HttpLog extends RouteBuilder {
@Override
public void configure() throws Exception {
from("platform-http:/hello?httpMethodRestrict=GET")
.setBody(simple("Hello ${header.name}"))
.log("${header.name}");
}
}
{code}
the run command
{code}
camel kubernetes run --verbose HttpLog.java --trait knative-service.enabled=true
{code}
It correctly detects as openshift to build the image and deploys it
{code}
Automatic kubernetes cluster detection... OPENSHIFT
Exporting application ...
OpenShift forcing --image-builder=docker
Generating fresh run data
from other console: curl -H name:World http://localhost:8080/hello
Exporting as Quarkus project to: .camel-jbang-run/http-log
Building Kubernetes manifest ...
from other console: curl -H name:World http://localhost:8080/hello
Project export successful!
Deploying to OPENSHIFT ...
Run: .camel-jbang-run/http-log/mvnw -ntp --file .camel-jbang-run/http-log
-Djkube.jib.push=true -Djkube.skip.push=false -Djkube.skip.resource=true
oc:build oc:apply -Djkube.openshiftManifest=src/main/jkube/service.yml
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< org.example.project:http-log >--------------------
[INFO] Building http-log 1.0-SNAPSHOT
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- oc:1.18.1:build (default-cli) @ http-log ---
[INFO] oc: Using OpenShift build with strategy Docker
[INFO] oc: [http-log:1.0-SNAPSHOT]: Created docker source tar
/home/claudio/alphaworks/outros/camel-spring-boot-examples/infinispan/.camel-jbang-run/http-log/target/docker/http-log/1.0-SNAPSHOT/tmp/docker-build.tar
[INFO] oc: Updating BuildServiceConfig http-log-s2i for Docker strategy
[INFO] oc: Adding to ImageStream http-log
[INFO] oc: Starting Build http-log-s2i
[INFO] oc: Waiting for build http-log-s2i-2 to complete...
[INFO] oc: Receiving source from STDIN as archive ...
[INFO] oc: Replaced Dockerfile FROM image eclipse-temurin:17
[INFO] oc: time="2025-04-03T11:22:14Z" level=info msg="Not using native diff
for overlay, this may cause degraded performance for building images: kernel
has CONFIG_OVERLAY_FS_REDIRECT_DIR enabled"
[INFO] oc: I0403 11:22:14.123365 1 defaults.go:112] Defaulting to storage
driver "overlay" with options [mountopt=metacopy=on].
[INFO] oc: Caching blobs under "/var/cache/blobs".
[INFO] oc:
[INFO] oc: Pulling image eclipse-temurin:17 ...
[INFO] oc: Resolving "eclipse-temurin" using unqualified-search registries
(/var/run/configs/openshift.io/build-system/registries.conf)
[INFO] oc: Trying to pull registry.redhat.io/eclipse-temurin:17...
[INFO] oc: Trying to pull registry.access.redhat.com/eclipse-temurin:17...
[INFO] oc: Trying to pull quay.io/eclipse-temurin:17...
[INFO] oc: Trying to pull docker.io/library/eclipse-temurin:17...
[INFO] oc: Getting image source signatures
[INFO] oc: Copying blob
sha256:3d2700d3f64bcbf1b67ccf65a715330aa34cb16c0c1e8c9146c15011233d6fc4
[INFO] oc: Copying blob
sha256:5a7813e071bfadf18aaa6ca8318be4824a9b6297b3240f2cc84c1db6f4113040
[INFO] oc: Copying blob
sha256:0b4fff2c206cae13745f200704b38134105ac3a4bcf862dc0d04d08f6aa9d2ce
[INFO] oc: Copying blob
sha256:a2ff804eb32a079e6f9a54eb31c0f43d9d6c56fc09c7735ec59e2ad948fc6af6
[INFO] oc: Copying blob
sha256:da5768705e3b7e7e3c61f95a6ed0478a61076d084e1adedfe24e09ce95d5c433
[INFO] oc: Copying config
sha256:3003266067237a5e9757aa2256c9b253e916822545cc4c14d593c59cfb35a8da
[INFO] oc: Writing manifest to image destination
[INFO] oc: Adding transient rw bind mount for /run/secrets/rhsm
[INFO] oc: STEP 1/5: FROM eclipse-temurin:17
[INFO] oc: STEP 2/5: COPY /entrypoint/maven /maven/
[INFO] oc: --> d4c3dabf3294
[INFO] oc: STEP 3/5: ENTRYPOINT ["/maven/quarkus/run-java.sh","run"]
[INFO] oc: --> 5ecd9cfc4907
[INFO] oc: STEP 4/5: ENV "OPENSHIFT_BUILD_NAME"="http-log-s2i-2"
"OPENSHIFT_BUILD_NAMESPACE"="cmiranda-dev"
[INFO] oc: --> 2044b1fe8ac6
[INFO] oc: STEP 5/5: LABEL "io.openshift.build.name"="http-log-s2i-2"
"io.openshift.build.namespace"="cmiranda-dev"
[INFO] oc: COMMIT temp.builder.openshift.io/cmiranda-dev/http-log-s2i-2:721358c9
[INFO] oc: --> b7329dd6adbd
[INFO] oc: Successfully tagged
temp.builder.openshift.io/cmiranda-dev/http-log-s2i-2:721358c9
[INFO] oc: b7329dd6adbdd0d0c92ba52767d994371ea2e7c354249748c6d921e013b28af7
[INFO] oc:
[INFO] oc: Pushing image
image-registry.openshift-image-registry.svc:5000/cmiranda-dev/http-log:1.0-SNAPSHOT
...
[INFO] oc: Getting image source signatures
[INFO] oc: Copying blob
sha256:5a7813e071bfadf18aaa6ca8318be4824a9b6297b3240f2cc84c1db6f4113040
[INFO] oc: Copying blob
sha256:4a02bcac97d26e818a6321a1cce31db068c160d807a9e301c152813c1061704f
[INFO] oc: Copying blob
sha256:da5768705e3b7e7e3c61f95a6ed0478a61076d084e1adedfe24e09ce95d5c433
[INFO] oc: Copying blob
sha256:3d2700d3f64bcbf1b67ccf65a715330aa34cb16c0c1e8c9146c15011233d6fc4
[INFO] oc: Copying blob
sha256:0b4fff2c206cae13745f200704b38134105ac3a4bcf862dc0d04d08f6aa9d2ce
[INFO] oc: Copying blob
sha256:a2ff804eb32a079e6f9a54eb31c0f43d9d6c56fc09c7735ec59e2ad948fc6af6
[INFO] oc: Copying config
sha256:b7329dd6adbdd0d0c92ba52767d994371ea2e7c354249748c6d921e013b28af7
[INFO] oc: Writing manifest to image destination
[INFO] oc: Successfully pushed
image-registry.openshift-image-registry.svc:5000/cmiranda-dev/http-log@sha256:947dd1587d000e8ceef93af931f9b051142c68aaafdb0d132078d390caae5ef0
[INFO] oc: Push successful
[INFO] oc: Build http-log-s2i-2 in status Complete
[INFO] oc: Found tag on ImageStream http-log tag:
sha256:947dd1587d000e8ceef93af931f9b051142c68aaafdb0d132078d390caae5ef0
[INFO] oc: ImageStream http-log written to
/home/claudio/alphaworks/outros/camel-spring-boot-examples/infinispan/.camel-jbang-run/http-log/target/http-log-is.yml
[INFO]
[INFO] --- oc:1.18.1:apply (default-cli) @ http-log ---
[INFO] oc: OpenShift platform detected
[INFO] oc: Using OpenShift at https://api.rm1.0a51.p1.openshiftapps.com:6443/
in namespace null with manifest
/home/claudio/alphaworks/outros/camel-spring-boot-examples/infinispan/.camel-jbang-run/http-log/src/main/jkube/service.yml
[INFO] oc: Created Custom Resource: serving.knative.dev/v1#Service
cmiranda-dev/http-log
[INFO] oc: HINT: Use the command `oc get pods -w` to watch your pods start up
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 36.284 s
[INFO] Finished at: 2025-04-03T12:22:41+01:00
[INFO] ------------------------------------------------------------------------
{code}
However the knative-service fails with:
{code}
Revision "http-log-00001" failed with message: Unable to fetch image
"http-log:1.0-SNAPSHOT": failed to resolve image to digest: HEAD
https://index.docker.io/v2/library/http-log/manifests/1.0-SNAPSHOT: unexpected
status code 401 Unauthorized (HEAD responses have no body, use GET for details).
{code}
The knative-service manifest
{code}
k get service.serving.knative.dev/http-log -oyaml
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
annotations:
serving.knative.dev/creator: cmiranda
serving.knative.dev/lastModifier: cmiranda
creationTimestamp: "2025-04-03T11:22:41Z"
generation: 1
labels:
app: http-log
app.kubernetes.io/managed-by: camel-jbang
app.kubernetes.io/name: http-log
app.kubernetes.io/version: 1.0-SNAPSHOT
bindings.knative.dev/include: "true"
provider: jkube
version: 1.0-SNAPSHOT
name: http-log
namespace: cmiranda-dev
resourceVersion: "788810180"
uid: af103deb-8cb1-42b8-a18d-da377e43dd91
spec:
template:
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/name: http-log
spec:
containerConcurrency: 0
containers:
- image: http-log:1.0-SNAPSHOT
name: http-log
ports:
- containerPort: 8080
name: h2c
protocol: TCP
readinessProbe:
successThreshold: 1
tcpSocket:
port: 0
resources: {}
enableServiceLinks: false
timeoutSeconds: 300
traffic:
- latestRevision: true
percent: 100
status:
conditions:
- lastTransitionTime: "2025-04-03T11:22:41Z"
message: 'Revision "http-log-00001" failed with message: Unable to fetch
image
"http-log:1.0-SNAPSHOT": failed to resolve image to digest: HEAD
https://index.docker.io/v2/library/http-log/manifests/1.0-SNAPSHOT:
unexpected status code 401 Unauthorized (HEAD responses have no body, use
GET
for details).'
reason: RevisionFailed
status: "False"
type: ConfigurationsReady
- lastTransitionTime: "2025-04-03T11:22:41Z"
message: Configuration "http-log" does not have any ready Revision.
reason: RevisionMissing
status: "False"
type: Ready
- lastTransitionTime: "2025-04-03T11:22:41Z"
message: Configuration "http-log" does not have any ready Revision.
reason: RevisionMissing
status: "False"
type: RoutesReady
latestCreatedRevisionName: http-log-00001
observedGeneration: 1
url:
[https://http-log-cmiranda-dev.apps.rm1.0a51.p1.openshiftapps.com|https://http-log-cmiranda-dev.apps.rm1.0a51.p1.openshiftapps.com/]
{code}
The S2I build image is
{code}
image-registry.openshift-image-registry.svc:5000/cmiranda-dev/http-log@sha256:947dd1587d000e8ceef93af931f9b051142c68aaafdb0d132078d390caae5ef0
{code}
However this image address is not updated into the knative-service
{{spec.template.spec.containers.image}} manifest, this needs investigation.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)