[GitHub] [camel-k] kisamoto opened a new issue #1370: PublishStrategy missing from IntegrationPlatform build spec

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-k] kisamoto opened a new issue #1370: PublishStrategy missing from IntegrationPlatform build spec

GitBox
kisamoto opened a new issue #1370: PublishStrategy missing from IntegrationPlatform build spec
URL: https://github.com/apache/camel-k/issues/1370
 
 
   **Setup**
   
   * GKE cluster - Kubernetes `1.15.8-gke.3`
   * Kamel `1.0.0-RC2`
   * GCR registry storage
   
   **Problem**
   
   With a fresh install of Kamel on the cluster, following the GCR instructions I was receiving the following error message when running any integration:
   
   ```
   {
       [...]
        "error": "error during trait customization: unsupported secret type for registry authentication",
       "errorVerbose": "unsupported secret type for registry authentication
   github.com/apache/camel-k/pkg/trait.getRegistrySecretFor
    github.com/apache/camel-k@/pkg/trait/builder.go:404
   github.com/apache/camel-k/pkg/trait.(*builderTrait).buildahTask
    github.com/apache/camel-k@/pkg/trait/builder.go:244
   github.com/apache/camel-k/pkg/trait.(*builderTrait).Apply
    github.com/apache/camel-k@/pkg/trait/builder.go:83
   github.com/apache/camel-k/pkg/trait.(*Catalog).apply
    github.com/apache/camel-k@/pkg/trait/trait_catalog.go:115
   github.com/apache/camel-k/pkg/trait.Apply
    github.com/apache/camel-k@/pkg/trait/trait.go:46
       [...]
   }
   ```
   
   I knew I had the secret available with the correct name but it wasn't being picked up. Why?
   
   **Solution**
   
   * `builder.go:Apply()` was incorrectly choosing the buildahTask `IntegrationPlatformBuildPublishStrategyBuildah` not the kanikoTask `IntegrationPlatformBuildPublishStrategyKaniko`
   * I traced this back to a missing `publishStrategy` from the installed `integrationplatform` resource in the kubernetes cluster
   * After manually adding `build.spec.publishStrategy = Kaniko` camel-k was able to push to registry
   
   **Bug**
   
   * Why is `build.spec.publishStrategy = Kaniko` not correctly added to the `integrationplatform` resource?
   * I couldn't find where this is set during installation. Should it be?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-k] nicolaferraro commented on issue #1370: PublishStrategy missing from IntegrationPlatform build spec

GitBox
nicolaferraro commented on issue #1370: PublishStrategy missing from IntegrationPlatform build spec
URL: https://github.com/apache/camel-k/issues/1370#issuecomment-603108966
 
 
   Hi @kisamoto, the option to choose the publish strategy has been added recently but it isn't available in RC2.
   
   I don't know if Buildah can be used to push to GCR.io (@astefanutti ), but for sure Kaniko has specific options for it.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-k] nicolaferraro edited a comment on issue #1370: PublishStrategy missing from IntegrationPlatform build spec

GitBox
In reply to this post by GitBox
nicolaferraro edited a comment on issue #1370: PublishStrategy missing from IntegrationPlatform build spec
URL: https://github.com/apache/camel-k/issues/1370#issuecomment-603108966
 
 
   Hi @kisamoto, the option to choose the publish strategy during install has been added recently but it isn't available in RC2.
   
   I don't know if Buildah can be used to push to GCR.io (@astefanutti ), but for sure Kaniko has specific options for it.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-k] astefanutti commented on issue #1370: PublishStrategy missing from IntegrationPlatform build spec

GitBox
In reply to this post by GitBox
astefanutti commented on issue #1370: PublishStrategy missing from IntegrationPlatform build spec
URL: https://github.com/apache/camel-k/issues/1370#issuecomment-603115302
 
 
   Buidah based builds do not yet specifically support GCR. You can use standard Docker registry authentication file formats with Buildah, but I'm not sure these work with GCR.
   
   As a work-around, Kaniko based builds can be used as mentioned. Ideally, we should make Buildah builds capable of authenticating to GCR, or clearly indicate the limitation in the documentation.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-k] TeslaCN commented on issue #1370: PublishStrategy missing from IntegrationPlatform build spec

GitBox
In reply to this post by GitBox
TeslaCN commented on issue #1370: PublishStrategy missing from IntegrationPlatform build spec
URL: https://github.com/apache/camel-k/issues/1370#issuecomment-604287988
 
 
   @kisamoto Maybe we encountered the same problem. #1360
   
   I think it has been fixed, but not released yet. #1259
   
   https://github.com/apache/camel-k/blob/24ddce5afb41c70a0bf30e06f74c6f380f5fd851/pkg/trait/builder.go#L327-L338
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-k] kisamoto commented on issue #1370: PublishStrategy missing from IntegrationPlatform build spec

GitBox
In reply to this post by GitBox
kisamoto commented on issue #1370: PublishStrategy missing from IntegrationPlatform build spec
URL: https://github.com/apache/camel-k/issues/1370#issuecomment-604304350
 
 
   @TeslaCN  ah yes I saw your bug report too :-) i'm not sure if it is exactly the same as my build should be using Kaniko (due to having the `kaniko-secret.json` file in the secret) but your report and the PR helped me track down the issue.
   
   Looking forward to seeing if it's fixed in the next RC

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-k] bthj commented on issue #1370: PublishStrategy missing from IntegrationPlatform build spec

GitBox
In reply to this post by GitBox
bthj commented on issue #1370: PublishStrategy missing from IntegrationPlatform build spec
URL: https://github.com/apache/camel-k/issues/1370#issuecomment-604527756
 
 
   @kisamoto, how did you manually add `build.spec.publishStrategy` to the `integrationplatform` ?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-k] bthj commented on issue #1370: PublishStrategy missing from IntegrationPlatform build spec

GitBox
In reply to this post by GitBox
bthj commented on issue #1370: PublishStrategy missing from IntegrationPlatform build spec
URL: https://github.com/apache/camel-k/issues/1370#issuecomment-604678362
 
 
   Tried the [1.0.0-nightly.202003261646 Release](https://github.com/apache/camel-k/releases/tag/1.0.0-nightly.202003261646) and still get the "unsupported secret type for registry authentication" error, when [configuring a gcr.io registry](https://camel.apache.org/camel-k/latest/installation/registry/gcr.html).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-k] nicolaferraro commented on issue #1370: PublishStrategy missing from IntegrationPlatform build spec

GitBox
In reply to this post by GitBox
nicolaferraro commented on issue #1370: PublishStrategy missing from IntegrationPlatform build spec
URL: https://github.com/apache/camel-k/issues/1370#issuecomment-604687032
 
 
   Did you installed with `kamel install .... --build-publish-strategy=Kaniko` with the nightly release?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-k] nicolaferraro edited a comment on issue #1370: PublishStrategy missing from IntegrationPlatform build spec

GitBox
In reply to this post by GitBox
nicolaferraro edited a comment on issue #1370: PublishStrategy missing from IntegrationPlatform build spec
URL: https://github.com/apache/camel-k/issues/1370#issuecomment-604687032
 
 
   Did you install with `kamel install .... --build-publish-strategy=Kaniko` with the nightly release?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-k] bthj commented on issue #1370: PublishStrategy missing from IntegrationPlatform build spec

GitBox
In reply to this post by GitBox
bthj commented on issue #1370: PublishStrategy missing from IntegrationPlatform build spec
URL: https://github.com/apache/camel-k/issues/1370#issuecomment-604932656
 
 
   Didn't use that flag before with the nightly release.  Now when issuing `kamel uninstall` and using the nightly to install again with:
   ```
   kamel install --registry gcr.io --organization my-gcp-project-id --registry-secret kaniko-secret --build-publish-strategy=Kaniko --force
   ```
   the log output from `camel-k-operator-...` is a rapid stream of entries like:
   ```
   {"level":"info","ts":1585304434.7892313,"logger":"camel-k.controller.build","msg":"Reconciling Build","request-namespace":"default","request-name":"kit-bpu91bq2032o5jv6daig"}
   {"level":"info","ts":1585304434.789374,"logger":"camel-k.controller.build","msg":"Invoking action schedule-pod","request-namespace":"default","request-name":"kit-bpu91bq2032o5jv6daig","api-version":"camel.apache.org/v1","kind":"Build","ns":"default","name":"kit-bpu91bq2032o5jv6daig"}
   ...
   ```
   and if I install an example integration with `kamel run ...` it doesn't show up in the list of pods.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-k] nicolaferraro commented on issue #1370: PublishStrategy missing from IntegrationPlatform build spec

GitBox
In reply to this post by GitBox
nicolaferraro commented on issue #1370: PublishStrategy missing from IntegrationPlatform build spec
URL: https://github.com/apache/camel-k/issues/1370#issuecomment-604952356
 
 
   I've done a full test and I managed to push images on GCR.
   Did you create the kaniko-secret using instructions from https://camel.apache.org/camel-k/latest/installation/registry/gcr.html ?
   
   Apart from the --build-publish-strategy=Kaniko, those instructions seem to work.
   Can you check the pods in the namespace named "*-kit-*"? there should be some failing in your case. It would be nice if you can provide their logs.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-k] bthj commented on issue #1370: PublishStrategy missing from IntegrationPlatform build spec

GitBox
In reply to this post by GitBox
bthj commented on issue #1370: PublishStrategy missing from IntegrationPlatform build spec
URL: https://github.com/apache/camel-k/issues/1370#issuecomment-605284589
 
 
   Yes, I did follow the [configuring a gcr.io registry](https://camel.apache.org/camel-k/latest/installation/registry/gcr.html) instructions, and I installed the `kaniko-secret` to my local MicroK8s cluster.
   
   Several "-kit-" pods get created, one after another, each taking minutes to initialise, eventually terminating, with log output like:
   ```
   INFO[0001] Resolved base name gcr.io/myproject/camel-k-kit-bpu9fofqigeckfj29sfg:1528335 to gcr.io/myproject/camel-k-kit-bpu9fofqigeckfj29sfg:1528335
   INFO[0001] Resolved base name gcr.io/myproject/camel-k-kit-bpu9fofqigeckfj29sfg:1528335 to gcr.io/myproject/camel-k-kit-bpu9fofqigeckfj29sfg:1528335
   INFO[0001] Retrieving image manifest gcr.io/myproject/camel-k-kit-bpu9fofqigeckfj29sfg:1528335
   INFO[0002] Retrieving image manifest gcr.io/myproject/camel-k-kit-bpu9fofqigeckfj29sfg:1528335
   INFO[0003] Built cross stage deps: map[]                
   INFO[0003] Retrieving image manifest gcr.io/myproject/camel-k-kit-bpu9fofqigeckfj29sfg:1528335
   INFO[0004] Retrieving image manifest gcr.io/myproject/camel-k-kit-bpu9fofqigeckfj29sfg:1528335
   INFO[0005] Unpacking rootfs as cmd ADD . /deployments requires it.
   INFO[0028] Taking snapshot of full filesystem...        
   INFO[0035] Using files from context: [/builder/kit-bpud6g7l1e7r7hd1hv60/context]
   INFO[0035] ADD . /deployments                          
   INFO[0035] Taking snapshot of files...                  
   INFO[0035] USER 1000                                    
   INFO[0035] cmd: USER                                    
   ```
   
   The pod for the integration deployment has the event
   ```
   Failed to pull image "gcr.io/myproject/camel-k-kit-bptni2v70ue19lu1sbg0:1528347": rpc error: code = Unknown desc = failed to resolve image "gcr.io/myproject/camel-k-kit-bptni2v70ue19lu1sbg0:1528347": no available registry endpoint: unexpected status code https://gcr.io/v2/myproject/camel-k-kit-bptni2v70ue19lu1sbg0/manifests/1528347: 401 Unauthorized
   ```
   
   - indicating a permission issue
   
   Shouldn't the the permissions come from the installed kaniko-secret?  
   It comes from a GCP service account with the Storage Admin role, according to the instructions.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [camel-k] garyedwards commented on issue #1370: PublishStrategy missing from IntegrationPlatform build spec

GitBox
In reply to this post by GitBox
garyedwards commented on issue #1370: PublishStrategy missing from IntegrationPlatform build spec
URL: https://github.com/apache/camel-k/issues/1370#issuecomment-609852821
 
 
   Hi I was having the same issue and https://github.com/apache/camel-k/issues/1370#issuecomment-604687032 solved it.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services