The Wayback Machine - https://web.archive.org/web/20210118081602/https://github.com/alibaba/kt-connect/issues/157
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

本地调试两个相同版本的服务时,报configMap已存在 #157

Open
JayceLau opened this issue Sep 1, 2020 · 3 comments
Open

本地调试两个相同版本的服务时,报configMap已存在 #157

JayceLau opened this issue Sep 1, 2020 · 3 comments
Assignees
Labels

Comments

@JayceLau
Copy link

@JayceLau JayceLau commented Sep 1, 2020

Describe the bug
A clear and concise description of what the bug is.
本地调试两个服务,通过--version传入相同的值,会报configMap已存在。由于configMap只拼接了--version,未拼接随机字符串导致。

Log
please add -d to debug log
5:40PM ERR configmaps "kt-mesh-public-key-z006587" already exists

Environment (please complete the following information):

  • OS: macOS 10.15.6
  • Kubernetes: v1.15.6-r1
  • KT Version 0.0.13-rc7

Additional context
Add any other context about the problem here.
想了解一下,通过--label传入一个名字为version的标签和通过--version设置版本,有什么区别?

@yunlzheng
Copy link
Contributor

@yunlzheng yunlzheng commented Sep 4, 2020

本地的两个服务都是映射到集群中的同一个Service? 如果是一个服务的不同版本的话version不能重复。 如果是分别是两个服务,那应该mesh到集群中的不同Service。

--label和--version都能到达指定version的目的,不过mesh场景建议用--version, 语义更好一点

@JayceLau
Copy link
Author

@JayceLau JayceLau commented Sep 4, 2020

分别是两个服务,也mesh到了不同的service,只是对应的configMap kt-mesh-public-key-XXXXX只拼接了version字段,如果指定了相同的version,configMap肯定就重名了。

@JayceLau
Copy link
Author

@JayceLau JayceLau commented Sep 8, 2020

pkg/kt/cluster/kubernetes.go:89

component, version := labels["kt-component"], labels["version"]
sshcm = fmt.Sprintf("kt-%s-public-key-%s", component, version)

这个地方,只拼接了kt组件名和版本号,未拼接随机字符串,导致了相同版本无法创建sshcm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.