Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MicroK8s' built-in registry declared for the Camel K installation, but not used - integration installations fail #1376

Closed
bthj opened this issue Mar 26, 2020 · 8 comments
Labels
area/build-operator Related to the internal image build operator status/stale
Milestone

Comments

@bthj
Copy link

bthj commented Mar 26, 2020

Installing Camel K to a local MicroK8s cluster with

kamel install --registry-insecure true --registry localhost:32000 --kaniko-build-cache=false --force --wait --example

successfully installs the camel-k-operator but the example integration installed with the --example flag fails to build, with those messages:

$ kubectl logs -f camel-k-kit-bpu91bq2032o5jv6daig-builder
STEP 1: FROM adoptopenjdk/openjdk8:slim
Getting image source signatures
Copying blob sha256:24e9ea251047e2f8f6e81eee2c7468307906b95d988f92039c6e13a6d764ae3e
Copying blob sha256:f11b29a9c7306674a9479158c1b4259938af11b97359d9ac02030cc1095e9ed1
Copying blob sha256:5bed26d33875e6da1d9ff9a1054c5fef3bbeb22ee979e14b72acf72528de007b
Copying blob sha256:930bda195c84cf132344bf38edcad255317382f910503fef234a9ce3bff0f4dd
Copying blob sha256:022f48766a856d5901451ec6d39fd887807f9c3fa64dd45dabaa935ba70561e7
Copying blob sha256:78bf9a5ad49e4ae42a83f4995ade4efc096f78fd38299cf05bc041e8cdda2a36
Copying blob sha256:0a5ab47c17c313991b8420037ab81f08ca958498b4331e2a352e530019f42b05
Copying config sha256:2d20634b71d274c9aa0c13463b0c92f177cc8a5b1ee5e5947f8b14e2045ba014
Writing manifest to image destination
Storing signatures
level=error msg="Error while applying layer: ApplyLayer exit status 1 stdout:  stderr: permission denied"
error creating build container: The following failures happened while trying to pull image specified by "adoptopenjdk/openjdk8:slim" based on search registries in /etc/containers/registries.conf:
* "localhost/adoptopenjdk/openjdk8:slim": Error initializing source docker://localhost/adoptopenjdk/openjdk8:slim: error pinging docker registry localhost: Get http://localhost/v2/: dial tcp [::1]:80: connect: connection refused
* "docker.io/adoptopenjdk/openjdk8:slim": Error committing the finished image: error adding layer with blob "sha256:5bed26d33875e6da1d9ff9a1054c5fef3bbeb22ee979e14b72acf72528de007b": ApplyLayer exit status 1 stdout:  stderr: permission denied
* "registry.fedoraproject.org/adoptopenjdk/openjdk8:slim": Error initializing source docker://registry.fedoraproject.org/adoptopenjdk/openjdk8:slim: Error reading manifest slim in registry.fedoraproject.org/adoptopenjdk/openjdk8: manifest unknown: manifest unknown
* "registry.access.redhat.com/adoptopenjdk/openjdk8:slim": Error initializing source docker://registry.access.redhat.com/adoptopenjdk/openjdk8:slim: Error reading manifest slim in registry.access.redhat.com/adoptopenjdk/openjdk8: name unknown: Repo not found
* "registry.centos.org/adoptopenjdk/openjdk8:slim": Error initializing source docker://registry.centos.org/adoptopenjdk/openjdk8:slim: Error reading manifest slim in registry.centos.org/adoptopenjdk/openjdk8: manifest unknown: manifest unknown
* "quay.io/adoptopenjdk/openjdk8:slim": Error initializing source docker://quay.io/adoptopenjdk/openjdk8:slim: Error reading manifest slim in quay.io/adoptopenjdk/openjdk8: unauthorized: access to the requested resource is not authorized
level=error msg="exit status 1"

MicroK8s' built-in registry is referenced in the kamel install command with the flags --registry-insecure true --registry localhost:32000 and that registry has proven to be up and running properly for other deployments.

According to the log output, the registry declared with the installation flags isn't being called, but rather http://localhost/v2/(so not localhost on port 32000 as desired).

Is there something I need to add to the Camel K installation command?

@bthj bthj changed the title Local insecure registry declared but not used - integration installations fail MicroK8s' built-in registry declared for the Camel K installation, but not used - integration installations fail Mar 26, 2020
@PhilAndrew
Copy link

Hi @bthj have you been able to get camel-k to run with MicroK8S? I had the same problem, but I would like the two to work together.

@astefanutti astefanutti added the area/build-operator Related to the internal image build operator label Jul 21, 2020
@lsalotto-ingenia
Copy link

lsalotto-ingenia commented Nov 11, 2020

Hi all, any updates on this? Did any of you got this working?

@nicolaferraro nicolaferraro added this to the 1.3.0 milestone Nov 12, 2020
@bthj
Copy link
Author

bthj commented Nov 12, 2020

Hi - haven't had an opportunity to look further into this.

@nicolaferraro nicolaferraro modified the milestones: 1.3.0, 1.4.0 Dec 22, 2020
@nicolaferraro nicolaferraro modified the milestones: 1.4.0, 1.5.0 Apr 13, 2021
@nicolaferraro nicolaferraro modified the milestones: 1.5.0, 1.6.0 Jul 5, 2021
@nicolaferraro nicolaferraro modified the milestones: 1.6.0, 1.7.0 Sep 7, 2021
@ReggieCarey
Copy link

I just tried to install on MicroK8s and it complained initially.

However I attempted the following and it appears to have worked:

$ kamel install --registry-insecure true --registry localhost:32000/v1
OLM is not available in the cluster. Fallback to regular installation.
Camel K installed in namespace default 

$ kubectl get all
NAME                                    READY   STATUS    RESTARTS   AGE
pod/camel-k-operator-7bb969fb8b-t4jqd   1/1     Running   0          108s

NAME                 TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)   AGE
service/kubernetes   ClusterIP   10.152.183.1   <none>        443/TCP   17h

NAME                               READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/camel-k-operator   1/1     1            1           108s

NAME                                          DESIRED   CURRENT   READY   AGE
replicaset.apps/camel-k-operator-7bb969fb8b   1         1         1       108s

@tadayosi
Copy link
Member

tadayosi commented Oct 8, 2021

@ReggieCarey What happens if you run some example app with the operator? The original issue is when you run some app on MicroK8s. Thanks.

@ReggieCarey
Copy link

ReggieCarey commented Oct 12, 2021 via email

@johnpoth
Copy link
Member

Ah yes I think this happens because both camel-k and the container runtime (so containerd in this case) need to access the image registry in a unified way. While using localhost:32000 will work locally and for containerd, it will not work in the pod camel-k runs in.

One easy way to to reach the image registry from the camel-k pod is to use the image registry's ClusterIP set in it's Service, so something like:

$kubectl get service registry -n container-registry -o yaml
apiVersion: v1
kind: Service
...
  clusterIP: 10.152.183.32
  clusterIPs:
  - 10.152.183.32

Now using 10.152.183.32:5000 will work in the pod camel-k is running on so pushing images will work. However containerd won't be able to pull images and create integration pods. It will try to use https and complain.

To setup containerd to use 10.152.183.32:5000 as an insecure registry, one can edit it's configuration file. When MicroK8s is installed with snap it is located under /var/snap/microk8s/current/args/containerd-template.toml more info here. You can then simply add:

[plugins."io.containerd.grpc.v1.cri".registry.mirrors."10.152.183.32:5000"]
        endpoint = ["http://10.152.183.32:5000"]

Then restart MicroK8s as stated in the docs. Then camel-k can be installed properly with (replace with your registry's ClusterIP)

kamel install --registry="10.152.183.32:5000" --registry-insecure=true

I just tested locally and I'm able to run integrations successfully.

HTH !

ps: it might cool to write a doc about installing camel-k on MicroK8s if people are interested

@nicolaferraro nicolaferraro modified the milestones: 1.7.0, 1.8.0 Nov 15, 2021
@oscerd oscerd modified the milestones: 1.8.0, 1.9.0 Jan 19, 2022
@github-actions
Copy link
Contributor

This issue has been automatically marked as stale due to 90 days of inactivity.
It will be closed if no further activity occurs within 15 days.
If you think that’s incorrect or the issue should never stale, please simply write any comment.
Thanks for your contributions!

@oscerd oscerd modified the milestones: 1.9.0, 1.9.1 Apr 26, 2022
@oscerd oscerd modified the milestones: 1.9.1, 1.9.2 May 13, 2022
@oscerd oscerd modified the milestones: 1.9.2, 2.0.0 May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build-operator Related to the internal image build operator status/stale
Projects
None yet
Development

No branches or pull requests

9 participants