├── .DEREK.yml ├── README.md ├── README.md.old ├── docs └── README.md └── pub-cert.pem /.DEREK.yml: -------------------------------------------------------------------------------- 1 | redirect: https://raw.githubusercontent.com/openfaas/faas/master/.DEREK.yml 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Community Cluster 2 | 3 | The Community Cluster was a free, hosted version of OpenFaaS Cloud for the community to use. 4 | 5 | -------------------------------------------------------------------------------- /README.md.old: -------------------------------------------------------------------------------- 1 | # community-cluster 2 | 3 | Apply for free access to *The OpenFaaS Cloud Community Cluster* for CI/CD, hosting, and TLS endpoints. 4 | 5 | ## What do you get? 6 | 7 | The OpenFaaS Cloud Community Cluster comes with: 8 | 9 | * Deep GitHub integration & CI/CD. Just `git push` 10 | * Public endpoints with free, automatic TLS 11 | * Personal dashboard with OAuth2 / MFA 12 | * Auto-scaling and metrics 13 | * Private and public repos supported 14 | * Build and runtime logs 15 | 16 | From your personal dashboard, you can manage all your functions and APIs in one place: 17 | 18 | ![Personal dashboard](https://www.openfaas.com/images/openfaas-cloud-gitlab/dashboard.png) 19 | 20 | You can see which commit is deployed and review the build logs: 21 | 22 | ![Details for function](https://www.openfaas.com/images/openfaas-cloud-gitlab/details.png) 23 | 24 | Troubleshoot your code with runtime logs: 25 | 26 | ![Runtime logs](https://docs.openfaas.com/images/openfaas-cloud/welcome-11.png) 27 | 28 | If you're new to OpenFaaS Cloud, then checkout [the user guide](https://docs.openfaas.com/openfaas-cloud/user-guide/) 29 | 30 | There's two options for getting started. Free hosted access, or self-service. 31 | 32 | ## A) Get free hosted access 33 | 34 | By applying you have read and agree to the [terms and conditions of the Community Cluster](https://github.com/openfaas/openfaas-cloud/blob/master/PRIVACY.md). 35 | 36 | ### 1. Apply for access 37 | 38 | First off you should [apply for access](https://forms.gle/8e6ZXJKMcDHpV6Xu6). All applications will be reviewed, so please fill them out accurately and make sure you agree to the terms and conditions of the platform. 39 | 40 | ### 2. After you receive your confirmation email 41 | 42 | When you receive your confirmation email, you'll already have access. Your username will also be added to a [CUSTOMERS file](https://github.com/openfaas/openfaas-cloud/blob/master/CUSTOMERS) in the openfaas-cloud repo. 43 | 44 | ### 3. Deploy your first function with the New User Guide 45 | 46 | From here you have a couple of options for kicking the tires. It's recommended to try both: 47 | 48 | * First try the [quick start](./docs/) to help you familiarise yourself with how OpenFaaS Cloud works 49 | * Then run through the walk-through in the [New User Guide](https://docs.openfaas.com/openfaas-cloud/user-guide/) to deploy an API with Node.js and Express.js 50 | 51 | You will also be [invited to OpenFaaS Slack](https://docs.openfaas.com/community/) where you can ask questions in the `#openfaas-cloud` channel. 52 | 53 | If you want to keep up to date and help support the costs of your free account, you can do so via [GitHub Sponsors](https://github.com/sponsors/alexellis/). 54 | 55 | ## B) DIY / self-service 56 | 57 | If you'd like to spin up your own OpenFaaS Cloud for your team, or for development you can use the [ofc-bootstrap](https://github.com/openfaas-incubator/ofc-bootstrap) tool. Once you have configured GitHub or GitLab, the bootstrap process takes around 100 seconds. 58 | 59 | View [OpenFaaS Cloud on GitHub](https://github.com/openfaas/openfaas-cloud/) 60 | 61 | OpenFaaS Ltd offers consulting and expert installation of OpenFaaS Cloud, email [sales@openfaas.com](mailto:sales@openfaas.com) to find out more. 62 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | ## OpenFaaS Cloud Community Cluster 2 | 3 | Activate your access. 4 | 5 | ### How does it work? 6 | 7 | The Community Cluster is fully hosted so all you have to do is select a GitHub repo and *click Install* using the GitHub UI. Then just `git push` your OpenFaaS functions into a public or private GitHub repo. Within seconds you'll get your own public HTTPS endpoints with a personalised dashboard and commit statuses reported back directly to your GitHub account. 8 | 9 | OpenFaaS Cloud is portable which means you can host your own anywhere where you have OpenFaaS deployed, but that's [another guide](https://github.com/openfaas/openfaas-cloud/tree/master/docs). 10 | 11 | ![Personal dashboard](https://www.openfaas.com/images/openfaas-cloud-gitlab/dashboard.png) 12 | 13 | ![Details for function](https://www.openfaas.com/images/openfaas-cloud-gitlab/details.png) 14 | 15 | ## Introducing OpenFaaS Cloud 16 | 17 | [OpenFaaS Cloud](https://github.com/openfaas/openfaas-cloud) is a multi-user platform for delivering OpenFaaS to your users, your community or your team. 18 | 19 | Features: 20 | * Personal UI dashboard for your functions (per user) 21 | * Store your functions in a private or public GitHub repo 22 | * CI/CD triggered by `git push` with build/test logs available 23 | * Built-in integration with GitHub statuses and commits 24 | * Integration via GitHub App with fine-gained OAuth permissions 25 | 26 | These instructions apply to the OpenFaaS Cloud Community Cluster. This cluster runs on Kubernetes and supports the use of SealedSecrets. 27 | 28 | [Fork/Star the Github repo](https://github.com/openfaas/openfaas-cloud) for the conceptual architecture diagram and for more screenshots. 29 | 30 | ## Pre-reqs Request access by Pull Request 31 | 32 | 1. Agree to the [Terms & Conditions and read the privacy statement](https://github.com/openfaas/openfaas-cloud/blob/master/PRIVACY.md) 33 | 2. Send your Google Form in to apply for access 34 | 35 | Wait for an email from the OpenFaaS Ltd team. Feel free to email [sales@openfaas.com](mailto:sales@openfaas.com) if you haven't heard from us within 2-5 working days. 36 | 37 | ## Quick start (5-10 minutes) 38 | 39 | This quick-start takes around 5-10 minutes and doesn't require you to setup Docker or other tooling on your computer. You'll only need access to `git` and the OpenFaaS CLI. 40 | 41 | ### Create a GitHub repo for your OpenFaaS functions 42 | 43 | 3. Create a new GitHub repo and clone it - both public and private are supported 44 | 45 | Enter the directory of your new git repo with `cd folder` 46 | 47 | 4. Get the FaaS-CLI from `brew install faas-cli` or `curl -sLSf https://cli.openfaas.com | sudo sh` 48 | 49 | 5. Create at least one function using a language like `python`, `node` or `go` for instance: 50 | 51 | ``` 52 | faas-cli template pull 53 | ``` 54 | 55 | Pick a language from the list below: 56 | 57 | ``` 58 | faas-cli new --list 59 | ``` 60 | 61 | You don't have to pick Go, but I'll do that in this example. If you'd like to try Node.js and Express.js, try the [New User Guide](https://docs.openfaas.com/openfaas-cloud/user-guide/). 62 | 63 | > Note: see appendix for additional templates available on the community cluster. 64 | 65 | 6. Create a function locally and for the `--prefix` variable use your GitHub user account, so mine would be: 66 | 67 | ``` 68 | faas-cli new helloworld --lang go --prefix alexellis 69 | ``` 70 | 71 | If you want to customize the code edit `./helloworld/handler.go` or read the docs to learn [how to vendor a dependency with OpenFaaS](https://docs.openfaas.com/cli/templates/#10-go). 72 | 73 | 7. Rename the `.yml` file to `stack.yml` so that OpenFaaS Cloud knows where to find your function(s) 74 | 75 | ### Add the OpenFaaS GitHub App 76 | 77 | 8. Install the GitHub App on your repo: 78 | 79 | Please *only do this for any OpenFaaS repos you create*, not for "all" repos. 80 | 81 | > If you do this for "all" repos then we will try to build any Git repo that you push changes into which will be wasteful and useless. 82 | 83 | https://github.com/apps/openfaas-cloud-community-cluster 84 | 85 | This connects GitHub push events to OpenFaaS cloud so that we can build and deploy your function as soon as you push code. 86 | 87 | 9. Now commit the changes and push them to the remote side. 88 | 89 | ``` 90 | git add -A 91 | git commit -s -m "Initial function" 92 | git push origin master 93 | ``` 94 | 95 | ### View the build/deployment feedback 96 | 97 | 9.1. View the Commit Statuses / Checks 98 | 99 | Navigate to your GitHub repo and click on the "Commits" link - this will open up a list of all your commits. Here you'll see a Tick or X next to each commit status showing the results of the container builder and deployment. 100 | 101 | To get the build logs and more information you can click on any of the names of the functions - this uses the new GitHub Checks feature to show detailed information. 102 | 103 | 9.2 Add more functions 104 | 105 | You can have one or many functions in your stack.yml file. 106 | 107 | To append new functions type in: 108 | 109 | ``` 110 | faas new --lang go --prefix alexellis --append=./stack.yml 111 | ``` 112 | 113 | ### Log into your personal dashboard 114 | 115 | 10. Your dashboard 116 | 117 | Your dashboard provides build logs for failed builds, unit test errors and will give a live link to your endpoint. 118 | 119 | View your dashboard at https://system.o6s.io 120 | 121 | You will be asked to Log in with GitHub for Single-Sign-On (SSO) - after that you will be issued a JWT token and cookie which is stored in your browser for further requests. 122 | 123 | 11. Your function endpoints 124 | 125 | Your functions will be available with HTTPS on your own sub-domain, for example: 126 | 127 | ``` 128 | https://alexellis.o6s.io/hallo 129 | ``` 130 | 131 | The above username is "alexellis" and the function name is "hallo" 132 | 133 | You can now use your public endpoint for whatever you need. You can read HTTP meta-data like the query-string, headers and path. [Read more in the Workshop](https://github.com/openfaas/workshop/blob/master/lab4.md#inject-configuration-through-environmental-variables). 134 | 135 | ### Remove the functions 136 | 137 | When you're finished, please remove your functions by: 138 | 139 | * Removing the code and do a git push 140 | * Delete the repo 141 | * Remove OpenFaaS Cloud from the specific repo 142 | 143 | ### Rinse & repeat 144 | 145 | 12. Iterating on the code 146 | 147 | Each time you run `git commit -s` and `git push` a new CI/CD build will be initiated and your functions in the given repo will be discovered and redeployed. If the unit tests fail or the container can't start then the previous version will remain up and running. 148 | 149 | 13. State for your functions 150 | 151 | You can make use of any managed service to store state such as AWS S3 or DBaaS (database as a service) from a remote provider. The Appendix contains instructions on how to provide keys, credentials or other secrets to your functions in a secure way. 152 | 153 | 14. Remove one or more of the test functions 154 | 155 | If you want to remove one or more of your functions you can either remove them from your `stack.yml` file (garbage collection will remove them for you). Or you can remove the GitHub App integration - if you have multiple repos just uncheck the ones you want to delete. 156 | 157 | ### What else do I need to know? 158 | 159 | 15. Tell me more about privacy 160 | 161 | * Your dashboard 162 | 163 | Your dashboard can only be viewed by your user. You can also view dashboards for any organisations that you are a public member of that have functions deployed (Github). 164 | 165 | * Your endpoints 166 | 167 | All your functions will available via your public URL, so if you want to implement authentication you can do this however you'd like. Some options may be: by using HMAC and a symmetric key, basic authentication or an API key. For any of those options you will want to use secrets as described in the appendix. 168 | 169 | * Your Docker images 170 | 171 | Your Docker images will be published under the shared account ["ofcommunity" on the Docker Hub](https://hub.docker.com/r/ofcommunity/) - this means you can run your images locally for debugging and testing. 172 | 173 | 15. Auto-scaling 174 | 175 | Your function will auto-scale up to a maximum of 4 replicas given a steady flow of traffic. 176 | 177 | See the appendix to learn how scale to and from zero works. 178 | 179 | 16. Get involved! 180 | 181 | Now it's over to you to Tweet, write a blog, [join Slack](https://docs.openfaas.com/community) and tell your friends. You can also Star the project, pick up an open issue, make a suggestion or contribute via GitHub: https://github.com/openfaas/openfaas-cloud/ 182 | 183 | You can also try the [New User Guide](https://docs.openfaas.com/openfaas-cloud/user-guide/) which walks you through building a Node.js Express.js app / API with detailed screenshots and step-by-step instructions. 184 | 185 | ## Over to you - time to build something 186 | 187 | Now that you have the basics in-hand it's over to you to build something and report back on how you found the experience so we can continue to improve the platform. 188 | 189 | * Write a simple blog using the node8-express or golang-middleware templates (see the appendix for more) 190 | * Write a Slack bot or auto-responder - here's the [Welcome Bot for OpenFaaS written in Python 3](https://github.com/alexellis/my-fn/tree/master/join-welcome) 191 | * Connect to any data-source you like by using the Incoming Webhook app on [IFTTT.com](https://ifttt.com/) 192 | * Write your own Alexa skill - use my [Dockercon skill as an example](https://blog.alexellis.io/serverless-alexa-skill-mobymingle/) 193 | * Write a URL shortener - by using HTTP redirects you can take a URL such as https://openfaas.o6s.io/signup and have it redirect to any site. You can even use HTTP parameters or query-strings. See [my example](https://github.com/openfaas/cloud-functions) 194 | * Deploy a GitHub badge generator - through the use of parameters or query-strings you can generate dynamic GitHub pages, images or SVGs - [ee an example here](https://github.com/faasinating/faas-cloud-badge) 195 | * Store logs / data or notes using S3 as a backing datastore - [see an example here](https://github.com/openfaas/openfaas-cloud/tree/master/pipeline-log) 196 | * Build a CRUD API using Mongo as a Service via [Atlas Mongodb](https://www.mongodb.com/cloud/atlas) or a similar provider 197 | * Integrate with any OAuth 2.0 provider by building your very own app. How about [Strava](https://developers.strava.com/) or [Monzo Bank](https://monzo.com/)? 198 | 199 | Or if you're really running out of ideas you can create a function that responds to webhooks from GitHub like we do in the [OpenFaaS workshop](https://github.com/openfaas/workshop). 200 | 201 | ## Appendix 202 | 203 | ### Find the cluster's external IP 204 | 205 | If you need to whitelist the IP of the cluster you can use the following function to find the current IP for external traffic. 206 | 207 | This endpoint is rate-limited and is shared for everyone, so please do not call it more than once per day. 208 | 209 | * [https://openfaas.o6s.io/external-ip](https://openfaas.o6s.io/external-ip) 210 | 211 | Find the [code for the function here](https://github.com/openfaas/cloud-functions/blob/master/external-ip/handler.go) 212 | 213 | ### Secrets 214 | 215 | You can make use of access tokens or other secrets through the use of encryption and SealedSecrets. Follow [this guide](https://gist.github.com/alexellis/46099ff77408d93944ee33fff66b240e) to try it out. 216 | 217 | ### Scale-from/-to zero 218 | 219 | Auto-scaling can scale your function down to zero replicas too and then you will incur a cold-start. This may or may not be an issue for you depending on the workload of choice. 220 | 221 | To override scale to zero add the following to `stack.yml` 222 | 223 | ```yaml 224 | functions: 225 | example: 226 | labels: 227 | com.openfaas.scale.zero: false 228 | ``` 229 | 230 | ### Templates 231 | 232 | Both the official templates are available along with a set of additional templates. 233 | 234 | Standard templates: 235 | 236 | ``` 237 | - csharp 238 | - dockerfile 239 | - go 240 | - java11 241 | - java11-vert-x 242 | - java8 243 | - node 244 | - node12 245 | - php7 246 | - python 247 | - python3 248 | - python3-debian 249 | - ruby 250 | ``` 251 | 252 | Additional templates: 253 | 254 | * [golang-http](https://github.com/openfaas-incubator/golang-http-template) 255 | * [golang-middleware](https://github.com/openfaas-incubator/golang-http-template) 256 | 257 | Use `faas-cli template store pull` to fetch one of the additional templates listed above 258 | 259 | For a list of official templates type in `faas-cli new --list`. 260 | 261 | > Note: the `dockerfile` type is restricted from use in the Community Cluster. If you host your own OpenFaaS Cloud cluster, then you can select whichever templates you want. 262 | 263 | If you need additional templates to be made available, please let us know. 264 | 265 | #### Node.js 266 | 267 | The preferred template for Node.js is `node12`. 268 | 269 | #### Go modules 270 | 271 | In `stack.yml`, under your function, add a `build_args` entry for `GO111MODULE` 272 | 273 | ```yaml 274 | version: 1.0 275 | provider: 276 | name: openfaas 277 | gateway: http://127.0.0.1:8080 278 | functions: 279 | has-module: 280 | lang: go 281 | handler: ./has-module 282 | image: username/has-module:latest 283 | build_args: 284 | GO111MODULE: on 285 | ``` 286 | 287 | Read more in the [docs here](https://docs.openfaas.com/cli/templates/#go-go-classic-template) 288 | 289 | ### Limits and constraints 290 | 291 | Functions are limited to 128MB of memory usage. If you need more resources please get in touch. 292 | -------------------------------------------------------------------------------- /pub-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIErjCCApagAwIBAgIRAKjDGfSb/bc4eTH2tHX9/PIwDQYJKoZIhvcNAQELBQAw 3 | ADAeFw0xOTAyMjAxNDE3MjBaFw0yOTAyMTcxNDE3MjBaMAAwggIiMA0GCSqGSIb3 4 | DQEBAQUAA4ICDwAwggIKAoICAQCltEgSeD/Xdk3RPQsHOAxVcU5DjSkrEQ2ET0d7 5 | 1lO214NOcvsOiO60dsGciJYsq2nH5KW7k/IUggamTD47YTIfHOzprNzrLtVf3sDA 6 | uIQnt6sDQEtA6BOyUXCAV1//+727bWIYwZttHQVLr131AfnCWeEWvnoLrps4d6Af 7 | NPEi3Iaq+eWIu+x6RMK4xsLsmN2I/bRQszUlddydbWde+LkH3CWizJJ2PATqWsyB 8 | fNOZHPrS2Fc20nD6YkQuqTlke904B7NAvtOzboNHUBgC0VyK9b2kCqLdNPyB6SeH 9 | VG8YqsIyJL3FZkD7CkwbR3v6ipE1QFD+XzNn/grmVPTv5+GJlrpR4/GmRuor0k9G 10 | IbM7NvebCMc2VGIA+/0/SY2EngR5GiJyR5oEp7C8WRB8C4C6qj8VUrwzAt5wSvLm 11 | MOzaNAaIBDAZm5osBSkqc9I1Ys3236ilYxqA5Lihbobm6SPzVIjwHzcrOxnuVEiq 12 | Jw45Yrdyq2uvR8yyypbL87u6PtII8CePv50n2tglrbb8TsqVCXVGuU7e0FgXQqyC 13 | EKZET95CbYlisCSAGRhJ5qHIzA50y2Rhyx6L7lX1Yijoi7D6JQA974IqMo9x3PdQ 14 | rj3nVaMQQMiJo3ibAhKmmHRb3yUVFpu2kF4uWZWcsr5Cp/8EIRXcgqmRG5hIP3iS 15 | yZV0yQIDAQABoyMwITAOBgNVHQ8BAf8EBAMCAAEwDwYDVR0TAQH/BAUwAwEB/zAN 16 | BgkqhkiG9w0BAQsFAAOCAgEACZ2uV8BiOXKLPXjRpsZ5ThGPEe9Rt0MRCiqGCnbl 17 | 5uNwzNW0IVb9fhWdNQx3yu0wSlRF5IdNxQgjWYLOxLOlMIv1x1Fwcm4U5kcftZZj 18 | VF98MYAbDpUIy/wchYxpfLKMbGD6zWCB77IjYdyo0XkkAotY8jTnTquS/4GGc3WX 19 | jgBK7RCgSPAk4LmzqCtYtbGeZussb1Mcmmnj9ewHvSDQ4NYC0AtX4oA2rrdZfbT6 20 | +Zz/ccz82D5wQT7/lGDpUvmGsxiM2InqxMMGRgbtFOQ/WFYRSAAo8iuGlIwDBjKH 21 | Nro2+BdZeqqFAsmYyV68w+kxd+dyNF3U5RDibU2gTmE9NyX39NqWla+9M/5Zfxnx 22 | Vcfu23jPUAlPUVaxWSrYWeAUNVpzVjIPFUBfLuAl+Es48Tjum6ujp9wWnEhgWXov 23 | xgjQodSdj6aluMJQWKJotUut89/uarwoPGnOEhVgawq+tDdTKOa/oub7Mghg5T1T 24 | IXxsUWjjTboAsSkV35gzOeO6zhuQQTV4PPHEAppqRb+4qNbDUy0GJh9EFFgIBBF/ 25 | eaPGCNw6I48boWj4uYIU5sjPAJBJHId74o4yK7AhkUCM7eRrhqjFd1EHBT0L1eYZ 26 | fYgiMev/yoMTB2yxV2ylpIGHMiJpBXHLstaityx6097zw1FCBFHrJ7K6jK0QG49U 27 | xSM= 28 | -----END CERTIFICATE----- 29 | --------------------------------------------------------------------------------