forked from lima-vm/lima
-
Notifications
You must be signed in to change notification settings - Fork 0
/
faasd.yaml
68 lines (62 loc) · 2.52 KB
/
faasd.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Deploy faasd (which installs a bundled containerd).
#
# It can be accessed from the host by authenticating with faas-cli;
# the ports are already forwarded automatically by lima.
#
# This example requires Lima v0.7.0 or later.
message: |
# Get the faas-cli from one of following sources:
# package manager:
brew install faas-cli
#
# script:
curl -sLS https://cli.openfaas.com | sh
#
# You can now log into your gateway:
------
export OPENFAAS_URL=http://localhost:8080
limactl shell faasd sudo cat /var/lib/faasd/secrets/basic-auth-password | faas-cli login -u admin --password-stdin
------
#
# Once logged in, you can deploy your first function
------
faas-cli store deploy NodeInfo
------
# Image is set to jammy (22.04 LTS) for long-term stability
images:
# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months.
- location: "https://cloud-images.ubuntu.com/releases/22.04/release-20220420/ubuntu-22.04-server-cloudimg-amd64.img"
arch: "x86_64"
digest: "sha256:de5e632e17b8965f2baf4ea6d2b824788e154d9a65df4fd419ec4019898e15cd"
- location: "https://cloud-images.ubuntu.com/releases/22.04/release-20220420/ubuntu-22.04-server-cloudimg-arm64.img"
arch: "aarch64"
digest: "sha256:66224c7fed99ff5a5539eda406c87bbfefe8af6ff6b47d92df3187832b5b5d4f"
# Fallback to the latest release image.
# Hint: run `limactl prune` to invalidate the cache
- location: "https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.img"
arch: "x86_64"
- location: "https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-arm64.img"
arch: "aarch64"
# Mounts are disabled in this example, but can be enabled optionally.
mounts: []
# containerd is installed by the faasd installer script, not by Lima, so the values are set to false here.
containerd:
system: false
user: false
provision:
- mode: user
script: |
#!/bin/sh
curl -sfL https://raw.githubusercontent.com/openfaas/faasd/master/hack/install.sh | bash -s -
probes:
- script: |
#!/bin/bash
set -eux -o pipefail
if ! timeout 30s bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:8080/healthz)" != "200" ]]; do sleep 5; done'; then
echo >&2 "faasd is not running yet"
exit 1
fi
hint: |
The faasd service is not yet running.
Run "limactl shell faasd sudo journalctl -u faasd" to check the log.
If that is still empty, check the bottom of the log at "/var/log/cloud-init-output.log".