Im having trouble invoking functions using kubeless. Here is the function spec
---
apiVersion: kubeless.io/v1beta1
kind: Function
metadata:
name: smk
namespace: smktest
spec:
handler: hello.handler
runtime: python2.7
function: |
import json
def handler():
return "hello world"
deployment:
spec:
template:
spec:
containers:
- env:
- name: FOO
value: bar
name: "smk-deployment"
resources:
limits:
cpu: 100m
memory: 100Mi
requests:
cpu: 100m
memory: 100Mi
When I try to call the function as below,
kubeless function call smk
I get
FATA[0000] Unable to find the service for smk
Two part question
Update Running kubeless function ls --namespace=smktest yields below
NAME NAMESPACE HANDLER RUNTIME DEPENDENCIES STATUS
smk smktest hello.handler python2.7 MISSING: Check controller logs
Next I tried kubectl logs -n kubeless -l kubeless=controller
there's tons of error logs but I don't see anything specific to this function
When I try to call the function as below,
kubeless function call smk
I get
FATA[0000] Unable to find the service for smk
Running
kubeless function ls --namespace=smktest
Then surely you would need to include the --namespace=smktest
in your invocation command, too:
kubeless function call --namespace=smktest smk
How do I specify Environment variables needed by this function ? Thank you
As best I can tell, there seems to be two approaches in use:
Deployment
template, which the function controller
appears to merge but as far as I know container: image:
is required in a Deployment
, so you'd have to specify one in order to get access to its env:
declarationPod
s ServiceAccount
token to request cluster resources manually which might include a ConfigMap
, Secret
, or even resolving your own kubeless.io/function
manifest and pulling something out of its annotations or similar