Pull image from nexus 3 get error "http: server gave HTTP response to HTTPS cleint"

Hi Guy,

I am new to kubernetes, I installed nexus 3 and create docker (hosted), docker push nginx to it. And try below:
kubectl run test --image 10.12.161.146:5000/nginx:1.0.0
Then get error:
Failed to pull image “10.12.161.146:5000/nginx:1.0.0”: rpc error: code = Unknown desc = Get https://10.12.161.146:5000/v1/_ping: http: server gave HTTP response to HTTPS client
Does kubernetes support this?

Regards
Thanks…KEN

Asking for help? Comment out what you need so we can get more information to help you!

Cluster information:

Kubernetes version:
Client Version: version.Info{Major:“1”, Minor:“11+”, GitVersion:“v1.11.0+d4cacc0”, GitCommit:“d4cacc0”, GitTreeState:“clean”, BuildDate:“2018-10-15T09:45:30Z”, GoVersion:“go1.10.2”, Compiler:“gc”, Platform:“linux/amd64”}
Server Version: version.Info{Major:“1”, Minor:“11+”, GitVersion:“v1.11.0+d4cacc0”, GitCommit:“d4cacc0”, GitTreeState:“clean”, BuildDate:“2019-06-14T11:34:18Z”, GoVersion:“go1.10.8”, Compiler:“gc”, Platform:“linux/amd64”}
Cloud being used: (put bare-metal if not on a public cloud)
Installation method: ansible-playbook
Host OS: CentOS 7
CNI and version:
CRI and version:

You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.

You have to create a secret and in the secret docker-registry type.
You can visit this link for more details.

Hi tej-singh-rana,
Thanks for help. I create yaml file below.
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: 10.12.161.142:6000/nginx:1.0.0
ports:
- containerPort: 80
imagePullSecrets:

  • name: regcred
    ports:
    - containerPort: 80

but it get error below.

kubectl create -f test03.yaml

error: error validating “test03.yaml”: error validating data: [ValidationError(Deployment): unknown field “imagePullSecrets” in io.k8s.api.apps.v1.Deployment, ValidationError(Deployment): unknown field “ports” in io.k8s.api.apps.v1.Deployment]; if you choose to ignore these errors, turn validation off with --validate=false

Any idea?

Regards
Thanks…KEN

Hi,
I re-order the yaml file as below, it can success create the pod without above error “http: server gave HTTP response to HTTPS client”

apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
imagePullSecrets:
- name: regcred
containers:
- name: nginx
image: 10.12.161.142:6000/nginx:1.0.0

Regards
Thanks…KEN