How to add Jfrog Artifactory as a docker registry in Spinnaker?

675 Views Asked by At

I am trying to add JFrog Artifactory as a Docker registry account in my Spinnaker installation. I do the following:

hal config provider docker-registry enable

ADDRESS=server.company.com.jfrog.io
REPOSITORIES=abc/contrepo
[email protected]

hal config provider docker-registry account add jfrog-stage \
    --address $ADDRESS \
    --repositories $REPOSITORIES \
    --username $USERNAME \
    --password

However, I get the following error:

  Failure
Problems in
  default.provider.dockerRegistry.jfrog-stage:
! ERROR Unable to reach repository: Hostname
  server.company.com.jfrog.io not verified:
    certificate: sha1/iIkgakshaaukdhdhidhiudsihsdih=
    DN: CN=*.jfrog.io
    subjectAltNames: [*.jfrog.io, jfrog.io].

Does anyone have any experience setting up JFrog registry on Spinnaker? Any pointers would be greatly appreciated. Thanks.

2

There are 2 best solutions below

0
On

I got same error when i try to add a private artifact address. Solved it by insert the CA certificate of artifact into JDK keystore. Here is the command.

keytool -import -v -trustcacerts -alias ebaotech -file /tmp/git.cer -storepass changeit -keystore /etc/ssl/certs/java/cacerts

"/etc/ssl/certs/java/cacerts" is keystore file of my environment.

"/tmp/git.cer" is certificate of my artifact address.

Restart halyard after that.

One more note, if the "clouddriver" is running in different server, you also have to update keystore of that server.

1
On

Please try this!! It worked for me.

     bash-5.0$ hal config provider docker-registry enable
    + Get current deployment
      Success
    + Edit the dockerRegistry provider
      Success
    Validation in default.provider.dockerRegistry:
    - WARNING Provider dockerRegistry is enabled, but no accounts have
      been configured.
    
    + Successfully enabled dockerRegistry
    bash-5.0$ hal config provider docker-registry account add artifactory \
     --address  https://docker-dev-artifactory.*****.com \
     --insecure-registry true \
     --username niraj.gurung --password
    
    Your docker registry password: 
    + Get current deployment
      Success
    + Add the artifactory account
      Success
    Validation in default.provider.dockerRegistry.artifactory:
    - WARNING Your docker registry has no repositories specified, and
      the registry's catalog is empty. Spinnaker will not be able to deploy any images
      until some are pushed to this registry.
    ? Manually specify some repositories for this docker registry to
      index.
    
    + Successfully added account artifactory for provider
      dockerRegistry.