标签: openfaas

允许在 Kubernetes 上使用本地库中的图像

我正在遵循教程https://docs.openfaas.com/tutorials/first-python-function/

目前,我有正确的图像

$ docker images | grep hello-openfaas
wm/hello-openfaas                                     latest                          bd08d01ce09b   34 minutes ago      65.2MB
$ faas-cli deploy -f ./hello-openfaas.yml 
Deploying: hello-openfaas.
WARNING! You are not using an encrypted connection to the gateway, consider using HTTPS.

Deployed. 202 Accepted.
URL: http://IP:8099/function/hello-openfaas
Run Code Online (Sandbox Code Playgroud)

有一个步骤预先警告我进行一些设置(我的情况是我正在使用Kubernetes并且minikube不想推送到远程容器注册表,我应该启用 Kubernetes 上本地库中的图像的使用。),我查看提示

see the helm chart for how to set the ImagePullPolicy
Run Code Online (Sandbox Code Playgroud)

我不确定如何正确配置它。最后的结果表明我失败了。

不出所料,我无法访问函数服务,我在 https://docs.openfaas.com/deployment/troubleshooting/#openfaas-didnt-start中找到了一些线索,这可能有助于诊断问题。

$ kubectl logs -n openfaas-fn deploy/hello-openfaas
Error from server (BadRequest): container "hello-openfaas" in pod "hello-openfaas-558f99477f-wd697" is …
Run Code Online (Sandbox Code Playgroud)

kubernetes minikube kubernetes-helm serverless openfaas

6
推荐指数
1
解决办法
1538
查看次数

如何在 Open FaaS 中返回 HTTP 状态代码?

openfaas中部署的函数如何向调用者返回不同的HTTP状态代码?就像 4xx 代码一样。

根据文档,看门狗将处理http 状态 200 或 5xx 的stdout或。stderr

有没有办法改变400、409等状态?我正在使用下载的 csharp 模板faas-cli

openfaas

5
推荐指数
1
解决办法
1160
查看次数

如何将 typescript 与 openfaas 处理程序一起使用?

我是第一次使用 openfaas。我按照本指南进行了操作。

cli 创建handler.js文件。

是否可以使用打字稿?创建 typescript 文件而不是 javascript 文件?

node.js openfaas

5
推荐指数
0
解决办法
193
查看次数

Faasd - 无法从私人注册表中提取映像

我有一个使用 OpenFaaS 的应用程序。

特别是,我使用faasd,因为该函数将在处理能力较差的设备上运行。我有一个私人注册表,上面有一个“X”函数的图像。我想从 faasd 中提取此映像来部署并执行它,但我遇到了一个问题:当我尝试执行该操作时,我似乎没有经过身份验证,但我正确地传递了registryAuth令牌。

这里有一个我正在做的示例(遵循此https://ericstoekl.github.io/faas/operations/managing-images/#deploy-functions-with-private-registries-credentials

邮政

<ip_address>:8080/system/functions
Run Code Online (Sandbox Code Playgroud)

标题:

{
"Authorization": "mytoken"
}
Run Code Online (Sandbox Code Playgroud)

身体:

{
    "service": "functionName",
    "image": "<registry_ip_address>/functions/functionName:<version>",
    "envProcess": "/.../myprocess",
    "registryAuth": <base64 token obtained from 'user:password'>,
    "secrets": [
        "mysecret"
    ]
}
Run Code Online (Sandbox Code Playgroud)

我确认参数全部正确,但收到此错误:

“无法拉取映像 <registry_ip_address>/functions/functionName:: 无法拉取:无法解析引用“<registry_ip_address>/functions/functionName:”:没有为令牌身份验证质询指定范围”

注册表运行良好,因为如果我尝试使用 docker 以经典方式下载映像,我就能够拉取映像。

先感谢您!

docker faas serverless containerd openfaas

1
推荐指数
1
解决办法
1309
查看次数