Spinnaker with Kubernetes: Not able to connect the docker hub repository

9/14/2016

I'm trying to configure the spinnaker to deploy applications in kubernetes environment.

I followed a documentation, at step-3 the containers are not showing up as shown in the screenshot. Then I moved to next step(Pipeline creation), when I select type: Docker in the Automated Trigger, again the Repo name is not showing up as shown in screenshot.

So, I'm suspecting there is problem with spinnaker and docker hub repo(Authentication/Misconfiguration?)

I have copied the Kubernetes Authentication config file to ~/.kube/config. I think there is no problem with spinnaker and kubernetes. When I create a Load Balancer in spinnaker I can see Kube Services are creating (test-dev & test-prod)

root@veeru:~# kubectl get services
NAME                CLUSTER-IP      EXTERNAL-IP   PORT(S)                      AGE
kubernetes          192.168.3.1     <none>        443/TCP                      91d
test-dev            192.168.3.113   <none>        80/TCP                       6h
test-prod           192.168.3.185                 80/TCP                       6h

My spinnaker-local.yml

<Content removed for brevity>

  kubernetes:
    # For more information on configuring Kubernetes clusters (kubernetes), see
    # http://www.spinnaker.io/v1.0/docs/target-deployment-setup#section-kubernetes-cluster-setup

    # NOTE: enabling kubernetes also requires enabling dockerRegistry.
    enabled: true
    primaryCredentials:
      # These credentials use authentication information at ~/.kube/config
      # by default.
      name: veerendrav2
      namespace: default
      dockerRegistryAccount: veerendrav2

  dockerRegistry:
    # If you want to deploy containers to a container management solution,
    # you must specifiy where these container images exist first.

    # NOTE: Enabling dockerRegistry is independent of other providers.
    # However, for convienience, we tie docker and kubernetes together
    # since kubernetes (and only kubernetes) depends on this docker provider
    # configuration.
    enabled: true

    primaryCredentials:
      name: veerendrav2
      address: https://hub.docker.com
      repository: veerendrav2/spin-kub-demo

<Content removed for brevity> 

My /opt/spinnaker/config/clouddriver-local.yml

dockerRegistry:
  enabled: true
  accounts:
    - name: veerendrav2
      address: https://hub.docker.com/ # Point to registry of choice
      username: veerendrav2
      password: password
      repositories:
        - veerendrav2/spin-kub-demo

My Sample application github repo and docker hub repo

Thanks

-- Veerendra Kakumanu
kubernetes
spinnaker

2 Answers

9/14/2016

In /opt/spinnaker/config/clouddriver-local.yml you likely need to change the dockerRegistry.accounts[0].address field to https://index.docker.io, since DockerHub's registry isn't hosted on hub.docker.com, but on index.docker.io.

-- lwander
Source: StackOverflow

11/15/2017

The recommended way to configure the docker registry address, or any other configs, is using Halyard. Modifying the config files directly could result in them getting overwritten.

You can add an account, or edit an existing one this way.

# Add a docker registry account
hal config provider docker-registry account add <ACCOUNT_NAME> --address https://index.docker.io

# Edit the account(i.e. add a repo)
hal config provider docker-registry account edit grizzthedj --add-repository <ACCOUNT_NAME>/<REPO>

# Deploy the changes
hal deploy apply
-- grizzthedj
Source: StackOverflow