Giter VIP home page Giter VIP logo

Comments (5)

lsergio avatar lsergio commented on June 14, 2024 2

@mhd-robaii I think your issue is related to how the secret that is reference here was created:

    Registry:
      Address:        eu.gcr.io
      Insecure:       true
      Organization:   iot-staging-3
      Secret:         camel-k-builder

If you have done so using a command like this:

kubectl create secret generic camel-k-builder --from-file=your-key.json

you will get the authorization error, because that is not the format that Spectrum expects.

I had the same issue and fixed it by creating the secret like below:

kubectl create secret docker-registry camel-k-builder \
 --docker-server=gcr.io \
 --docker-username=_json_key \
 --docker-password="$(cat your-key.json)" \
 [email protected]

where the secret type is docker-registry and not generic.

The username and email can be any one, they're not really used, and the server should be adjusted for your registry.

from camel-k.

mhd-robaii avatar mhd-robaii commented on June 14, 2024 2

Thanks Sergio
now it works perfectly, the problem was that I created the key as generic (same as the key for kaniko).
After I download key.json from google is to join all the lines in the json into one row. For this I replaced cat with paste

kubectl create secret docker-registry camel-k-builder \
 --docker-server=https://eu.gcr.io \
 --docker-username=_json_key \
 --docker-password="$(paste -s gcp.json)" \
 [email protected]

from camel-k.

lsergio avatar lsergio commented on June 14, 2024

@mhd-robaii take a look at this issue I opened some time ago with the same problem: #4955
You will have to switch from Kaniko to other publish strategy

from camel-k.

mhd-robaii avatar mhd-robaii commented on June 14, 2024

Thanks Sergio, I would like to try Spectrum but I'm having trouble configuring it with gcp.
I followed the steps of the guide https://camel.apache.org/camel-k/next/installation/registry/gcr.html to create a new service-account and created the new secret.

kubectl describe IntegrationPlatform camel-k

Name:         camel-k
Namespace:    connectors
Labels:       app=camel-k
Annotations:  camel.apache.org/operator.id: camel-k
API Version:  camel.apache.org/v1
Kind:         IntegrationPlatform
Metadata:
  Creation Timestamp:  2024-03-07T17:52:55Z
  Generation:          1
  Resource Version:    375770020
  UID:                 d76b3b72
Spec:
  Build:
    Build Configuration:
    Maven:
      Settings:
      Settings Security:
    Publish Strategy:  Spectrum
    Registry:
      Address:       eu.gcr.io
      Insecure:      true
      Organization:  iot-staging-3
      Secret:        camel-k-builder
  Kamelet:
  Traits:
Status:
  Build:
    Publish Strategy Options:
      Kaniko Persistent Volume Claim:  camel-k
    Base Image:                        eclipse-temurin:17
    Build Configuration:
      Order Strategy:  sequential
      Strategy:        routine
    Maven:
      Cli Options:
        -V
        --no-transfer-progress
        -Dstyle.color=never
      Local Repository:  /etc/maven/m2
    Max Running Builds:  3
    Publish Strategy:    Spectrum
    Registry:
      Address:        eu.gcr.io
      Insecure:       true
      Organization:   iot-staging-3
      Secret:         camel-k-builder
    Runtime Version:  3.2.3
    Timeout:          5m0s
  Cluster:            Kubernetes
  Conditions:
    Last Transition Time:  2024-03-07T17:52:57Z
    Last Update Time:      2024-03-07T17:52:57Z
    Message:               integration platform created
    Reason:                IntegrationPlatformCreated
    Status:                True
    Type:                  Created
    Last Transition Time:  2024-03-07T17:52:57Z
    Last Update Time:      2024-03-07T17:52:57Z
    Message:               registry available at eu.gcr.io
    Reason:                IntegrationPlatformRegistryAvailable
    Status:                True
    Type:                  RegistryAvailable
  Info:
    Git Commit:  c6a9348d8467f68800dabb7c845a411765fad8e3
    Go OS:       linux
    Go Version:  go1.21.0
  Kamelet:
    Repositories:
      Uri:              none
  Observed Generation:  1
  Phase:                Ready
  Version:              2.2.0
Events:                 <none>

with spectrum as pubblisher I can't publish images on gcp because it returns an UNAUTHORIZED error


Build kit-cnkvvag1vpvc73ep7grg failed: GET https://eu.gcr.io/v2/token?scope=repository%3Aiot-staging-3%2Fcamel-k-kit-cnkvvag1vpvc73ep7grg%3Apush%2Cpull&service=eu.gcr.io: UNAUTHORIZED: You don't have the needed permissions to perform this operation, and you may have invalid credentials. To authenticate your request, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication"

kamel install command that I used:

kamel install \
 --olm=false \
 --registry eu.gcr.io \
 --organization iot-staging-3 \
 --registry-insecure \
 --registry-secret camel-k-builder \
 --build-publish-strategy Spectrum \
 --log-level=debug \
 -n connectors

Any idea how to configure spectrum with gcp registry?

Thanks in advance.

from camel-k.

mhd-robaii avatar mhd-robaii commented on June 14, 2024

Fixed thanks.

from camel-k.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.