Code Monkey home page Code Monkey logo

functions's Introduction

WARNING: Kubeless is no longer actively maintained by VMware.

VMware has made the difficult decision to stop driving this project and therefore we will no longer actively respond to issues or pull requests. If you would like to take over maintaining this project independently from VMware, please let us know so we can add a link to your forked project here.

Thank You.

Functions for Kubeless

This repository contains Kubeless Functions. Kubeless is a Kubernetes-native serverless framework that makes use of Kubernetes' ThirdPartyResource to be able to create functions as custom Kubernetes resources

The purpose of this repository is to provide a place for maintaining and contributing official Kubeless functions, with CI processes in place for assuring an always up-to-date repository.

Repository structure

The Charts in this repository are organized into two folders:

  • charts
  • incubator

Stable functions counts with an CI process in place and they are maintained and updated Incubator functions are those to be shared and improved on until they are ready to be moved into the charts folder.

Structure of a Kubeless Function

Each kubeless functions must have:

  • A metadata file
  • A README.md file
  • A way to declare dependencies

functions's People

Contributors

andresmgot avatar aweis89 avatar dependabot[bot] avatar dharmendrakariya avatar donhui avatar hotjunfeng avatar jbianquetti-nami avatar leibniz137 avatar migmartri avatar ngtuna avatar ppbaena avatar sebgoa avatar tompizmor 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

Watchers

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

functions's Issues

Do we have any working examples of nodejs functions?

Although I am using the following function from https://github.com/kubeless/kubeless/tree/master/examples/nodejs:

module.exports = {
  foo: function (req, res) {
        res.end('hello world')

  }
}

it does not seem to be working.

Deploying in kubeless as follows:
kubeless function update testjs --runtime nodejs8 --handler testjs.foo --from-file hello.js --namespace kubeless

Following are my issues:

  1. The function gets deployed with a default topic as kubeless which I had to create in kafka later. Can I not deploy a function without a topic the way I did for Python?

  2. But I am not able to invoke a js function :
    Invoking as:

kubeless function call testjs --data '{"echo": "echo echo"}' --namespace kubeless

and below is what I see in pod logs:

::ffff:127.0.0.1 - - [17/Oct/2017:12:57:14 +0000] "POST / HTTP/1.1" 404 140 "-" "Go-http-client/1.1"
::ffff:127.0.0.1 - - [17/Oct/2017:13:03:32 +0000] "GET / HTTP/1.1" 404 139 "-" "Go-http-client/1.1"

and output as:

Connecting to function...
Forwarding from 127.0.0.1:30000 -> 8080
Forwarding from [::1]:30000 -> 8080
Handling connection for 30000

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot POST </pre>
</body>
</html>

Question about enabling event notification using kafka after installing with helm

I am also trying to enable kafka notification for buckets.

helm/charts@3c06eb4 - says

To update your Minio server configuration while it is deployed in a release, you need to

  1. Check all the configurable values in the Minio chart using helm inspect values stable/minio.
  2. Override the minio_server_config settings in a YAML formatted file, and then pass that file like this helm upgrade -f config.yaml stable/minio.

Git comments also say:

minio_server_config:
config.json: |
{
"region": "us-east-1",
"browser": "on",
"logger": {
"console": {
"enable": true
},
"file": {
"enable": false,
"filename": ""
}
},
"notify": {
"kafka": {
"1": {
"enable": true,
"brokers": ["kafka:9092"],
"topic": "minio-topic"
}
}
}
}

I have upgrade the helm release with the above added to the YAML. But I don't see the SQS ARN being created when I check the logs of the pod. The minio service is working - but the SQS ARN does not seem to be created.

Is there a sample on how to do this?

Create a chart folder

  • Charts that are kubeless "tested" should be moved under a /chart folder.
  • We should use github pages to serve a chart repo of those charts so that we can do helm repo add functions https://kubeless.github.io/functions just like in the monocular repo

Start with minio and tika

Latest version of `kubernetes` python module doesn't work in kubeless functions

After installing the latest kubernetes python module (3.0.0), when the function is going to load it, it throws this error:

Traceback (most recent call last):
  File "/kubeless.py", line 10, in <module>
    '/kubeless/%s.py' % os.getenv('MOD_NAME'))
  File "/kubeless/tweet.py", line 4, in <module>
    from kubernetes import client, config
  File "/opt/kubeless/pythonpath/lib/python2.7/site-packages/kubernetes/__init__.py", line 16, in <module>
    import kubernetes.config
  File "/opt/kubeless/pythonpath/lib/python2.7/site-packages/kubernetes/config/__init__.py", line 17, in <module>
    from .kube_config import (list_kube_config_contexts, load_kube_config,
  File "/opt/kubeless/pythonpath/lib/python2.7/site-packages/kubernetes/config/kube_config.py", line 21, in <module>
    import google.auth
ImportError: No module named google.auth

Manually installing the module google.auth module with this command pip install google.auth makes the function to work but adding that module to the requirements.txt file for a function does not solve the issue.

The kubernetes module 2.0.0 version works fine.

Make File for slack bot has Tab/Spaces Issue

[***]$ make slack
Makefile:4: *** missing separator (did you mean TAB instead of 8 spaces?).  Stop.
diff --git a/incubator/slack/Makefile b/incubator/slack/Makefile
index d833c4f..0ffe1c2 100644
--- a/incubator/slack/Makefile
+++ b/incubator/slack/Makefile
@@ -1,4 +1,4 @@
 slack:
        kubeless function deploy slack --runtime python2.7 --handler bot.handler --from-file bot.py --dependencies requirements.txt
 events:
-        kubeless function deploy k8s-events --trigger-topic k8s --from-file botevents.py --handler botevents.handler --runtime python2.7 --dependencies requirements.txt
+       kubeless function deploy k8s-events --trigger-topic k8s --from-file botevents.py --handler botevents.handler --runtime python2.7 --dependencies requirements.txt

minio-resize on minikube

I'm trying to deploy minio-resize on minikube (v0.28.0). I installed kubeless (v0.6.0) and deployed the kafka-zookeeper.yaml of the same version.
I installed Minio as recommended here. I enabled kafka on .minio/config.json (I'm not sure if this file is gonna be used because I installed minio for linux before following the tutorial for minikube)

"kafka": {
                     "1": {
                             "enable": true,
                             "brokers": ["localhost:9092"],
                             "topic": "minio_new_object"
                     }
             },


The bucket creation is fine. However when I add the event I get the following issue:

$ mc events add localminio/foobar arn:minio:sqs:us-east-1:1:kafka --events put
mc: <ERROR> Cannot enable notification on the specified bucket. A specified destination ARN does not exist or is not well-formed. Verify the destination ARN.

It has something to deal with the kafka configuration but I can't find the right documentation.

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.