Skip to content

Teleterm: Add listing kube resources endpoint#46753

Merged
kimlisa merged 6 commits intomasterfrom
lisa/teleterm-kube-resource-endpoint
Oct 8, 2024
Merged

Teleterm: Add listing kube resources endpoint#46753
kimlisa merged 6 commits intomasterfrom
lisa/teleterm-kube-resource-endpoint

Conversation

@kimlisa
Copy link
Copy Markdown
Contributor

@kimlisa kimlisa commented Sep 19, 2024

part of #46742

easier to review by commit

Adds a new grpc endpoint and related boilerplates for listing kube resources

if confused what is the difference between the other endpoint where we list kubes, kube resources refers to kube_cluster's sub resources:

// KubernetesResourcesKinds lists the supported Kubernetes resource kinds.

@github-actions

This comment was marked as resolved.

Comment thread lib/teleterm/api/uri/uri.go Outdated
@kimlisa kimlisa added no-changelog Indicates that a PR does not require a changelog entry backport/branch/v16 labels Sep 19, 2024
Comment thread lib/teleterm/daemon/daemon.go Outdated
Comment thread lib/teleterm/daemon/daemon.go Outdated
Comment thread lib/teleterm/api/uri/uri.go Outdated
@kimlisa kimlisa requested a review from gzdunek September 20, 2024 04:37
Comment thread web/packages/teleterm/src/ui/uri.ts
Comment thread lib/teleterm/api/uri/uri.go Outdated
Comment thread proto/teleport/lib/teleterm/v1/service.proto Outdated
Comment thread proto/teleport/lib/teleterm/v1/service.proto Outdated
Comment thread lib/teleterm/apiserver/handler/handler_kubes.go Outdated
Comment thread lib/teleterm/daemon/daemon.go Outdated
Comment thread proto/teleport/lib/teleterm/v1/kube.proto Outdated
@kimlisa kimlisa force-pushed the lisa/teleterm-kube-resource-endpoint branch from 86815ca to 5ee774f Compare September 23, 2024 19:41
Comment thread lib/web/ui/labels_test.go Outdated
Comment thread web/packages/teleterm/src/ui/uri.ts Outdated
Comment thread lib/teleterm/api/uri/uri.go Outdated
@kimlisa kimlisa force-pushed the lisa/teleterm-kube-resource-endpoint branch 5 times, most recently from 34aadea to ecc4409 Compare October 7, 2024 03:34
@kimlisa kimlisa requested a review from ravicious October 7, 2024 03:34
@kimlisa kimlisa force-pushed the lisa/teleterm-kube-resource-endpoint branch 2 times, most recently from 724eb86 to 6251b55 Compare October 7, 2024 04:57
Comment thread web/packages/teleterm/src/ui/uri.ts Outdated
return generatePath(
paths.kubeResourceNamespaceLeaf,
params as any
) as string;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
) as string;
) as LeafClusterKubeResourceNamespaceUri;

Comment thread web/packages/teleterm/src/ui/uri.ts Outdated
params as any
) as string;
} else {
return generatePath(paths.kubeResourceNamespace, params as any) as string;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
return generatePath(paths.kubeResourceNamespace, params as any) as string;
return generatePath(paths.kubeResourceNamespace, params as any) as KubeResourceNamespaceUri;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

think you meant RootClusterKubeResourceNamespaceUri, so i went with that

Comment thread lib/teleterm/api/uri/uri.go Outdated
}

// AppendKubeResourceNamespace appends kube resource namespace segment to the URI.
func (r ResourceURI) AppendKubeResourceNamespace(kubeClusterName string, kubeNamespaceName string) ResourceURI {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this should accept just kubeNameSpaceName string as an argument, with the intention that if you want to make a URI to a kube namespace, you'd do something like uri.NewClusterURI(profileName).AppendKube(kubeClusterName).AppendKubeNamespace(kubeNamespaceName).

AppendLeafCluster already follows a similar approach, though AppendKubeResourceNamespace does not need to handle that extra case with name == "" like AppendLeafCluster does.

Comment thread lib/teleterm/daemon/daemon.go Outdated
return nil, trace.Wrap(err)
}

var proxyGRPCClient kubeproto.KubeServiceClient
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is no longer needed, as in the client can just stay defined within AddMetadataToRetryableError. Maybe we could also name it kubenetesServiceClient or something along those lines? proxyGRPCClient makes it sound like it's used for more than just k8s, but it's actually heavily focused on k8s only.

@kimlisa kimlisa force-pushed the lisa/teleterm-kube-resource-endpoint branch from 6251b55 to 21bed0c Compare October 8, 2024 17:26
@kimlisa kimlisa enabled auto-merge October 8, 2024 17:26
@r0mant
Copy link
Copy Markdown
Collaborator

r0mant commented Oct 8, 2024

/excludeflake *

@kimlisa kimlisa force-pushed the lisa/teleterm-kube-resource-endpoint branch from 4dda04e to e4c646e Compare October 8, 2024 18:24
@kimlisa kimlisa added this pull request to the merge queue Oct 8, 2024
Merged via the queue into master with commit 354eb49 Oct 8, 2024
@kimlisa kimlisa deleted the lisa/teleterm-kube-resource-endpoint branch October 8, 2024 21:02
@public-teleport-github-review-bot
Copy link
Copy Markdown

@kimlisa See the table below for backport results.

Branch Result
branch/v16 Failed

kimlisa added a commit that referenced this pull request Oct 9, 2024
* Rename makeLabels into MakeUILabelsWithoutInternalPrefixes

* Teleterm: add listing kube resource endpoint

* Teleterm pb updates

* Renames, moves test, fix imports, address CRS
mvbrock pushed a commit that referenced this pull request Oct 16, 2024
* Rename makeLabels into MakeUILabelsWithoutInternalPrefixes

* Teleterm: add listing kube resource endpoint

* Teleterm pb updates

* Renames, moves test, fix imports, address CRS
github-merge-queue Bot pushed a commit that referenced this pull request Oct 28, 2024
* Teleterm: Add listing kube resources endpoint (#46753)

* Rename makeLabels into MakeUILabelsWithoutInternalPrefixes

* Teleterm: add listing kube resource endpoint

* Teleterm pb updates

* Renames, moves test, fix imports, address CRS

* Straggling file from make grpc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Indicates that a PR does not require a changelog entry size/md ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants