- A domain name which can point to your deployment. (subdomain names also work)
- Setup Github app. Refer this. You'll need to transfer the downloaded
private-key.pemfile to arm device. - Docker hub account.
- Sign in to docker hub on your machine using:
| #!/usr/bin/env ruby | |
| # DO Kubernetes Config Auto Updater | |
| # Automatically Update your kubeconf using the DigitalOcean api | |
| # | |
| # Get $50 DigitalOcean Credit :: https://m.do.co/c/d755c35183a9 | |
| # | |
| # (c) 2019 Keiran Smith <opensource_at_keiran_dot_scot> | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal |
private-key.pem file to arm device.| #!/bin/bash | |
| echo "> Be KinD with OpenFaaS" | |
| # First, check if docker is available | |
| docker version | 2>/dev/null | |
| if [ $? -ne 0 ]; then | |
| echo "> Docker is required for running OpenFaaS on KinD" | |
| echo "> Install with: 'curl -sLS https://get.docker.com | sudo sh'" |
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "sync" | |
| "time" | |
| ) |
| httpsServer := &http.Server{ | |
| Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |
| hj, isHJ := w.(http.Hijacker) | |
| if r.Header.Get("Upgrade") == "websocket" && isHJ { | |
| c, br, err := hj.Hijack() | |
| if err != nil { | |
| log.Printf("websocket websocket hijack: %v", err) | |
| http.Error(w, err.Error(), 500) | |
| return | |
| } |
After you've completed this micro-tutorial you'll be making requests to your Redis cache from serverless functions with OpenFaaS. From there it's up to you to build something awesome.
Deploy OpenFaaS and the faas-cli.
This guide is for OpenFaaS on Kubernetes, but if you're using Swarm that's OK - you'll just have to adapt some of the commands for setting up Redis. The OpenFaaS code will be the same.
CONTRIBUTING.md はしっかり読みましょー!!
PR(プルリクエスト)をしてマージしてもらうことだけがすべてじゃない!
Apply for early acccess.
Start here: https://github.com/openfaas/community-cluster
The OpenFaaS documentation for faas-netes gives a clear explanation of how to install with Helm, but Pivotal Container Service (PKS) has 2 caveats since provisoned Kubernetes clusters are non-RBAC but are token backed and LoadBalancer inclusion with NSX-T. This is going to be a quick streamline of the documentation that adds out of the box support for PKS.
$ curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
$ kubectl -n kube-system create sa tiller && kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
$ helm init --skip-refresh --upgrade --service-account tiller
$ kubectl apply -f https://raw.githubusercontent.com/openfaas/faas-netes/master/namespaces.yml
$ helm repo add openfaas https://openfaas.github.io/faas-netes/
$ helm repo update && helm upgrade openfaa
This mainly demonstrates my goal of preparing a Raspberry Pi to be provisioned prior to its first boot. To do this I have chosen to use the same cloud-init that is the standard for provisioning servers at Amazon EC2, Microsoft Azure, OpenStack, etc.
I found this to be quite challenging because there is little information available for using cloud-init without a cloud. So, this project also servers as a demonstration for anyone on any version of Linux who may want to install from source, and/or use without a cloud. If you fall into that later group, you probably just want to read the code. It's bash so everything I do, you could also do at the command line. (Even the for loop.)