Skip to content

redhat-developer/vscode-knative

Repository files navigation

Visual Studio Marketplace License

Important

Developers are highly recommended to use the OpenShift Toolkit extension for Knative Serverless Function workflow to streamline their development process and ensure a seamless experience. All the latest features of Knative Serverless will be maintained in the OpenShift Toolkit extension, supported by Red Hat.

Knative & Serverless Functions for Visual Studio Code

Knative is an Open-Source Enterprise-level solution to build Serverless and Event-Driven Applications. Thus running Serverless Containers in Kubernetes environments.

This extension for Knative provides the app developer with the tools and experience needed when working with Knative & Serverless Functions on a Kubernetes cluster. Using this extension, developers can develop and deploy functions in a serverless way through guided IDE workflow.

Requirements

  • Knative extension uses kn cli 1.13.0 and func cli 1.13.0. The extension will offer to download and install the dependencies if needed.

  • YAML is validated using the VSCode-YAML extension

  • Users can log in to the Kubernetes cluster using VSCode Kubernetes extension.

    NOTE: You will need to have the kubeconfig for the cluster that you are accessing stored locally.

Extension Settings

This extension contributes two views (Knative and Functions) and the following settings:

Functions

  • function.explorer.create: Create a new Knative Function in the current namespace
  • function.explorer.refresh: Refresh the Functions tree view
  • function.explorer.repository: Manage installed template repositories. Once added, a template from the repository can be used when creating a new function.

Function Sessions

  • This view is used to showcase Active commands for a specified function. This includes Build, Deploy, and Run sessions. Once the command is executed for a given function, the node is displayed in the Sessions View. Users can also Stop the executing action. The logs can be seen in the Output Channel.

Knative

  • service.explorer.create: Create a new Knative service in the current namespace
  • service.explorer.openFile: Display YAML for the selected item
  • service.explorer.refresh: Refresh the Explorer tree view

Commands and features

vscode-knative supports several commands for interacting with Knative and Knative Functions; these are accessible via the tree context menu and via the command palette (Cmd+Shift+P ⌘⇧P on macOS or Ctrl+Shift+P ⌃⇧P on Windows and Linux)

Functions

  • Knative: Create Function: Open up a wizard to create a new Function project
  • Knative: Build Function: Build the function project as a container image
  • Knative: Run: Runs the function locally in the current directory or in the directory specified
  • Knative: Deploy Function: Deploys a function to the currently configured Knative-enabled cluster.
  • Knative: Undeploy: Undeploys a function from the cluster.
  • Knative: Add Config to Function: Allows configuration of Volume mounts and environment variables for a function project
  • Knative: Remove Config from Function: Remove Volume mounts, Environment variable from the function configuration
  • Knative: Open in Browser: Open the deployed function in your browser
  • Knative: Refresh View: Refresh the Function Tree View

Knative (Serving & Eventing)

  • Knative: Add Service: Start a workflow to create a new Service
  • Knative: Focus on Serving View: Load and Open the Knative Serving view
  • Knative: Focus on Eventing View: Load and Open the Knative Eventing view
  • Knative: Refresh View: Refresh the Service/Eventing Tree View
  • Knative: Add a Tag: Add a new tag to a Revision
  • Knative: Delete: Delete a service or a revision or an eventing resource
  • Knative: Open in Browser: Open the service in your browser

Documentation

Release Notes

See CHANGELOG for details.

Contributing

This is an open-source project open to anyone. We are always looking for contributions from the Function Developer community.

For information on getting started, please take a look at the CONTRIBUTING instructions.

Download the most recent knative-<version>.vsix file from the release and install it by following the instructions here. Stable releases are archived here.

Feedback & Questions

If you find an issue, please file a bug and we will fix it as soon as possible.

The func Task Force meets @ 10:30 PST every Tuesday, we'd love to have you! For more information, see the invitation on the Knative Team Calendar.

License

MIT, See LICENSE for more information.

Data and telemetry

The Knative extension for Visual Studio Code collects anonymous usage data and sends it to Red Hat servers to help improve our products and services. Read our privacy statement to learn more. This extension respects the redhat.telemetry.enabled setting which you can learn more about at https://github.com/redhat-developer/vscode-commons#how-to-disable-telemetry-reporting