This page provides an overview of Kubernetes development in Cloud Code.
Use the Kubernetes section in Cloud CodeThe Kubernetes section lets you access information about your clusters, nodes, workloads, and more, right from your IDE. You can also set a current context, stream and view logs, open an interactive terminal, and look up resource descriptions with the Kubernetes section.
Cloud Code uses the default kubeconfig file, located under the $HOME/.kube
directory on MacOS/Linux or %USERPROFILE%\.kube
on Windows, for retrieving Kubernetes resources. You can switch or add new Kubeconfig files from within the Kubernetes section. Kubeconfig files are YAML files containing your Kubernetes cluster details, certificate, and secret token for authenticating to the cluster.
To use a kubeconfig file other than the default kubeconfig, refer to the Work with kubeconfig files guide.
Access the Kubernetes sectionTo view and manage your Kubernetes resources, access the
Kubernetessection by clicking
Cloud Codeand expanding the
Kubernetessection. To view debugging sessions or create a sample app, expand the
Development sessionssection.
When attempting to debug, you may be prompted to authenticate your credentials to run and debug an application locally.
Access the Development sessions sectionUse the Development sessions to run or debug your Kubernetes application or create a sample application using a template.
When you start a development or debugging session, the Development sessions section displays the structured logging view.
To access the Development sessions, click
Cloud Codeand expand the
Development sessionssection.
Basic actionsThe Kubernetes section is powered by kubectl
. As long as you've configured your kubectl
config file to access your clusters, you can use the Kubernetes section to add clusters, browse all your available namespaces, resources, and nodes for your clusters, regardless of them being in the active or inactive context.
The available general Kubernetes actions, accessible through their icons in the Kubernetes section, are:
The available Kubernetes actions, accessible through their icons in the Kubernetes Development sessions section, are:
Copy a resource nameYou can copy any Kubernetes resource name to the clipboard (including container and cluster names). To copy a resource name, right-click on the resource and choose Copy resource name.
Refresh resourcesThe Kubernetes section watches for changes and automatically refreshes to reflect updates. To force a refresh of any Kubernetes resource to fetch its latest information, right-click the resource and choose Refresh.
You can also force a refresh of the entire
Kubernetessection using the
Kubernetessection's refresh button.
Describe resourcesTo display the details of any non-cluster resource, right-click the resource, then select
Describe. A terminal opens and displays the resource information.
Customize your launch configurationTo configure how your application is run, you can customize your skaffold.yaml
file.
You can also configure your launch by specifying the following fields in the
cloudcode.kubernetes
configuration in your
.vscode/launch.json
file:
To view the YAML of a resource in your cluster, select or hover over the resource to show the
Edit YAMLand
View YAMLicons. Select the
View YAMLbutton to open the YAML file corresponding to your specified resource in a new editor tab.
View logsYou can stream and view logs from Kubernetes resources into the Kubernetes section console to monitor their progress.
To open the
logs viewer, open the command palette by pressing
Ctrl/Cmd+Shift+P
or clicking
View > Command Palettethen select
Cloud Code: View Logs.
The logs viewer opens in a new editor tab.
To view logs for a pod or container, right click on the resource and select View logs.
Launch a terminalFor pods and containers, you can open an interactive terminal by right-clicking the pod or container and selecting Get terminal.
Resource-specific actionsThe Kubernetes section displays clusters, namespaces, nodes, workloads (such as deployments, replicasets, pods and containers), services and ingresses, configurations (such as secrets and config maps) and storage (such as volumes). Using the Kubernetes section, you can perform unique actions on some of these resources.
ClustersThe Add Cluster dialog appears and you can choose the project and cluster you'd like to use or create a new cluster.
Set as active cluster: Set the specified cluster as active such that your configured kubectl
context accesses this cluster by default.
The Kubernetes section refreshes automatically and you'll see the Kubernetes symbol next to the appropriate cluster.
If a cluster has multiple contexts configured, you'll be able to choose one of the available contexts to set as the current context.
NamespacesSet as active namespace: Set a namespace as active such that your configured kubectl
context accesses this namespace by default.
Right-click the namespace you want to set as active.
If this action is successful, the Kubernetes section refreshes automatically and you'll see an asterisk next to the namespace to signify that it's part of the current context.
Note that a Kubernetes context is a shortcut which gives you quick access to a namespace in your cluster. Contexts are normally created automatically when you start a minikube or GKE cluster. If you don't see the Set as current context option for a given namespace and you'd like to create a context for it, use the kubectl config set-context
command in your terminal to set a context with your preferred cluster, user, and namespace.
Get Terminal: Get terminal for a pod in the Kubernetes section Console.
Additionally, running pods have colored status marks next to their labels:
View logs: View logs from a deployment into the Kubernetes section console.
Live deployments have colored status marks next to their labels and counts of current/total replicas:
Nodes of your cluster have colored status marks next to their names:
The Kubernetes section lists all Custom Resource Definitions (CRDs) installed and available on your cluster:
What's nextRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4