Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ktctl必须在.kube/config中必须存在一个config文件么 #428

Open
wzjaa opened this issue Apr 20, 2023 · 1 comment
Open

ktctl必须在.kube/config中必须存在一个config文件么 #428

wzjaa opened this issue Apr 20, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@wzjaa
Copy link

wzjaa commented Apr 20, 2023

Describe the bug
现在存在两个环境,使用-c指定config的文件地址,使用 ktctl -c e:\k8sconfig\config -d -n devops connect启动kt,如果.kube/config文件不存在,项目启动回报错,kt可以正常启动

Log
kt启动日志
PS C:\Users\PC> ktctl -c e:\k8sconfig\config -n devops connect --dnsMode hosts:devops,redis 5:56PM INF Using cluster context kubernetes-admin@kubernetes (kubernetes) 5:56PM INF KtConnect 0.3.7 start at 30764 (windows 386) 5:56PM INF Fetching cluster time ... 5:56PM INF Using tun2socks mode 5:56PM INF Successful create config map kt-connect-shadow-gmveb 5:56PM INF Deploying shadow pod kt-connect-shadow-gmveb in namespace devops 5:56PM INF Waiting for pod kt-connect-shadow-gmveb ... 5:56PM INF Pod kt-connect-shadow-gmveb is ready 5:56PM INF Port forward local:25773 -> pod kt-connect-shadow-gmveb:22 established 5:56PM INF Socks proxy established 2023/04/20 17:56:26 Using existing driver 0.14 2023/04/20 17:56:26 Creating adapter 2023/04/20 17:56:27 Spawning native process to remove instance 5:56PM INF Tun device KtConnectTunnel is ready 2023/04/20 17:56:28 Removed orphaned adapter "KtConnectTunnel 1" 5:56PM INF Adding route to 10.97.0.0/16 5:56PM INF Adding route to 10.109.0.0/16 5:56PM INF Adding route to 10.102.0.0/16 5:56PM INF Adding route to 10.104.0.0/16 5:56PM INF Adding route to 10.105.0.0/16 5:56PM INF Adding route to 10.106.0.0/16 5:56PM INF Adding route to 10.96.0.0/24 5:56PM INF Adding route to 10.103.0.0/16 5:56PM INF Adding route to 10.98.0.0/16 5:56PM INF Adding route to 10.99.0.0/16 5:56PM INF Adding route to 10.107.0.0/16 5:56PM INF Adding route to 10.111.0.0/16 5:56PM INF Adding route to 10.101.0.0/16 5:56PM INF Adding route to 10.110.0.0/16 5:56PM INF Adding route to 10.108.167.53/32 5:56PM INF Adding route to 10.244.0.0/16 5:56PM INF Adding route to 10.50.3.0/25 5:56PM INF Adding route to 10.50.3.128/26 5:56PM INF Adding route to 10.50.3.224/27 5:56PM INF Adding route to 10.50.3.208/28 5:56PM INF Adding route to 10.50.3.200/29 5:56PM INF Adding route to 10.50.3.192/30 5:56PM INF Adding route to 10.50.3.196/31 5:56PM INF Adding route to 10.50.3.198/32 5:56PM INF Route to tun device completed 5:56PM INF Setting up dns in hosts mode 5:56PM INF --------------------------------------------------------------- 5:56PM INF All looks good, now you can access to resources in the kubernetes cluster 5:56PM INF ---------------------------------------------------------------
项目启动日志
`2023-04-20 17:43:11.902 WARN [main] io.fabric8.kubernetes.client.Config - Error reading service account token from: [/var/run/secrets/kubernetes.io/serviceaccount/token]. Ignoring.
2023-04-20 17:43:12.344 INFO [main] o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$d84ff5cb] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-04-20 17:43:12.419 WARN [main] io.fabric8.kubernetes.client.Config - Error reading service account token from: [/var/run/secrets/kubernetes.io/serviceaccount/token]. Ignoring.
2023-04-20 17:43:12.420 WARN [main] io.fabric8.kubernetes.client.Config - Error reading service account token from: [/var/run/secrets/kubernetes.io/serviceaccount/token]. Ignoring.

. ____ _ __ _ _
/\ / ' __ _ () __ __ _ \ \ \
( ( )_
_ | '_ | '| | ' / ` | \ \ \
\/ )| |)| | | | | || (| | ) ) ) )
' |
| .__|| ||| |_, | / / / /
=========|
|==============|/=////
:: Spring Boot :: (v2.1.6.RELEASE)

2023-04-20 17:43:14.754 WARN [main] o.s.c.kubernetes.config.ConfigMapPropertySource - Can't read configMap with name: [devopsconfig] in namespace:[devops]. Ignoring
`

Environment (please complete the following information):

  • OS: windows11
  • Kubernetes Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.14", GitCommit:"3321ffc07d2f046afdf613796f9032f4460de093", GitTreeState:"clean", BuildDate:"2022-11-09T13:40:19Z", GoVersion:"go1.17.13", Compiler:"gc", Platform:"linux/amd64"}
  • KT Version:0.3.6
@wzjaa wzjaa added the enhancement New feature or request label Apr 20, 2023
@zihjiang
Copy link

默认为用户主目录下的.kube/config文件中配置的集群。可通过KUBECONFIG环境变量或--kubeconfig运行参数指定使用其他配置文件路径。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants