Giter Site home page Giter Site logo

redhat-developer / vscode-openshift-tools Goto Github PK

View Code? Open in Web Editor NEW
93.0 10.0 59.0 430.84 MB

OpenShift extension for Visual Studio Code

Home Page: https://marketplace.visualstudio.com/items?itemName=redhat.vscode-openshift-connector

License: MIT License

TypeScript 95.62% JavaScript 0.61% HTML 1.07% Shell 0.02% SCSS 2.47% CSS 0.22%
openshift vscode-extension vscode kubernetes cloud hacktoberfest-accepted hacktoberfest odo

vscode-openshift-tools's Introduction

Overview

The OpenShift Toolkit Extension revolutionizes cloud-native application development by seamlessly integrating with Red Hat OpenShift Hybrid Cloud and Kubernetes. With this powerful extension, developers can harness the full potential of OpenShift and Kubernetes directly within their favorite code editor, streamlining the development process and enhancing productivity.

OpenShift Toolkit extension provides an end-to-end developer experience for Red Hat OpenShift. From seamless deployment to effortless scaling, the toolkit offers comprehensive support for building, testing, and deploying applications. Enjoy features like automatic containerization, built-in debugging, and real-time monitoring, empowering developers to focus on writing quality code while the toolkit handles the complexities of container orchestration and management.

OpenShift Application Development

  • Developers can easily create, deploy, and live debug container applications running on OpenShift, podman, and Hybrid Cloud.
    • Convert local codebases and git repositories into components that can be debugged on OpenShift through the Create Component guided workflow.
    • Create new devfile based components from a template project using the Create Component or Devfile Registries View guided workflows.

OpenShift Serverless Workflow

  • This extension provides the app developer the tools and experience needed when working with Knative & OpenShift Serverless Functions on a Kubernetes/OpenShift cluster. Using this extension, developers can develop and deploy functions in a serverless way through guided IDE workflow.
  • Users can create, run, deploy, build, invoke functions, and manage repositories directly from the UI.

OpenShift and Helm Integration

  • Browse & Install Helm Charts on to the cluster directly from IDE.
  • Developers can view and edit Resources YAML manifests, and view logs for pods, deployments, and deployment configs.

OpenShift Cluster Provisioning

 screencast

Getting Started

Install

Open this extension in the Visual Studio Code Marketplace

The OpenShift Toolkit extension provides multiple views to the user once it is launched.

1. Application Explorer View: Showcases the cluster connected to and the resources present in the cluster. The cluster URL, Project, Deployment, and Deployment Configs are shown in the tree view.

2. Components View: Displays the components created and also the actions associated with the component based on the state in which it is (running or stopped). Allows users to create components from an existing local codebase, from an existing git repository, or a template project.

3. Devfile Registries View: Contains the Default Devfile Registry to browse and create components from the devfile stacks provided. Users can add their custom registry to the view and create components.

3. Serverless Functions View: Lists the available functions created in the cluster and provides the option to Create, Build, Deploy, and Run functions. It also allows you to Manage Repositories for the function template.

4. Debug Sessions View: Once the debug session is active, the associated component running in debug mode is displayed in this view.

Provision new OpenShift Cluster

The extension provides users with multiple ways to provision an instance of OpenShift to get started. Click on Add OpenShift Cluster which opens webview to select the way to get connected with a new OpenShift instance.

Red Hat OpenShift Developer Sandbox

The extension allows users FREE access to the Developer Sandbox for Red Hat OpenShift. From Add Cluster View, users can provision and connect to the dev sandbox instance using the guided workflow. The sandbox provides you with a private OpenShift environment in a shared, multi-tenant OpenShift cluster that is pre-configured with a set of developer tools.

Local instance of OpenShift

The extension allows the developers to provision a local instance of the OpenShift cluster using the guided workflow from the extension. It runs OpenShift Local which provides a single node local OpenShift 4.x cluster.

Tip

Please follow this guide to understand the guided workflow to provision OpenShift locally.

Provision Hybrid Cloud

To install OpenShift Container Platform 4 in the public cloud, in your data center, or on your laptop please visit Red Hat Hybrid Cloud console. Here are different scenarios to try OpenShift:

  • Red Hat OpenShift Cluster Manager - This 60-day, self-supported trial lets you install and run the Red Hat OpenShift Container Platform on the infrastructure you manage.
  • Red Hat OpenShift Dedicated - Red Hat OpenShift Dedicated is a fully managed service of Red Hat OpenShift on Amazon Web Services (AWS) and Google Cloud.
  • Azure Red Hat OpenShift - Azure Red Hat OpenShift is a fully-managed service of Red Hat OpenShift on Azure, jointly engineered, managed and supported by Microsoft and Red Hat.
  • Red Hat OpenShift Service on AWS (ROSA) - Build, deploy, and manage Kubernetes applications with Red Hat OpenShift running natively on AWS.

Quick Start - Showcasing Component Creation

Users can create components in a faster and intuitive way in a few clicks using the following workflows:

Create Component

This guided workflow allows you to configure a project so that it can be run and debugged on OpenShift/Kubernetes. Users can deploy applications from:

  • Existing local code base,
  • Existing code base on a remote git repository,
  • Create a new project from a pre-defined template directly from IDE.

This workflow generates a file called devfile.yaml (a Devfile) that contains instructions on how to deploy the project to OpenShift/Kubernetes based on the project's language or framework. Once you have this setup, you can debug your project on OpenShift/Kubernetes by right-clicking on the project in the Components in the OpenShift sidebar, then selecting 'Start Dev'.

 screencast

Create component from devfile registry

In the Devfile Registries view, there is an action to Open Registry View which opens a webview to browse devfile stacks consisting of supported registries. Users can create components directly from any selected stack and deploy them on OpenShift

 screencast

Install Helm Charts on cluster

Browse the catalog to discover and install Helm Charts on cluster, directly from VSCode.

 screencast

Quick Start - Showcasing Serverless Workflow

Create a Function

Creates a Function in the mentioned directory with the specified language/runtime selected and handles HTTP events.

 screencast

Tip

For more Serverless Functions Actions, please visit the detailed section here

Commands and Features

The extension supports several commands to interact with OpenShift clusters and resources. The commands are accessible via the command palette (Cmd+Shift+P ⌘⇧P on macOS or Ctrl+Shift+P ⌃⇧P on Windows and Linux), Visual Studio Code View title buttons and tree context menus.

Tip

For more detailed information about specific commands and dependencies, please read the extension commands guide.

Release Notes

See the change log.

Contributing

This is an open-source project open to anyone. This project welcomes contributions and suggestions!

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

Feedback

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

License

MIT, See LICENSE for more information.

Data and telemetry

The Red Hat OpenShift Toolkit 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-redhat-telemetry#how-to-disable-telemetry-reporting. Note that this extension also abides by Visual Studio Code's telemetry level: if telemetry.telemetryLevel is set to off, then no telemetry events will be sent to Red Hat, even if redhat.telemetry.enabled is set to true. If telemetry.telemetryLevel is set to error or crash, only events containing an error or error property will be sent to Red Hat.

vscode-openshift-tools's People

Contributors

adietish avatar aditya-konarde avatar apupier avatar benoitf avatar branic avatar datho7561 avatar dependabot[bot] avatar dgolovin avatar fbricon avatar girishramnani avatar github-actions[bot] avatar gorkem avatar jeffmaury avatar jessicajhee avatar jrichter1 avatar lgrossma avatar mohitsuman avatar msivasubramaniaan avatar nickboldt avatar odockal avatar ppatierno avatar rgrunber avatar robstryker avatar scottkurz avatar sudhirverma avatar vrubezhny avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-openshift-tools's Issues

Create fake odo implementation for unit testing

Implementation should understand odo commands and provide the same stdout output for testing. It should retain created object in configuration file and generate 'odo list' output based on saved objects to behave like real 'odo' cli.

"OpenShift" tree should be below "Clusters" tree

the workflow using the "OpenShift (ODO)" view is to

  1. select a current cluster - which you do in in the "Clusters" view and then
  2. look at what this server holds in terms of "OpenShift (ODO)" resources.

In terms of mouse one thus currently has to skip "OpenShift" and go down to "Clusters" to select the server. Then back up to "OpenShift". The more "natural" flow would be to select the server in "Clusters" view, which is the 1st view that's shown, and then move your mouse further down to the "OpenShift" view to discover what this current cluster holds in terms of OpenShift resources.

Migrate to odo version with support --project/--app/--component to override current project/app/component

Current implementation have to use three commands to set active object before executing object specific command. That approach obviously does not work for multiple threads because threads can override each other. This for example leads to wrong OpenShift Explorer tree content for clusters with more than one projects with multiple applications each. Using oc/kubectl can help solve the problem, but in this case vscode-extension should know how to distinguish odo created objects form other ones using labels/annotations.

Add structure to OpenShift Explorer context menus

Follow the same rules throughout all context menus in OpenShift explorer. Every menu should have at least three groups:

  • new commands
  • info commands
  • watch/push commands if applicable
  • delete command

View's Navigatio Menu:
image

Context Menu for a project item:
image

Context menu for Application item
image

Context menu for component node
**
image
**

Delete actions should be named 'Delete'

Now OpenShift explorer has:

  • Delete Component
  • Delete Application
  • Delete Project

in OpenShift Explorer context menus

All this actions should be named as Delete

Create 'Open' action to open component's URL in browser if created

oc get route -o jsonpath='{range .items[?(.metadata.labels.app\.kubernetes\.io/component-name=="$component-name"})]}{.spec.host}{"\n"}{end}'
will return host for $component-name.
if
oc get route -o jsonpath='{range .items[?(.metadata.labels.app\.kubernetes\.io/component-name=="$component-name"})]}{.spec.tls.termination}{"\n"}{end}'
is not empty then protocol is https otherwise http.

then use https://www.npmjs.com/package/opn to open final url.

if route is not present then, info message should notify user about that and give two options:

  • create urls and open
  • cancel

If create url is selected then 'openshift.url.create' command should be executed and then 'openshift.component.open' command called again.

Filter out update message from odo std output

If new odo version is available, stdout contains additional strings

---
A newer version of odo (version: 0.0.11) is available.
Update using your package manager, or run
curl https://raw.githubusercontent.com/redhat-developer/odo/master/scripts/install.sh | sh
to update manually, or visit https://github.com/redhat-developer/odo/releases
---

they should be filtered out before parsing.

Support new 'odo catalog' commands

odo acatalog command changed to support new entity 'service' in odo model. Now odo catalog can list:

  • components as `odo catalog list components'
  • services as `odo catalog list services'

Finalize the package id/name

in package.json the name reads "vscode-openshift-tools" while display name is "OpenShift Connector".
That would make the extensions id "redhat.vscode-openshift-tools".

Make the id more in lines with the display name, and mostly shorter if possible.

@mohitsuman , @dgolovin , thoughts?

Consider using 'oc' to get information about odo objects in json format with `-o json`

This is must fix, because current odo release only can operate on active project/app/component and that means to build tree vscode extension has to set active/project/app/component multiple times. It works only for simple hierarchy where is only one project, one app and multiple components. As soon as hierarchy grows to several project with several apps each there would be several sub-trees building in parallel and that is when tree is getting messed up.

Examples:

  • odo project list' => oc get project -o json'
  • 'odo app list' => has no oc alternative, because aaplication names saved in ~/.kube/odo file to be used as labels and name suffixes for real OpenShift resources created by odo commands
  • odo list => can be build based on DeploymentConfig resources labels
  • odo url list =>can be build based on Route resources labels
  • odo storage list => oc get pvc -o json

Even better way to use -o jsonpath
oc get project -o jsonpath='{range .items[*]}{.metadata.name}{"|"}{.metadata.annotations.openshift\.io/display-name}{ "|"}{.metadata.annotations.openshift\.io/description}{"\n"}{end}' --no-headers=true

Add OpenShift related context menus to SCM views container

Might be good place to show commands:

  1. Push
  2. Create OpenShift Component
"commands": [
      {
        "command": "openshift.project.deploy",
        "title": "New OpenShift Component",
        "category": "OpenShift"
      }
]

"menus": {
      "scm/sourceControl": [
        {
          "command": "openshift.project.deploy",
          "group": "navigation",
          "when": "scmProvider == git"
        }
      ]

Add 'New Component from Example Git Repository' command

This command would allow to create example components from repositories mentioned in s2i builder image description.
Should appear as new command in Command Plette and as a quickpick item when called from OpenShift Application Explorer.

Allow to select and delete several clusters at once

Since I work for quite some time with different cdk's etc my list of local clusters is huge:
image

I'd love to be able to select them all and remove them at once. Currently this isn't possible, I have to do that one by one :(

Provide meaningful README (especially steps to install into VSCode)

It would be great if the README would provide the steps on how to install this extension into VSCode. Currently a user that has no intimate knowledge on developing VSCode extensions has no clue how to achieve that.
Then a user that stumbles upon this repo would love to get some info on what this is and what it provides. Currently the README is just a stub.

"OpenShift" tree is not telling the user what cluster it is listing

"OpenShift" tree is not telling the user what cluster it is listing, one has to know what cluster was selected as default cluster or what cluster you logged in via "oc" on the cmd-line.
This is even more confusing since the "Clusters" view can get out-of-sync if you login manually via oc to a different server: it wont loose it's children. You have to manually refresh to discover it.

steps:

  1. ASSERT: have at least 2 servers
  2. EXEC: in "Clusters" view: select server1 and pick "Set as current cluster"
  3. ASSERT: in "Clusters" view: selected server1 gets arrows and can be unfolded to show resources
  4. EXEC: in Terminal: use "oc login" to login into server2
  5. ASSERT: you're logged in into server2
  6. EXEC: in "OpenShift" view: hit refresh

Result:
"OpenShift" view shows your project on server2, "Clusters" view still looks as if server1 was your current cluster.

Btw. Since "Cluters" view is still thinking that server1 is the current cluster, it wont offer "set as current cluster" in the context menu. Refreshing the "Clusters" view helps though.

Help user if nothing is listed and terminal tells you to log in

I tried listing the project in the resource tree, but it does not show anything. In the terminal I noticed the following output:

Please login to your server: 

oc login https://mycluster.mydomain.com
  • To me things are not obvious enough. One stumbles upon this output while refreshing repeatedly and noticing things moving in the output then.
  • Furthermore one discovers that one has to install an additional tool, oc.
  • Then things would be more user-friendly if "odo" would output the correct command (with correct url) right away instead of https://mycluster.mydomain.com

An idea that we discussed is to offer a "log in" cmd in the context menu.
Even more great would be if the tooling was doing that automatically and prompt the user to provide pw/token?

'Connect to Cluster' command

There is only way to add new cluster to kubernetes view by using oc login https://clusterurl -u username in console. There should be command that would let do the same from vscode UI.

Create 'odo' integration test

Test would verify extension commands can

  • execute odo commands without errors
  • parse odo commands output correctly

Test should watch odo nightly build location and run test for every new odo build.

Test should be executed on local OpenShift cluster.

Remove or fix (kubernetes) "Clusters" view in OpenShift tooling

"Clusters" view, that's contributed by the microsoft kubernetes extension, does not work with the cdk nor openshift online.
In the context of our OpenShift tooling for VSCode it's purpose is limited to select the server that shall be used to display ODO resources. It thus causes a bad/buggy/flawed impression to the user:

a noob user that has a kube config files already would ask himself:

  • "why is the cdk/openshift online server not listing anything?"
  • "why can't I add my openshift online server?"
  • "why can't I add my cdk server?"

I think that we should seriously consider replacing it by a much simpler view to select a server or fix the kube tooling.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.