Can't access private repo from Kubernetes

I’m trying to get kubernetes working with docker hub and a private repository. It works fine with public repos, but my private repo - I can not access. I’ve read everything on stack overflow searched the internet, but it has me stumped. If I make the repo used below public and keep everything else the same, it works fine, its just when its private that its failing. Obviously something is wrong with the authentication but everything checks out. Note this is a standard kubernetes bear metal install.

The message I get when I try to deploy a pod is :-

Failed to pull image “silvercreek8s/test:v3”: failed to pull and unpack image “docker.io/silvercreek8s/test:v3”: failed to resolve reference “docker.io/silvercreek8s/test:v3”: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

I will attach more info in follow up messages as I cant post ‘more than 2 links’ as a new user.

The registry is correctly setup (default namespace)

% kgubectl get secret registry-silvercreek8s
NAME TYPE DATA AGE
registry-silvercreek8s kubernetes.io/dockerconfigjson 1 126m

Object looks like this :-
apiVersion: v1
data:
.dockerconfigjson:
kind: Secret
metadata:
creationTimestamp: “2024-01-13T10:23:35Z”
name: registry-silvercreek8s
namespace: default
resourceVersion: “84002”
uid: 394ae83c-52d2-4ffc-b62b-c558fe9dc0f0
type: kubernetes.io/dockerconfigjson

I’m using it with this test image:

apiVersion: v1
kind: Pod
metadata:
name: private-reg
spec:
containers:

  • name: private-reg-container
    image: silvercreek8s/test:v3
    imagePullSecrets:
  • name: registry-silvercreek8s

FIXED

Just in case anyone else hits this - my mistake was to specify the docker-server to the kubernetes cluster. If I removed that from the create secret command, it defaults to a value that works.