Search code examples
dockerkubernetescontinuous-deploymentdockerhubspinnaker

Spinnaker - Kubernetes - Can't find docker containers


I have installed spinnaker and kubernetes as suggested in the manual https://www.spinnaker.io/guides/tutorials/codelabs/kubernetes-source-to-prod/

Thing is, I cannot seem to be able to access my docker containers on Docker Hub via Spinnaker in step 3 in the manual.

Here is my spinnaker.yml (the relevant part):

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: ${SPINNAKER_KUBERNETES_ENABLED:true}
primaryCredentials:
  # These credentials use authentication information at ~/.kube/config
  # by default.
  name: euwest1.aws.crossense.io
  dockerRegistryAccount: ${providers.dockerRegistry.primaryCredentials.name}

dockerRegistry:
# For more information on configuring Docker registries, see
# http://www.spinnaker.io/v1.0/docs/target-deployment-configuration#section-docker-registry

# 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: ${SPINNAKER_KUBERNETES_ENABLED:true}

primaryCredentials:
  name: crossense
  address: ${SPINNAKER_DOCKER_REGISTRY:https://index.docker.io/}
  repository: ${SPINNAKER_DOCKER_REPOSITORY:crossense/gator}
  username: crossense
  # A path to a plain text file containing the user's password
  password: password #${SPINNAKER_DOCKER_PASSWORD_FILE}

enter image description here

Thank you guys, in advance, for any and all of the help :)


Solution

  • I believe the issue is that the docker registry does not provide index services. Therefore you need to provide a list of all the images that you want to have available.

    dockerRegistry:
      enabled: true
      accounts:
      - name: spinnaker-dockerhub
        requiredGroupMembership: []
        address: https://index.docker.io
        username: username
        password: password
        email: fake.email@spinnaker.io
        cacheIntervalSeconds: 30
        repositories:
        - library/httpd
        - library/python
        - library/openjrd
        - your-org/your-image
      primaryAccount: spinnaker-dockerhub
    

    The halyard commands to execute this is:

    export ACCOUNT=spinnaker-dockerhub
    
    hal config provider docker-registry account edit $ACCOUNT --repositories [library/httpd, library/python]
    hal config provider docker-registry account edit $ACCOUNT --add-repository library/python
    

    This will update your halyard config file, pending a deploy.

    Note, if you do not have access to one of the images, the command will likely fail.