You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "bouskaJ (via GitHub)" <gi...@apache.org> on 2023/04/06 13:27:26 UTC

[GitHub] [camel-k] bouskaJ opened a new issue, #4236: Integration builder can't pull the builder image from the insecure registry

bouskaJ opened a new issue, #4236:
URL: https://github.com/apache/camel-k/issues/4236

   I am working with the local Kind cluster and insecure registry.
   My IntegrationPlatform contains
   ```
    registry:
           address: kind-registry:5000
           insecure: true
   ```
   the operator is able to build and push the builder image to the registry
   ```
   kubectl logs camel-k-operator-588484997d-bbl6f -n global | grep builder                 
   {"level":"info","ts":1680783542.057215,"logger":"camel-k.controller.catalog","msg":"spectrum - 2023/04/06 12:19:02 Pushing image kind-registry:5000/camel-k-runtime-quarkus-builder:3.20.1-snapshot (insecure=true)..."}
   ```
   
   Then I try to run the integration. The Build CR is generated with correct configuration (including the `insecure` tag).
   ```
   kubectl get Build -n test -o yaml
   
   - spectrum:
           baseImage: docker.io/eclipse-temurin:11
           image: kind-registry:5000/test/camel-k-kit-cgnbtkmpn0ns73dn95j0:39242
           name: spectrum
           registry:
             address: kind-registry:5000
             insecure: true
       timeout: 5m0s
       toolImage: kind-registry:5000/camel-k-runtime-quarkus-builder:3.20.1-snapshot
   ```
   but the builder pod fails with
   ```
   kubectl get pods -n test
   NAME                                       READY   STATUS                  RESTARTS   AGE
   camel-k-kit-cgnbtkmpn0ns73dn95j0-builder   0/1     Init:ImagePullBackOff   0          35m
   
   kubectl get pod camel-k-kit-cgnbtkmpn0ns73dn95j0-builder -o yaml -n test
   
         state:
           waiting:
             message: 'rpc error: code = Unknown desc = failed to pull and unpack image
               "kind-registry:5000/camel-k-runtime-quarkus-builder:3.20.1-snapshot":
               failed to resolve reference "kind-registry:5000/camel-k-runtime-quarkus-builder:3.20.1-snapshot":
               failed to do request: Head "https://kind-registry:5000/v2/camel-k-runtime-quarkus-builder/manifests/3.20.1-snapshot":
               http: server gave HTTP response to HTTPS client'
             reason: ErrImagePull
       phase: Pending
       podIP: 10.244.0.40
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] essobedo commented on issue #4236: Integration builder can't pull the builder image from the insecure registry

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on issue #4236:
URL: https://github.com/apache/camel-k/issues/4236#issuecomment-1499079203

   Which local cluster do you use?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] essobedo commented on issue #4236: Integration builder can't pull the builder image from the insecure registry

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on issue #4236:
URL: https://github.com/apache/camel-k/issues/4236#issuecomment-1499374209

   Have you configured `kind-registry:5000` as `insecure-registries` following this doc https://docs.docker.com/registry/insecure/#deploy-a-plain-http-registry?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] bouskaJ commented on issue #4236: Integration builder can't pull the builder image from the insecure registry

Posted by "bouskaJ (via GitHub)" <gi...@apache.org>.
bouskaJ commented on issue #4236:
URL: https://github.com/apache/camel-k/issues/4236#issuecomment-1499081177

   It's a [kind](https://kind.sigs.k8s.io/) cluster.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] lfabriko commented on issue #4236: Integration builder can't pull the builder image from the insecure registry

Posted by "lfabriko (via GitHub)" <gi...@apache.org>.
lfabriko commented on issue #4236:
URL: https://github.com/apache/camel-k/issues/4236#issuecomment-1543818912

   I reproduced your setup, proposal of documentation: https://github.com/apache/camel-k/pull/4363


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] bouskaJ commented on issue #4236: Integration builder can't pull the builder image from the insecure registry

Posted by "bouskaJ (via GitHub)" <gi...@apache.org>.
bouskaJ commented on issue #4236:
URL: https://github.com/apache/camel-k/issues/4236#issuecomment-1499365859

   Fedora release 34


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] bouskaJ commented on issue #4236: Integration builder can't pull the builder image from the insecure registry

Posted by "bouskaJ (via GitHub)" <gi...@apache.org>.
bouskaJ commented on issue #4236:
URL: https://github.com/apache/camel-k/issues/4236#issuecomment-1500016615

   as you can see in the log I a have problem with communication with the registry, not pulling the images
   ```
   message: 'rpc error: code = Unknown desc = failed to pull and unpack image
               "kind-registry:5000/camel-k-runtime-quarkus-builder:3.20.1-snapshot":
               failed to resolve reference "kind-registry:5000/camel-k-runtime-quarkus-builder:3.20.1-snapshot":
               failed to do request: Head "https://kind-registry:5000/v2/camel-k-runtime-quarkus-builder/manifests/3.20.1-snapshot":
               http: server gave HTTP response to HTTPS client'
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] essobedo commented on issue #4236: Integration builder can't pull the builder image from the insecure registry

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on issue #4236:
URL: https://github.com/apache/camel-k/issues/4236#issuecomment-1499619715

   No, it is not enough. This parameter is used by the operator to communicate with the registry but it has no effect on how K8s pull the images.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] bouskaJ commented on issue #4236: Integration builder can't pull the builder image from the insecure registry

Posted by "bouskaJ (via GitHub)" <gi...@apache.org>.
bouskaJ commented on issue #4236:
URL: https://github.com/apache/camel-k/issues/4236#issuecomment-1500504811

   Great. It works! It would be great to add a DOC for that config. Thank you for your help.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] essobedo commented on issue #4236: Integration builder can't pull the builder image from the insecure registry

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on issue #4236:
URL: https://github.com/apache/camel-k/issues/4236#issuecomment-1500118998

   Related to https://github.com/kubernetes-sigs/kind/issues/110


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] essobedo commented on issue #4236: Integration builder can't pull the builder image from the insecure registry

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on issue #4236:
URL: https://github.com/apache/camel-k/issues/4236#issuecomment-1499088405

   Would you mind describing step by step what you did so far? BTW which OS?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] essobedo commented on issue #4236: Integration builder can't pull the builder image from the insecure registry

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on issue #4236:
URL: https://github.com/apache/camel-k/issues/4236#issuecomment-1500109676

   Yeah, I know but this error typically happens when kubelet tries to pull a docker image from an insecure registry without knowing it is an insecure registry.
   
   I could reproduce your problem and confirm that following this doc page https://docs.docker.com/registry/insecure/#deploy-a-plain-http-registry doesn't help, it is really internal to kind.
   
   To make it work properly, I had to change the script for this:
   ```
   #!/bin/sh
   set -o errexit
   
   # create registry container unless it already exists
   reg_name='kind-registry'
   reg_port='5001'
   if [ "$(docker inspect -f '{{.State.Running}}' "${reg_name}" 2>/dev/null || true)" != 'true' ]; then
     docker run \
       -d --restart=always -p "127.0.0.1:${reg_port}:5000" --name "${reg_name}" \
       registry:2
   fi
   
   # create a cluster with the local registry enabled in containerd
   cat <<EOF | kind create cluster --config=-
   kind: Cluster
   apiVersion: kind.x-k8s.io/v1alpha4
   containerdConfigPatches:
   - |-
     [plugins."io.containerd.grpc.v1.cri".registry.mirrors."${reg_name}:5000"]
       endpoint = ["http://${reg_name}:5000"]
   EOF
   
   # connect the registry to the cluster network if not already connected
   if [ "$(docker inspect -f='{{json .NetworkSettings.Networks.kind}}' "${reg_name}")" = 'null' ]; then
     docker network connect "kind" "${reg_name}"
   fi
   
   # Document the local registry
   # https://github.com/kubernetes/enhancements/tree/master/keps/sig-cluster-lifecycle/generic/1755-communicating-a-local-registry
   cat <<EOF | kubectl apply -f -
   apiVersion: v1
   kind: ConfigMap
   metadata:
     name: local-registry-hosting
     namespace: kube-public
   data:
     localRegistryHosting.v1: |
       host: "${reg_name}:5000"
       help: "https://kind.sigs.k8s.io/docs/user/local-registry/"
   EOF
   ```
   
   The most significant change here is the way to configure the registry mirrors, I changed `localhost:${reg_port}` for `${reg_name}:5000`, this will indirectly indicate `kubelet` to pull the images from `${reg_name}:5000` using the HTTP protocol instead of HTTPS by default.
   I also change the ConfigMap but it is only meant for documentation so it is not really important.
   
   Then your command to install kamel is `kamel install --olm=false --maven-repository=https://repository.apache.org/content/repositories/snapshots@id=apache-snapshots@snapshots --operator-image kind-registry:5000/apache/camel-k:2.0.0-SNAPSHOT  --registry kind-registry:5000 --registry-insecure -n test`.
   
   Please try it and tell me if it works on your side, and if so I will add some doc as a fix for this PR.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] bouskaJ commented on issue #4236: Integration builder can't pull the builder image from the insecure registry

Posted by "bouskaJ (via GitHub)" <gi...@apache.org>.
bouskaJ commented on issue #4236:
URL: https://github.com/apache/camel-k/issues/4236#issuecomment-1499440883

   according to the DOC the `insecure` should be enough (https://camel.apache.org/camel-k/1.12.x/apis/camel-k.html#_camel_apache_org_v1_RegistrySpec). @gansheer @squakez can you confirm that?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] bouskaJ commented on issue #4236: Integration builder can't pull the builder image from the insecure registry

Posted by "bouskaJ (via GitHub)" <gi...@apache.org>.
bouskaJ commented on issue #4236:
URL: https://github.com/apache/camel-k/issues/4236#issuecomment-1499112451

   1. I created the cluster using this script https://kind.sigs.k8s.io/docs/user/local-registry/
   2. Buit the operator image from the `main` branch using `make images` and push it to the kind registry
   3. install the operator to the namespace `kamel install --olm=false --maven-repository=https://repository.apache.org/content/repositories/snapshots@id=apache-snapshots@snapshots --operator-image localhost:5001/apache/camel-k:2.0.0-SNAPSHOT  --registry kind-registry:5000 --registry-insecure -n test`
   4. run the workload `kamel run Java.java`
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] essobedo commented on issue #4236: Integration builder can't pull the builder image from the insecure registry

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on issue #4236:
URL: https://github.com/apache/camel-k/issues/4236#issuecomment-1499145024

   And which OS?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] squakez closed issue #4236: Integration builder can't pull the builder image from the insecure registry

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez closed issue #4236: Integration builder can't pull the builder image from the insecure registry
URL: https://github.com/apache/camel-k/issues/4236


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org