用于 Visual Studio Code 的 Kubernetes 扩展
The extension for developers building applications to run in Kubernetes clusters and for DevOps staff troubleshooting Kubernetes applications.
Works with any Kubernetes anywhere (Azure, Minikube, AWS, GCP and more!).
Features include:
What's new in this version? See the change log to find out!
Open this extension in the Visual Studio Marketplace
The Kubernetes extension may need to invoke the following command line tools, depending on
which features you use. You will need kubectl at minimum, and docker or buildah if you plan to
use the extension to build applications rather than only browse.
kubectldocker or buildahhelmOptional tools:
az (Azure CLI - only if using the extension to create or register Azure clusters)minikube (only if you want to use it)git (only if using the 'sync working copy to repository' feature)buildah (can be used as an alternative container image build tool)We recommend you install these binaries on your system PATH before using the extension. If these binaries aren't on your system PATH, then some commands may not work. If the extension needs one of the core Kubernetes tools and it's missing, it will offer to install it for you.
If you want to use the Kubernetes: Run and Kubernetes: Debug features
then you need to configure a user and repository for your container
images. This is required because these commands need pushing an image of your application
for your cluster to run it. To do this, add the following to your VS Code preferences
(File > Preferences):
{
"vsdocker.imageUser": "",
}
where `` is something like docker.io/brendanburns.
That's it! You're good to go.
By default, the extension uses the active kubeconfig file -- that is, the file
to which the KUBECONFIG environment variable points, or the default kubeconfig
if no KUBECONFIG environment variable exists. You can override this using the
vs-kubernetes.kubeconfig setting in your user or workspace settings.
If you want to swap between multiple kubeconfig files, you can list them in the
vs-kubernetes.knownKubeconfigs configuration setting and switch between them
using the Set Kubeconfig command.
If you want to skip TLS verification for a particular cluster, you can edit your ~/.kube/config and set the insecure-skip-tls-verify: true flag under the proper cluster:
- cluster:
insecure-skip-tls-verify: true
server: https://my-insecure-cluster:443
name: my-insecure-cluster:443
vs-kubernetes-tools supports a number of commands for interacting with Kubernetes; these are accessible via the command menu (Ctrl+Shift+P) and may be bound to keys in the normal way.
Kubernetes: Load - Load a resource from the Kubernetes API and create a new editor window.Kubernetes: Get - Get the status for a specific resource.Kubernetes: Logs - Open a view with a set of options to display/follow logs.Kubernetes: Describe - Describe the object in a terminal window.Kubernetes: Delete - Delete a Kubernetes resource.Kubernetes: Delete Now - Force delete a pod immediately without waiting for graceful termination.Kubernetes: Follow Events - Follow events on a selected namespace.Kubernetes: Show Events - Show events on a selected namespace.These commands are designed for use from the cluster explorer tree view:
Kubernetes: Watch - Watch a specific resource and update the cluster explorer as it changes.Kubernetes: Stop Watching - Stop watching the specific resource.Kubernetes: Copy Name - Copy the name of a resource to the clipboard.Kubernetes: Run CronJob Now - Manually trigger a CronJob to run immediately.Kubernetes: Explain - Use the kubectl explain ... tool to annotate Kubernetes API objectsKubernetes: Create - Create an object using the current documentKubernetes: Apply - Apply changes to an object contained in the current document.Kubernetes: Expose - Expose the object in the current document as a service.Kubernetes: Diff - Show the difference between a local copy of the object, and that which is deployed to the cluster.Kubernetes: Run - Run the current application as a Kubernetes DeploymentKubernetes: Terminal - Open an interactive terminal session in a pod of the Kubernetes DeploymentKubernetes: Exec - Run a command in a pod of the Kubernetes DeploymentKubernetes: Debug (Launch) - Run the current application as a Kubernetes Deployment and attach a debugging session to it (supports Go, Java, Node.js, Python, and .NET deployments). See Debug support on Kubernetes cluster for more details.Kubernetes: Debug (Attach) - Attach a debugging session to an existing Kubernetes Deployment (supports Go, Java, Node.js, Python, and .NET deployments). See Debug support on Kubernetes cluster for more details.Kubernetes: Remove Debug - Remove the deployment and/or service created for a Kubernetes Debug (Launch) sessionKubernetes: Sync Working Copy to Cluster - Checks out the version of the code that matches what is deployed in the cluster. (This relies on Docker image versions also being Git commit IDs, which the extension does if you use the Run command to build the container, but which typically doesn't work for containers/deployments done by other means.)Kubernetes: Create Cluster - Initiate the flow for creating a Kubernetes cluster with a selected cloud provider (eg: Azure), or creating a Minikube cluster locally.Kubernetes: Add Existing Cluster - Install and configure the Kubernetes command line tool (kubectl) from a cloud cluster, such as an Azure Kubernetes Service (AKS) clusterKubernetes: Set as Current Cluster - Select from a list of configured clusters to set the "current" cluster. Used for searching, displaying, and deploying Kubernetes resources.Kubernetes: Delete Context - Remove a cluster's configuration from the kubeconfig file.Kubernetes: Set Kubeconfig - Select from a list of known kubeconfig files (for users who keep different kubeconfig files for different environments).Kubernetes: Show Cluster Info - For a cluster, show the status of Kubernetes Components (API Server, etcd, KubeDNS, etc.) in a terminal window.Kubernetes: Use Namespace - Select from a list of namespaces to set the "current" namespace. Used for searching, displaying, and deploying Kubernetes resources.Kubernetes: Add File - Adds a file as a ConfigMap or a SecretKubernetes: Delete File - Deletes a file from a ConfigMap or a SecretKubernetes: Open Dashboard - Opens the Kubernetes Dashboard in your browser.Kubernetes: Port Forward - Prompts user for a local port and a remote port to bind to on a Pod.Kubernetes: Select Pod - It allows to select a pod from a list of pods belonging to the "current" namespace. It can be invoked through command substitution ${command:extension.vsKubernetesSelectPod}. See Commands for debugging for more details.Minikube runs a local, single node Kubernetes cluster inside a VM. Support is currently experimental, and requires Minikube tools to be installed and available on your PATH.
Kubernetes: Start minikube - Starts MinikubeKubernetes: Stop minikube - Stops MinikubeHelm is the package manager for Kubernetes and provides a way for you to define, install and upgrade applications using 'charts.' This extension provides a set of tools for creating and testing Helm charts:
Helm: Create Chart - Create a new chartHelm: Get Release - Get a helm release from the clusterHelm: Lint - Lint your chartHelm: Preview Template - Open a preview window and preview how your template will renderHelm: Template - Run your chart through the template engineHelm: Dry Run - Run a helm install --dry-run --debug on a remote cluster and get the resultsHelm: Version - Get the Helm versionHelm: Insert Dependency - Insert a dependency YAML fragmentHelm: Dependency Update - Update a chart's dependenciesHelm: Package - Package a chart directory into a chart archiveHelm: Fetch - Download a chart from a repository (can be run via the palette or by right-clicking a Helm repo)Helm: Install - Install a chart to the clusterHelm: Show Dependencies - Show the dependencies for a chartHelm: Convert to Template - Create a template based on an existing resource or manifestHelm: Convert to Template Parameter - Convert a fixed value in a template to a parameter in the values.yaml file The Kubernetes extension enables variable substitution for settings that require a path as a value. Variable substitution can be done using the ${variableName} syntax. You can find a list of the variables supported in the variables-reference documentation.
vs-kubernetes - Parent for Kubernetes-related extension settingsvs-kubernetes.namespace - The namespace to use for all commandsvs-kubernetes.kubectl-path (deprecated) - File path to the kubectl binary. Note this is the binary file itself, not just the directory containing the file. On Windows, this must contain the .exe extension. This is deprecated, please use vscode-kubernetes.kubectl-path instead.vs-kubernetes.helm-path (deprecated) - File path to the helm binary. Note this is the binary file itself, not just the directory暂无开放 Issues,或尚未同步最近议题。