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

egctl: add version command #914

Merged
merged 22 commits into from
Feb 15, 2023
Merged

egctl: add version command #914

merged 22 commits into from
Feb 15, 2023

Conversation

zirain
Copy link
Contributor

@zirain zirain commented Jan 16, 2023

xref: #915

@zirain zirain requested a review from a team as a code owner January 16, 2023 03:21
@Xunzhuo
Copy link
Member

Xunzhuo commented Jan 16, 2023

Can you sparate the design docs into issues in case we can better track it or make contributors/maintainers can help implement it? https://github.com/envoyproxy/gateway/blob/main/docs/latest/design/egctl.md @zirain

@zirain zirain mentioned this pull request Jan 16, 2023
10 tasks
@codecov-commenter
Copy link

codecov-commenter commented Jan 16, 2023

Codecov Report

Merging #914 (147568f) into main (4262398) will increase coverage by 0.03%.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main     #914      +/-   ##
==========================================
+ Coverage   64.45%   64.48%   +0.03%     
==========================================
  Files          67       67              
  Lines        8738     8738              
==========================================
+ Hits         5632     5635       +3     
+ Misses       2733     2730       -3     
  Partials      373      373              
Impacted Files Coverage Δ
internal/provider/kubernetes/controller.go 50.00% <0.00%> (+0.33%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

internal/ctl/app/version.go Outdated Show resolved Hide resolved
cmd/egctl/main.go Outdated Show resolved Hide resolved
cmd/egctl/main.go Outdated Show resolved Hide resolved
internal/ctl/app/version.go Outdated Show resolved Hide resolved
internal/ctl/app/version.go Outdated Show resolved Hide resolved
internal/ctl/app/version.go Outdated Show resolved Hide resolved
internal/ctl/app/version.go Outdated Show resolved Hide resolved
internal/utils/kube/client.go Outdated Show resolved Hide resolved
internal/utils/kube/client.go Outdated Show resolved Hide resolved
internal/utils/kube/client.go Outdated Show resolved Hide resolved
@zirain zirain added this to the 0.4.0-rc.1 milestone Feb 2, 2023
internal/cmd/egctl/version.go Outdated Show resolved Hide resolved
cmd/egctl/main.go Outdated Show resolved Hide resolved
internal/cmd/egctl/version.go Outdated Show resolved Hide resolved
options.AddKubeConfigFlags(flags)

versionCommand.PersistentFlags().StringVarP(&output, "output", "o", yamlOutput, "One of 'yaml' or 'json'")
versionCommand.PersistentFlags().StringVar(&egContainerName, "eg-container-name", "envoy-gateway", "Name of the Envoy Gateway container")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't expect the EG container name to change so I'm not sure why the container name needs to be exposed to a user. However, I can see EG being run in a different ns than envoy-gateway-system and expose the ns to the user while defaulting to "envoy-gateway-system".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

version will search all namespace, expect vendors may use EG multi-tenancy with custom container name?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not following your point here about the EG container name. For multitenancy, a user would install EG in different namespaces with each EG using a different controllerName. A user would then create a GatewayClass per EG and one or more Gateways that reference the GatewayClass. By default, egctl should expect EG in the envoy-gateway-system namespace with the Deployment name of envoy-gateway. If egctl needs to communicate with an EG in a different namespace, a flag such as --namespace should be surfaced. For security purposes, we should avoid providing egctl access across all namespaces.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me remove this part first.

Signed-off-by: hejianpeng <hejianpeng2@huawei.com>
Signed-off-by: hejianpeng <hejianpeng2@huawei.com>
Signed-off-by: hejianpeng <hejianpeng2@huawei.com>
Signed-off-by: hejianpeng <hejianpeng2@huawei.com>
Signed-off-by: hejianpeng <hejianpeng2@huawei.com>
Signed-off-by: hejianpeng <hejianpeng2@huawei.com>
Signed-off-by: hejianpeng <hejianpeng2@huawei.com>
Signed-off-by: hejianpeng <hejianpeng2@huawei.com>
Signed-off-by: hejianpeng <hejianpeng2@huawei.com>
Signed-off-by: hejianpeng <hejianpeng2@huawei.com>
Signed-off-by: hejianpeng <hejianpeng2@huawei.com>
Signed-off-by: hejianpeng <hejianpeng2@huawei.com>
Signed-off-by: hejianpeng <hejianpeng2@huawei.com>
Signed-off-by: hejianpeng <hejianpeng2@huawei.com>
Signed-off-by: hejianpeng <hejianpeng2@huawei.com>
Signed-off-by: hejianpeng <hejianpeng2@huawei.com>
Signed-off-by: hejianpeng <hejianpeng2@huawei.com>
@zirain
Copy link
Contributor Author

zirain commented Feb 3, 2023

output of running make build && bin/linux/amd64/egctl v

client: v0.2.0
server:
- Name: envoy-gateway-6cbd765bdc-ddqpm
  Namespace: envoy-gateway-system
  envoyGatewayVersion: v0.2.0
  envoyProxyVersion: latest
  gatewayAPIVersion: v0.6.0
  gitCommitID: 54fdd5bc185d8fa57e7afa7ec5f53bb1466757e0

Signed-off-by: hejianpeng <hejianpeng2@huawei.com>
Signed-off-by: hejianpeng <hejianpeng2@huawei.com>
@zirain zirain requested a review from danehans February 3, 2023 03:05
@danehans
Copy link
Contributor

I just tested egctl and it's showing the incorrect client version. Maybe this PR needs to be rebased?

$ ./bin/darwin/amd64/egctl version
client: v0.2.0
server:
- Name: envoy-gateway-7fd4c7b9cf-jpjrt
  Namespace: envoy-gateway-system
  envoyGatewayVersion: v0.3.0
  envoyProxyVersion: v1.25-latest
  gatewayAPIVersion: v0.6.1
  gitCommitID: f735041d6ce31e104bf00f9a96f47d327634a923

In the future, EG could be running multiple replicas. In this case, which pod name will be displayed? It might be better to surface the deployment name instead.

Signed-off-by: hejianpeng <hejianpeng2@huawei.com>
@zirain
Copy link
Contributor Author

zirain commented Feb 11, 2023

I just tested egctl and it's showing the incorrect client version. Maybe this PR needs to be rebased?

$ ./bin/darwin/amd64/egctl version
client: v0.2.0
server:
- Name: envoy-gateway-7fd4c7b9cf-jpjrt
  Namespace: envoy-gateway-system
  envoyGatewayVersion: v0.3.0
  envoyProxyVersion: v1.25-latest
  gatewayAPIVersion: v0.6.1
  gitCommitID: f735041d6ce31e104bf00f9a96f47d327634a923

In the future, EG could be running multiple replicas. In this case, which pod name will be displayed? It might be better to surface the deployment name instead.

after rebasing from main, it's correct now.

@danehans
Copy link
Contributor

@zirain thanks for rebasing. I have confirmed that the client/server versions now match. As a follow-on to #914 (comment), EG can run multiple replicas in the future. In this case, which pod name will be displayed? I think it's better to surface the EG deployment name instead of the pod name. Thoughts?

@zirain
Copy link
Contributor Author

zirain commented Feb 14, 2023

In the future, EG could be running multiple replicas. In this case, which pod name will be displayed? It might be better to surface the deployment name instead.

for now, envoy pod will displayed.

@danehans
Copy link
Contributor

Why display the Pod name instead of the Deployment name?

@zirain
Copy link
Contributor Author

zirain commented Feb 14, 2023

Why display the Pod name instead of the Deployment name?

if you look at the implement, egctl list pods by selector, then gather server information via PodExec.
BTW, I have no strong option about change to display deployment name.

@danehans
Copy link
Contributor

Yes, I understand the implementation. I just don't understand the purpose of displaying the EG pod name instead of the deployment name. I'm fine with resolving this in the future when EG supports multiple replicas.

@danehans
Copy link
Contributor

@zirain I can approve after you resolve the merge conflicts.

@zirain zirain closed this Feb 15, 2023
@zirain zirain reopened this Feb 15, 2023
@Xunzhuo
Copy link
Member

Xunzhuo commented Feb 15, 2023

Yes, I understand the implementation. I just don't understand the purpose of displaying the EG pod name instead of the deployment name. I'm fine with resolving this in the future when EG supports multiple replicas.

I prefer deployment name too, but let us get this in first. We can make it later.

Copy link
Member

@Xunzhuo Xunzhuo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @zirain !

@Xunzhuo Xunzhuo merged commit 7419603 into envoyproxy:main Feb 15, 2023
@zirain zirain deleted the egctl-1 branch February 15, 2023 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants