Knative deployment on GKE for AWS lambda function implementation

5/12/2020

We are trying to implement Knative on GKE to run AWS lambda compatible functions using triggermesh. I have followed the below link to install Knative and Tekton on Google Kubernetes Engine (GKE) :

https://knative.dev/v0.11-docs/install/knative-with-gke/ https://github.com/tektoncd/pipeline/blob/master/docs/install.md#installing-tekton-pipelines-on-kubernetes

and used the below link for a sample lambda function for testing: https://github.com/triggermesh/knative-lambda-runtime

Once we start deploying the build templates and tasks, we are successfully able to create the tasks and build templates in the cluster but when we deploy the service we are getting the below error:

FATA[0029] Deploying builder: taskrun "python-test-6rx5s" deployment failed: "step-export" exited with code 1 (image: "docker-pullable://gcr.io/kaniko-project/executor@sha256:a49506bad46fa4a8ce412239b25ebc2577290cc21ca04a0618d6157e379f811e"); for logs run: kubectl -n default logs python-test-6rx5s-pod-btszk -c step-export\n

When checked in the pod, we have below error:

root@rahul-Latitude-5590:~# kubectl -n default logs python-test-6rx5s-pod-btszk -c step-export
INFO[0000] Downloading base image gcr.io/triggermesh/knative-lambda-python37
2020/05/12 08:54:36 Unable to read "/config.json": open /config.json: no such file or directory
ERROR: logging before flag.Parse: E0512 08:54:36.766767 9 metadata.go:142] while reading 'google-dockercfg' metadata: http status code: 404 while fetching url http://metadata.google.internal./computeMetadata/v1/instance/attributes/google-dockercfg
ERROR: logging before flag.Parse: E0512 08:54:36.770783 9 metadata.go:159] while reading 'google-dockercfg-url' metadata: http status code: 404 while fetching url http://metadata.google.internal./computeMetadata/v1/instance/attributes/google-dockercfg-url
INFO[0000] Unpacking rootfs as cmd RUN if [ -f requirements.txt ]; then pip3.7 install -r requirements.txt ;fi requires it.
INFO[0008] Taking snapshot of full filesystem...
INFO[0009] Skipping paths under /kaniko, as it is a whitelisted directory
INFO[0009] Skipping paths under /var/run, as it is a whitelisted directory
INFO[0009] Skipping paths under /workspace, as it is a whitelisted directory
INFO[0009] Skipping paths under /tekton/results, as it is a whitelisted directory
INFO[0009] Skipping paths under /tekton/tools, as it is a whitelisted directory
INFO[0009] Skipping paths under /tekton/home, as it is a whitelisted directory
INFO[0009] Skipping paths under /proc, as it is a whitelisted directory
INFO[0009] Skipping paths under /sys, as it is a whitelisted directory
INFO[0009] Skipping paths under /dev, as it is a whitelisted directory
INFO[0009] Skipping paths under /busybox, as it is a whitelisted directory
INFO[0012] ENV _HANDLER "handler.endpoint"
INFO[0012] Using files from context: [/workspace/workspace/aws-python-simple-http-endpoint]
INFO[0012] COPY . .
INFO[0012] Taking snapshot of files...
INFO[0012] RUN if [ -f requirements.txt ]; then pip3.7 install -r requirements.txt ;fi
INFO[0012] cmd: /bin/sh
INFO[0012] args: [-c if [ -f requirements.txt ]; then pip3.7 install -r requirements.txt ;fi]
INFO[0012] Taking snapshot of full filesystem...
INFO[0014] Skipping paths under /kaniko, as it is a whitelisted directory
INFO[0014] Skipping paths under /var/run, as it is a whitelisted directory
INFO[0014] Skipping paths under /workspace, as it is a whitelisted directory
INFO[0014] Skipping paths under /tekton/results, as it is a whitelisted directory
INFO[0014] Skipping paths under /tekton/tools, as it is a whitelisted directory
INFO[0014] Skipping paths under /tekton/home, as it is a whitelisted directory
INFO[0014] Skipping paths under /proc, as it is a whitelisted directory
INFO[0014] Skipping paths under /sys, as it is a whitelisted directory
INFO[0014] Skipping paths under /dev, as it is a whitelisted directory
INFO[0014] Skipping paths under /busybox, as it is a whitelisted directory
INFO[0015] No files were changed, appending empty layer to config. No layer added to image.
INFO[0015] ENTRYPOINT ["/opt/aws-custom-runtime"]
**2020/05/12 08:54:52 Unable to read "/config.json": open /config.json: no such file or directory
error pushing image: failed to push to destination knative.registry.svc.cluster.local/default/python-test:DhcQnr: Get http://knative.registry.svc.cluster.local/v2/: dial tcp: lookup knative.registry.svc.cluster.local on 10.0.0.10:53: no such host**

We have tried to change the docker registry settings and set it to a remote docker-hub registry with authenticated username and password but the image just doesn't take that information. Could you please provide some inputs in understanding as to why and where is this configuration of local registry getting overwritten with the one which is set by us? I tried to look for an answer but hit a dead end every time.

Any help is appreciated. Thank you in advance.

Also we would like to know if there is a best way to run AWS lambda functions on Google Kubernetes Engine (GKE).

-- Rahul Kumar Singh
aws-serverless
google-kubernetes-engine
knative

0 Answers