-
Notifications
You must be signed in to change notification settings - Fork 66
Feat: headlamp integration #1439
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Tatsat Mishra <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces headlamp integration into the AKS VSC scenario, adding support for deploying Headlamp as part of the in-cluster installation mechanism. Key changes include new headlamp-related tests and UI components, updated messaging for headlamp state, and integration with VS Code commands and panels.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| webview-ui/src/manualTest/main.tsx | Added headlamp scenario retrieval for manual testing |
| webview-ui/src/manualTest/headlampTests.tsx | Defined headlamp test scenarios using the new Headlamp component |
| webview-ui/src/main.tsx | Integrated headlamp UI component into the main application |
| webview-ui/src/Headlamp/* | Created Headlamp component, state management, and styles |
| src/webview-contract/* | Added webview definitions and types for Headlamp |
| src/panels/HeadlampPanel.ts | Introduced panel and data provider for headlamp deployments |
| src/extension.ts | Registered the deployHeadlamp command in the extension activation |
| src/commands/oservabilitytools/deployHeadlamp/deployHeadlamp.ts | Implemented a command to deploy Headlamp using kubectl and display its panel |
| package.json | Updated menus and command contributions for headlamp integration |
| // below function isn't being used anymore - can maybe be removed unless refactor | ||
| void deployHeadlampInCluster; | ||
| async function deployHeadlampInCluster( | ||
| kubectl: k8s.APIAvailable<k8s.KubectlV1>, | ||
| clusterNode: AksClusterTreeNode, | ||
| clusterKubeConfig: string, | ||
| ): Promise<void> { | ||
| const clusterName = clusterNode.name; | ||
| console.log(`Deploying Headlamp in cluster ${clusterName}.`); | ||
|
|
||
| const sessionProvider = await getReadySessionProvider(); | ||
| if (failed(sessionProvider)) { | ||
| vscode.window.showErrorMessage(sessionProvider.error); | ||
| return; | ||
| } | ||
|
|
||
| const extension = getExtension(); | ||
| if (failed(extension)) { | ||
| vscode.window.showErrorMessage(extension.error); | ||
| return; | ||
| } | ||
|
|
||
| await tmpfile.withOptionalTempFile<Errorable<k8s.KubectlV1.ShellResult>>( | ||
| clusterKubeConfig, | ||
| "YAML", | ||
| async (kubeConfigFile) => { | ||
| // Clean up running instance (without an error if it doesn't yet exist). | ||
| // const deleteResult = await invokeKubectlCommand( | ||
| // kubectl, | ||
| // kubeConfigFile, | ||
| // "delete ns aks-periscope --ignore-not-found=true", | ||
| // ); | ||
| // if (failed(deleteResult)) return deleteResult; | ||
|
|
||
| // Deploy headlamp. | ||
| const applyResult = await invokeKubectlCommand( | ||
| kubectl, | ||
| kubeConfigFile, | ||
| `apply -k https://raw.githubusercontent.com/kinvolk/headlamp/main/kubernetes-headlamp-ingress-sample.yaml`, | ||
| ); | ||
| if (failed(applyResult)) return applyResult; | ||
|
|
||
| // kubectl port-forward -n kube-system service/headlamp 8080:80 | ||
| return invokeKubectlCommand( | ||
| kubectl, | ||
| kubeConfigFile, | ||
| " port-forward -n kube-system service/headlamp 8080:80", | ||
| ); | ||
| }, | ||
| ); | ||
| } | ||
|
|
Copilot
AI
May 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unused reference to 'deployHeadlampInCluster' can be removed to clean up the code. Consider deleting it and its associated function if it is no longer required.
| // below function isn't being used anymore - can maybe be removed unless refactor | |
| void deployHeadlampInCluster; | |
| async function deployHeadlampInCluster( | |
| kubectl: k8s.APIAvailable<k8s.KubectlV1>, | |
| clusterNode: AksClusterTreeNode, | |
| clusterKubeConfig: string, | |
| ): Promise<void> { | |
| const clusterName = clusterNode.name; | |
| console.log(`Deploying Headlamp in cluster ${clusterName}.`); | |
| const sessionProvider = await getReadySessionProvider(); | |
| if (failed(sessionProvider)) { | |
| vscode.window.showErrorMessage(sessionProvider.error); | |
| return; | |
| } | |
| const extension = getExtension(); | |
| if (failed(extension)) { | |
| vscode.window.showErrorMessage(extension.error); | |
| return; | |
| } | |
| await tmpfile.withOptionalTempFile<Errorable<k8s.KubectlV1.ShellResult>>( | |
| clusterKubeConfig, | |
| "YAML", | |
| async (kubeConfigFile) => { | |
| // Clean up running instance (without an error if it doesn't yet exist). | |
| // const deleteResult = await invokeKubectlCommand( | |
| // kubectl, | |
| // kubeConfigFile, | |
| // "delete ns aks-periscope --ignore-not-found=true", | |
| // ); | |
| // if (failed(deleteResult)) return deleteResult; | |
| // Deploy headlamp. | |
| const applyResult = await invokeKubectlCommand( | |
| kubectl, | |
| kubeConfigFile, | |
| `apply -k https://raw.githubusercontent.com/kinvolk/headlamp/main/kubernetes-headlamp-ingress-sample.yaml`, | |
| ); | |
| if (failed(applyResult)) return applyResult; | |
| // kubectl port-forward -n kube-system service/headlamp 8080:80 | |
| return invokeKubectlCommand( | |
| kubectl, | |
| kubeConfigFile, | |
| " port-forward -n kube-system service/headlamp 8080:80", | |
| ); | |
| }, | |
| ); | |
| } | |
| // (Removed unused deployHeadlampInCluster declaration and function) |
This work is headlamp integration into AKS VSC scenario using headlamps, in-cluster installation approach. (Opening this early as Draft)
Prima facie, we have utilized this enabling mechanism: https://headlamp.dev/docs/latest/installation/in-cluster/#using-simple-yaml
We just need to iron out the U/X but the main hook around this is already and leaving this open as Draft as advancement on what we have a align this for release in coming week or 2.
Thanks.
Gently fyi and cc: @tejhan, @qpetraroia ❤️ 🥷