Search code examples
kubernetesbitnamidockerhub

I'm installing a custom WordPress image from Bitnami with Helm. Can't pull image from private repository in Docker Hub


I'm trying to deploy a WordPress instance with custom plugins and theme on Minikube.

First, I've created a custom WordPress Docker Image based on Bitnami's Image. I've pushed it to Docker Hub and made the repository private.

Now, I'm trying to deploy the Image using Bitnami's WordPress Helm Chart. For this, I:

  1. Created a secret regcred in the same namespace as the deployment, as described in Kubernetes Docs.

    kubectl create secret docker-registry regcred --docker-server=https://index.docker.io/v1 --docker-username=USERNAME --docker-password=PWORD --docker-email=EMAIL

  2. Changed the chart's values-production.yaml (here) to the following:

.

## Global Docker image parameters
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
## Current available global Docker image parameters: imageRegistry and imagePullSecrets
##
global:
  imageRegistry: docker.io
  imagePullSecrets:
    - regcred
#   storageClass: myStorageClass

## Bitnami WordPress image version
## ref: https://hub.docker.com/r/bitnami/wordpress/tags/
##
image:
  registry: docker.io
  repository: MYUSERNAME/PRIVATEIMAGE
  tag: latest
  ## Specify a imagePullPolicy
  ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
  ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
  ##
  pullPolicy: IfNotPresent
  ## Optionally specify an array of imagePullSecrets.
  ## Secrets must be manually created in the namespace.
  ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
  ##
  pullSecrets:
    - regcred
  ## Set to true if you would like to see extra information on logs
  ##
  debug: true
...

I'm thinking that the pod should be able to pull the private repository, but it never can. It's status is stuck at Waiting: ImagePullBackOff

Can am I doing wrong? I'm following this tutorial, btw. Also, I'm running things on my Windows 10 through WSL2 (Ubuntu distro).


Solution

  • Found the solution. I only had to change the server property in the secret from https://index.docker.io/v1 to docker.io.

    I'm now facing another issue, but I think this one is fixed.