You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _posts/2021-01-31-gitea-faas.md
+74-32Lines changed: 74 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,9 +23,12 @@ In this post we will walk through building a simple bot to label pull-requests.
23
23
24
24
## Pre-requisites
25
25
26
-
For the purposes of this guide we'll create a local virtual machine and install faasd on it, but these instructions can be extended to use a Digital Ocean Droplet, or even a Raspberry Pi. The tutorial should take you less than 15-30 minutes to try.
26
+
For the purposes of this guide we'll create a local virtual machine and install faasd on it, but these instructions can be extended to use TLS on an [Digital Ocean Droplet](https://www.openfaas.com/blog/faasd-tls-terraform/), or even a [Raspberry Pi](https://blog.alexellis.io/faasd-for-lightweight-serverless/). The tutorial should take you less than 15-30 minutes to try.
[Multipass](https://multipass.run) is a lightweight virtual machine runner, think docker-compose but for ubuntu virtual machines. We'll use this to get a virtual machine with faasd up and running quickly.
31
34
@@ -35,20 +38,10 @@ For the purposes of this guide we'll create a local virtual machine and install
35
38
brew install multipass
36
39
## or, on Linux, you can install using the snap command
# For windows, you'll need to use the installer found on multipass.run
48
42
49
43
# Run a local VM
50
44
multipass launch \
51
-
--cloud-init cloud-config.txt \
52
45
--name faasd
53
46
54
47
# Verify your VM has been started
@@ -57,9 +50,22 @@ multipass info faasd
57
50
58
51
### Connect faas-cli to your faasd install
59
52
60
-
Now that faasd is up and running, we'll need to login into the gateway with the `faas-cli`.
53
+
Now that faasd is up and running, we'll need to install faasd, and login into the gateway with the `faas-cli`.
61
54
62
55
```bash
56
+
# Connect to VM
57
+
multipass exec faasd bash
58
+
59
+
# Clone
60
+
git clone https://github.com/openfaas/faasd.git
61
+
62
+
# Install faasd
63
+
cd faasd
64
+
sh hack/install.sh
65
+
66
+
# Now exit the VM
67
+
exit
68
+
63
69
# Install faas-cli on your host machine
64
70
curl -sSLf https://cli.openfaas.com | sh
65
71
@@ -81,43 +87,79 @@ faas-cli list
81
87
Next we'll need to install Gitea it up and running. This example uses the bleeding edge nightly version, but for production use you may wish to use the current stable version of Gitea.
### Optionally install OpenFaaS and Gitea on a Kubernetes Cluster
124
+
125
+
`faasd` is great for single node installations, but if you are planning on scaling up to multiple servers you can install OpenFaaS and Gitea on a kubernetes cluster.
126
+
127
+
```bash
128
+
# Get arkade, and move it to $PATH
129
+
curl -sLS https://dl.get-arkade.dev | sh
130
+
sudo mv arkade /usr/local/bin/
131
+
132
+
# Fetch Kubernetes tools to run locally
133
+
arkade get kind
134
+
135
+
# OpenFaaS CLI
136
+
arkade get faas-cli
137
+
138
+
# Create a cluster - if you already have a kubernetes cluster somewhere you can skip this step
139
+
kind create cluster
140
+
141
+
# Install OpenFaaS
142
+
arkade install openfaas
143
+
144
+
# Install Gitea
145
+
arkade install gitea
146
+
```
147
+
148
+
Next, you'll need to portforward both Gitea, and OpenFaaS, as well as login into the OpenFaaS gateway with faas-cli
Finally after Gitea is installed, we'll need to verify the installation. To do this we will open up the Gitea interface in the browser and login into it.
@@ -346,4 +388,4 @@ Now that we’ve seen how to create a simple bot using faasd, from here we can b
346
388
347
389
### Taking it further
348
390
349
-
For a production ready OpenFaaS function that supports automation in Gitea you can view the [Gitea/Buildkite connector](https://github.com/techknowlogick/gitea-buildkite-connector).
391
+
For a production ready OpenFaaS function that supports automation in Gitea you can view the [Gitea/Buildkite connector](https://github.com/techknowlogick/gitea-buildkite-connector), or build upon the above [LGTMBot function](https://github.com/techknowlogick/faas-lgtmbot).
0 commit comments