kubectl-debug icon indicating copy to clipboard operation
kubectl-debug copied to clipboard

`RegistrySecretName` inf config file don't work

Open zhangguanzhang opened this issue 4 years ago • 2 comments

config file:

$ cat ~/.kube/debug-config 
agentImage: xxx.lan:5000/debug-agent:latest
debugAgentNamespace: kube-system
agentless: true
image: xxx:5000/netshoot:latest
RegistrySecretName: regcred
RegistrySecretNamespace: default

if run without --registry-secret-name

$ kubectl debug xxxx-core-84c57974dd-w9w4j  bash
2021/02/01 12:35:10 Getting user name from default context 'xxx'
2021/02/01 12:35:10 User name 'admin' received from context
Agent Pod info: [Name:debug-agent-pod-de65ed93-6446-11eb-bd48-00505692ae0c, Namespace:default, Image:xxx.lan:5000/debug-agent:latest, HostPort:10027, ContainerPort:10027]
Waiting for pod debug-agent-pod-de65ed93-6446-11eb-bd48-00505692ae0c to run...
Forwarding from 127.0.0.1:10027 -> 10027
Forwarding from [::1]:10027 -> 10027
Handling connection for 10027
                             Start deleting agent pod xxxx-core-84c57974dd-w9w4j 
error execute remote, Internal error occurred: error attaching to container: Error response from daemon: Get http://xxx.lan:5000/v2/netshoot/manifests/latest: no basic auth credentials
error: Internal error occurred: error attaching to container: Error response from daemon: Get http://xxx.lan:5000/v2/netshoot/manifests/latest: no basic auth credentials

if run with --registry-secret-name:

$ kubectl debug xxxx-core-84c57974dd-w9w4j --registry-secret-name regcred
2021/02/01 14:01:23 Getting user name from default context 'xxx'
2021/02/01 14:01:23 User name 'admin' received from context
Agent Pod info: [Name:debug-agent-pod-e9ea4a34-6452-11eb-9017-00505692ae0c, Namespace:default, Image:xxx.lan:5000/debug-agent:latest, HostPort:10027, ContainerPort:10027]
Waiting for pod debug-agent-pod-e9ea4a34-6452-11eb-9017-00505692ae0c to run...
Forwarding from 127.0.0.1:10027 -> 10027
Forwarding from [::1]:10027 -> 10027
Handling connection for 10027
                             container created, open tty...
bash-5.0#

zhangguanzhang avatar Feb 01 '21 06:02 zhangguanzhang

Have the same problem. Plus agentless: false in config didn't work too on both last version, including rc.

andrey-gava avatar Feb 03 '21 07:02 andrey-gava

Have the same problem. +1

qianzhang613 avatar May 18 '21 06:05 qianzhang613