• 7
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

kubernetes not connecting to docker hub

Alright, so I am trying to publish a private docker image to kubernetes, and I am running into some odd issues.

I start of with logging into docker

docker login -u $DOCKER_USER -p $DOCKER_TOKEN 

and that will store my password in a config file for me, so I run this

kubectl create secret generic regcred --from-file=/root/.docker/config.json --type=kubernetes.io/dockerconfigjson

I would expect that to pick up the url in the config.json file, but I get this error

The connection to the server localhost:8080 was refused - did you specify the right host or port?

So I thought that I might as well specify the server

kubectl create secret generic regcred --from-file=/root/.docker/config.json --type=kubernetes.io/dockerconfigjson --server=https://index.docker.io/v1/

But still no luck.

error: EOF
2020-01-12T19:45:39.7433187Z stdout P Please enter Username:

and since this is running on a build server, I cannot enter the username.

So what am I missing here?

    • Hi, what is your infrastructure? Could You check by kubectl get all -A if your cluster is working properly? Can You create any pod by using kubectl run/create or the same problem occurs? Maybe try create a secret by providing credentials on the command line?

kubectl create secret generic regcred --from-file=/root/.docker/config.json --type=kubernetes.io/dockerconfigjson --server=https://index.docker.io/v1/

You are conflating the --server= argument to kubectl, which determines the kubernetes server to which it will connect, with --docker-server=

You will want to use the provided kubectl create secret docker-registry command (versus the generic type) because the Secret that is created by the specialized version is not just the .docker/config.json file uploaded to the cluster -- they are structurally different

Also:

The connection to the server localhost:8080 was refused - did you specify the right host or port?

is a dead giveaway that you do not have a correctly configured kubeconfig so you can forget about any kubectl command doing anything reasonable until you fix that problem

  • 0
Reply Report

Trending Tags