npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@useful/serverless-kubeless

v0.4.2-beta.1

Published

This plugin enables support for Kubeless within the [Serverless Framework](https://github.com/serverless).

Downloads

1

Readme

Kubeless Serverless Plugin

This plugin brings Kubeless support within the Serverless Framework.

Kubeless is a Kubernetes-native Serverless solution.

Pre requisites

Make sure you have a kubernetes endpoint running and kubeless installed. You can find the installation intructions here.

Once you have Kubeless running in your cluster you can install serverless

$ npm install serverless -g

Try out the example

Clone this repo and check the example function

$ git clone https://github.com/serverless/serverless-kubeless
$ cd examples/get-python
$ cat serverless.yml
service: hello

provider:
  name: kubeless
  runtime: python2.7

plugins:
  - serverless-kubeless

functions:
  hello:
    description: 'Hello function'
    handler: handler.hello

Download dependencies

$ npm install

Deploy function.

$ serverless deploy
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Deploying function hello...
Serverless: Function hello successfully deployed

The function will be deployed to k8s via kubeless.

$ kubectl get function
NAME      KIND
hello     Function.v1.k8s.io

$ kubectl get po
NAME                     READY     STATUS    RESTARTS   AGE
hello-1815473417-1ttt7   1/1       Running   0          1m

Now you will be able to call the function:

$ serverless invoke -f hello -l
Serverless: Calling function: hello...
--------------------------------------------------------------------
hello world

You can also check the logs for the function:

$ serverless logs -f hello
172.17.0.1 - - [12/Jul/2017:09:47:18 +0000] "GET /healthz HTTP/1.1" 200 2 "" "Go-http-client/1.1" 0/118
172.17.0.1 - - [12/Jul/2017:09:47:21 +0000] "GET /healthz HTTP/1.1" 200 2 "" "Go-http-client/1.1" 0/93
172.17.0.1 - - [12/Jul/2017:09:47:24 +0000] "GET /healthz HTTP/1.1" 200 2 "" "Go-http-client/1.1" 0/108
172.17.0.1 - - [12/Jul/2017:09:47:25 +0000] "GET / HTTP/1.1" 200 11 "" "" 0/316

Or you can obtain the function information:

$ serverless info
Service Information "hello"
Cluster IP:  10.0.0.51
Type:  NodePort
Ports:
  Protocol:  TCP
  Port:  8080
  Target Port:  8080
  Node Port:  30018
Function Info
Description: Hello function
Handler:  handler.hello
Runtime:  python2.7
Trigger: HTTP
Dependencies:

If you are using minikube you can call directly the function through HTTP and the Node Port in which the function is running:

$ curl  http://192.168.99.100:30018
hello world

You can access the function through its HTTP interface as well using kubectl proxy and accessing:

$ curl http://127.0.0.1:8001/api/v1/namespaces/default/services/hello/proxy/
hello world

If you have a change in your function and you want to redeploy it you can run:

$ serverless deploy function -f hello
Serverless: Redeploying hello...
Serverless: Function hello successfully deployed

Finally you can remove the function.

$ serverless remove
Serverless: Removing function: hello...
Serverless: Function hello successfully deleted