-
Notifications
You must be signed in to change notification settings - Fork 81
Deploy function : Docker image as runtime-image #178
Comments
Hi @aurelienspnll, It's true that the plugin has a check to avoid empty
|
Hi @andresmgot, Thanks for your quick answer. But now I have this error :
I know it's because I do not set the runtime field but actually, I would like to use a Docker image. How can I do? |
I see, you may be able to workaround that issue as well if you set a valid runtime (e.g. python2.7). If you are using a prebuilt image that, in theory, should be ignored as well if you don't specify dependencies. Does it work for you if you set a runtime? TBH this plugin is not prepared to use prebuilt images. |
That doesn't work either. (By the way announcement-fn = myfoo of previous comments). |
I see, now the problem is in the back-end. Can you check the logs of the function controller to know what's the issue? Also, if you are able to deploy the same function with the |
The problem comes from the handler. When I deploy in this way : Here are the logs of the function-controller :
As you see I just have a warning for handler. And here is the function created by Kubeless (obtain with apiVersion: kubeless.io/v1beta1
kind: Function
metadata:
creationTimestamp: "2019-05-03T07:54:23Z"
finalizers:
- kubeless.io/function
generation: 1
labels:
created-by: kubeless
function: announcement-fn
name: announcement-fn
namespace: default
resourceVersion: "3938"
selfLink: /apis/kubeless.io/v1beta1/namespaces/default/functions/announcement-fn
uid: aa3733f5-6d78-11e9-8a77-0800279a3ffc
spec:
checksum: ""
deployment:
metadata:
creationTimestamp: null
spec:
strategy: {}
template:
metadata:
creationTimestamp: null
spec:
containers:
- env:
- name: SPRING_KAFKA_BOOTSTRAP_SERVERS
value: kafka:9092
image: localhost:5000/al/announcement
imagePullPolicy: Always
name: ""
resources:
limits:
cpu: "0"
memory: 300Mi
requests:
cpu: "0"
memory: 300Mi
status: {}
deps: ""
function: ""
function-content-type: ""
handler: ""
horizontalPodAutoscaler:
metadata:
creationTimestamp: null
spec:
maxReplicas: 0
scaleTargetRef:
kind: ""
name: ""
status:
conditions: null
currentMetrics: null
currentReplicas: 0
desiredReplicas: 0
runtime: ""
service:
ports:
- name: http-function-port
port: 8080
protocol: TCP
targetPort: 8080
selector:
created-by: kubeless
function: announcement-fn
type: ClusterIP
timeout: "180" But when I deploy with serverless, I am obliged to declare a handler (As you told me "not empty"). My serverless.yaml file : service: announcement-fn
provider:
name: kubeless
runtime: python2.7
plugins:
- serverless-kubeless
functions:
announcement-fn:
description: 'Announcement function'
memorySize: 300Mi
handler: "not empty"
environment:
SPRING_KAFKA_BOOTSTRAP_SERVERS: 'kafka:9092'
image: localhost:5000/al/announcement Here is the logs of the function-controller after I execute
And to finish the function created by Kubeless : apiVersion: kubeless.io/v1beta1
kind: Function
metadata:
annotations:
kubeless.serverless.com/description: Announcement function
creationTimestamp: "2019-05-03T08:03:07Z"
finalizers:
- kubeless.io/function
generation: 2
labels:
created-by: kubeless
function: announcement-fn
name: announcement-fn
namespace: default
resourceVersion: "4677"
selfLink: /apis/kubeless.io/v1beta1/namespaces/default/functions/announcement-fn
uid: e2c3e3e0-6d79-11e9-8a77-0800279a3ffc
spec:
checksum: sha256:038cfa6c3ff8dfe61d4ec6c70c10c5d847e67c4aa63a87ef1bb90c0d54176f90
deployment:
metadata:
creationTimestamp: null
spec:
strategy: {}
template:
metadata:
creationTimestamp: null
spec:
containers:
- env:
- name: SPRING_KAFKA_BOOTSTRAP_SERVERS
value: kafka:9092
image: localhost:5000/al/announcement
name: announcement-fn
resources:
limits:
memory: 300Mi
requests:
memory: 300Mi
status: {}
deps: ""
function: UEsDBBQACAAIAAAAIQAAAAAAAAAAAAAAAAARAAAAcG [...
a lot of character...] EAABEsAAAAAA==
function-content-type: base64+zip
handler: not empty
horizontalPodAutoscaler:
metadata:
creationTimestamp: null
spec:
maxReplicas: 0
scaleTargetRef:
kind: ""
name: ""
status:
conditions: null
currentMetrics: null
currentReplicas: 0
desiredReplicas: 0
runtime: python2.7
service:
ports:
- name: http-function-port
port: 8080
protocol: TCP
targetPort: 8080
selector:
function: announcement-fn
type: ClusterIP
timeout: "180" So the problem is that with Serverless I can not deploy a function without defining a hander. What poses problem thereafter for Kubeless... 😩 |
I see, the error is actually complaining about the format of the handler so maybe if you try In any case, I think it's better if we remove the check for non empty handlers here. Would you mind sending a PR? It should be easy to just remove the condition: https://github.com/serverless/serverless-kubeless/blob/master/lib/deploy.js#L556 |
Hello,
I would like to know if it is possible to deploy a function using a Docker image on minikube cluster.
With Kubeless, I was able to do this :
kubeless function deploy foo --runtime-image docker_image_foo
What I did not succeed to reproduce with serverless. Here is my serverless.yaml file that I used:
So I got this error :
Serverless: Skipping deployment of myfoo since it doesn't have a handler
Is there a way to not define handler?
Is there an equivalent to the kubeless command line above for serverless?
The text was updated successfully, but these errors were encountered: