Skip to content

Instantly share code, notes, and snippets.

View alexellis's full-sized avatar
📖
Check out my eBook on Go

Alex Ellis alexellis

📖
Check out my eBook on Go
View GitHub Profile
@affix
affix / kubectl-updatedotoken.rb
Last active June 9, 2019 12:50
Automatically Update your kubernetes config with the DigitalOcean API and Ruby
#!/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

Deploying openfaas cloud on armhf

Prerequisites

  1. A domain name which can point to your deployment. (subdomain names also work)
  2. Setup Github app. Refer this. You'll need to transfer the downloaded private-key.pem file to arm device.
  3. Docker hub account.

Core components steps:

  1. Sign in to docker hub on your machine using:
@burtonr
burtonr / of-kind.sh
Created January 20, 2019 06:57
OpenFaaS on KinD quickstart
#!/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'"
@rikonor
rikonor / main.go
Created January 19, 2019 02:43
Server Sent Events (SSE) Example in Go
package main
import (
"fmt"
"log"
"net/http"
"sync"
"time"
)
@bradfitz
bradfitz / ws.go
Created November 5, 2018 17:06
pre-Go1.12 websocket hijack+proxy
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
}
@alexellis
alexellis / README.md
Last active May 19, 2022 02:17
OpenFaaS Redis example

Redis & OpenFaaS micro-tutorial

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.

Pre-reqs:

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.

OpenFaaS コントリビューションガイド

いろいろなコントリビューションの方法

はじめてのコントリビューション

CONTRIBUTING.md はしっかり読みましょー!!

PR(プルリクエスト)をしてマージしてもらうことだけがすべてじゃない!

@alexellis
alexellis / README.md
Last active May 23, 2019 07:24
OpenFaaS Cloud Community Cluster instructions
@kacole2
kacole2 / README.md
Last active September 16, 2019 07:49
Installing OpenFaaS on Pivotal Container Service (PKS) with Helm

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
@RichardBronosky
RichardBronosky / README.md
Last active December 1, 2023 08:19
Using cloud-init for cloudless provisioning of Raspberry Pi

Installing cloud-init on a fresh Raspbian Lite image

This is a work in Progress!

Purpose

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.)