Skip to content

Commit

Permalink
add readme.md
Browse files Browse the repository at this point in the history
add owners
change {[ template “openfaas.name” . }} ito  {{ template “faas-netesd.name” }}
update _helpers.tpl
Signed-off-by: Rimas Mocevicius <[email protected]>
  • Loading branch information
rimusz authored and alexellis committed Jan 27, 2018
1 parent 0b4838e commit 89c9b04
Show file tree
Hide file tree
Showing 18 changed files with 146 additions and 40 deletions.
17 changes: 17 additions & 0 deletions chart/openfaas/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
description: Enable Kubernetes as a backend for OpenFaaS (Functions as a Service)
name: openfaas
version: 1.0.1
sources:
- https://github.com/openfaas/faas
- https://github.com/openfaas/faas-netes
home: https://www.openfaas.com
icon: https://raw.githubusercontent.com/openfaas/media/master/OpenFaaS_logo_stacked_opaque.png
keywords:
- functions
- service
maintainers:
- name: alexellis
email: [email protected]
- name: rimusz
email: [email protected]
8 changes: 8 additions & 0 deletions chart/openfaas/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
approvers:
- alexellis
- rimusz
- LucasRoesler
reviewers:
- alexellis
- rimusz
- LucasRoesler
75 changes: 75 additions & 0 deletions chart/openfaas/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# OpenFaaS - Serverless Functions Made Simple

![OpenFaaS Logo](https://blog.alexellis.io/content/images/2017/08/faas_side.png)

[OpenFaaS](https://github.com/openfaas/faas) (Functions as a Service) is a framework for building serverless functions with Docker and Kubernetes which has first class support for metrics. Any process can be packaged as a function enabling you to consume a range of web events without repetitive boiler-plate coding.

**Highlights**

* Ease of use through UI portal and *one-click* install
* Write functions in any language for Linux or Windows and package in Docker/OCI image format
* Portable - runs on existing hardware or public/private cloud - [Kubernetes](https://github.com/openfaas/faas-netes) and Docker Swarm native
* [CLI](https://github.com/openfaas/faas-cli) available with YAML format for templating and defining functions
* Auto-scales as demand increases

## Deploy OpenFaaS

**Note:** You must also pass `--set rbac=false` if your cluster is not configured with role-based access control. For further information, see [here](https://kubernetes.io/docs/admin/authorization/rbac/).

---

To use defaults including the `default` Kubernetes namespace (recommended)

```
$ helm upgrade --install --debug --reset-values --set async=false openfaas openfaas/
```

Optional: you can also a separate namespace for functions:

```
$ kubectl create ns openfaas
$ kubectl create ns openfaas-fn
$ helm upgrade --install --debug --namespace openfaas \
--reset-values --set async=false --set functionNamespace=openfaas-fn openfaas openfaas/
```

If you would like to enable asynchronous functions then use `--set async=true`. You can read more about asynchronous functions in the [OpenFaaS guides](https://github.com/openfaas/faas/tree/master/guide).

By default you will have NodePorts available for each service such as the API gateway and Prometheus

### Deploy with an IngressController

In order to make use of automatic ingress settings you will need an IngressController in your cluster such as Traefik or Nginx.

Add `--set ingress.enabled` to enable ingress:

```
$ helm upgrade --install --debug --reset-values --set async=false --set ingress.enabled=true openfaas openfaas/
```

By default services will be exposed with following hostnames (can be changed, see values.yaml for details):
* `faas-netesd.openfaas.local`
* `gateway.openfaas.local`
* `prometheus.openfaas.local`
* `alertmanager.openfaas.local`

### Additional OpenFaaS options:

* `functionNamespace=defaults` - to the deployed namespace, kube namespace to create function deployments in
* `async=true/false` - defaults to false, deploy nats if true
* `armhf=true/false` - defaults to false, use arm images if true (missing images for async)
* `exposeServices=true/false` - defaults to true, will always create `ClusterIP` services, and expose `NodePorts/LoadBalancer` if true (based on serviceType)
* `serviceType=NodePort/LoadBalancer` - defaults to NodePort, type of external service to use when exposeServices is set to true
* `rbac=true/false` - defaults to true, if true create roles
* `ingress.enabled=true/false` - defaults to false, set to true to create ingress resources. See openfaas/values.yaml for detailed Ingress configuration.

### Removing the OpenFaaS

All control plane components can be cleaned up with helm with:

```
$ helm delete --purge openfaas
```

Individual functions will need to be either deleted before deleting the chart with `faas-cli` or manually deleted using `kubectl delete`.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
To verify that openfaas has started, run:

kubectl --namespace={{ .Release.Namespace }} get deployments -l "release={{ .Release.Name }}, app={{ template "faas-netesd.name" . }}"
kubectl --namespace={{ .Release.Namespace }} get deployments -l "release={{ .Release.Name }}, app={{ template "openfaas.name" . }}"
20 changes: 20 additions & 0 deletions chart/openfaas/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "openfaas.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "openfaas.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: Service
metadata:
labels:
app: {{ template "faas-netesd.name" . }}
app: {{ template "openfaas.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: alertmanager
heritage: {{ .Release.Service }}
Expand All @@ -21,7 +21,7 @@ apiVersion: apps/v1beta1 # for versions before 1.6.0 use extensions/v1beta1
kind: Deployment
metadata:
labels:
app: {{ template "faas-netesd.name" . }}
app: {{ template "openfaas.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: alertmanager
heritage: {{ .Release.Service }}
Expand Down
4 changes: 2 additions & 2 deletions openfaas/templates/configmaps.yaml → chart/openfaas/templates/configmaps.yaml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: ConfigMap
apiVersion: v1
metadata:
labels:
app: {{ template "faas-netesd.name" . }}
app: {{ template "openfaas.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: prometheus-config
heritage: {{ .Release.Service }}
Expand Down Expand Up @@ -70,7 +70,7 @@ kind: ConfigMap
apiVersion: v1
metadata:
labels:
app: {{ template "faas-netesd.name" . }}
app: {{ template "openfaas.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: alertmanager-config
heritage: {{ .Release.Service }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: v1
kind: Service
metadata:
labels:
app: {{ template "faas-netesd.name" . }}
app: {{ template "openfaas.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: faas-netesd
heritage: {{ .Release.Service }}
Expand All @@ -24,7 +24,7 @@ apiVersion: v1
kind: Service
metadata:
labels:
app: {{ template "faas-netesd.name" . }}
app: {{ template "openfaas.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: gateway
heritage: {{ .Release.Service }}
Expand All @@ -47,7 +47,7 @@ apiVersion: v1
kind: Service
metadata:
labels:
app: {{ template "faas-netesd.name" . }}
app: {{ template "openfaas.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: prometheus
heritage: {{ .Release.Service }}
Expand All @@ -70,7 +70,7 @@ apiVersion: v1
kind: Service
metadata:
labels:
app: {{ template "faas-netesd.name" . }}
app: {{ template "openfaas.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: alertmanager
heritage: {{ .Release.Service }}
Expand All @@ -91,7 +91,7 @@ apiVersion: v1
kind: Service
metadata:
labels:
app: {{ template "faas-netesd.name" . }}
app: {{ template "openfaas.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: nats
heritage: {{ .Release.Service }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apps/v1beta1 # for versions before 1.6.0 use extensions/v1beta1
kind: Deployment
metadata:
labels:
app: {{ template "faas-netesd.name" . }}
app: {{ template "openfaas.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: faas-netesd
heritage: {{ .Release.Service }}
Expand Down Expand Up @@ -38,7 +38,7 @@ apiVersion: v1
kind: Service
metadata:
labels:
app: {{ template "faas-netesd.name" . }}
app: {{ template "openfaas.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: gateway
heritage: {{ .Release.Service }}
Expand All @@ -57,7 +57,7 @@ apiVersion: apps/v1beta1 # for versions before 1.6.0 use extensions/v1beta1
kind: Deployment
metadata:
labels:
app: {{ template "faas-netesd.name" . }}
app: {{ template "openfaas.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: gateway
heritage: {{ .Release.Service }}
Expand Down
6 changes: 3 additions & 3 deletions openfaas/templates/gateway.yaml → chart/openfaas/templates/gateway.yaml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: v1
kind: Service
metadata:
labels:
app: {{ template "faas-netesd.name" . }}
app: {{ template "openfaas.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: faas-netesd
heritage: {{ .Release.Service }}
Expand All @@ -23,7 +23,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: {{ template "faas-netesd.name" . }}
app: {{ template "openfaas.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: faas-controller
heritage: {{ .Release.Service }}
Expand All @@ -36,7 +36,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: {{ template "faas-netesd.name" . }}
app: {{ template "openfaas.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: faas-controller
heritage: {{ .Release.Service }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "faas-netesd.name" . }}-ingress
name: {{ template "openfaas.name" . }}-ingress
labels:
app: {{ template "faas-netesd.name" . }}
app: {{ template "openfaas.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
Expand Down
4 changes: 2 additions & 2 deletions openfaas/templates/nats.yaml → chart/openfaas/templates/nats.yaml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: v1
kind: Service
metadata:
labels:
app: {{ template "faas-netesd.name" . }}
app: {{ template "openfaas.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: nats
heritage: {{ .Release.Service }}
Expand All @@ -23,7 +23,7 @@ apiVersion: apps/v1beta1 # for versions before 1.6.0 use extensions/v1beta1
kind: Deployment
metadata:
labels:
app: {{ template "faas-netesd.name" . }}
app: {{ template "openfaas.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: nats
heritage: {{ .Release.Service }}
Expand Down
4 changes: 2 additions & 2 deletions openfaas/templates/prometheus.yaml → chart/openfaas/templates/prometheus.yaml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: v1
kind: Service
metadata:
labels:
app: {{ template "faas-netesd.name" . }}
app: {{ template "openfaas.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: prometheus
heritage: {{ .Release.Service }}
Expand All @@ -22,7 +22,7 @@ apiVersion: apps/v1beta1 # for versions before 1.6.0 use extensions/v1beta1
kind: Deployment
metadata:
labels:
app: {{ template "faas-netesd.name" . }}
app: {{ template "openfaas.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: prometheus
heritage: {{ .Release.Service }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apps/v1beta1 # for versions before 1.6.0 use extensions/v1beta1
kind: Deployment
metadata:
labels:
app: {{ template "faas-netesd.name" . }}
app: {{ template "openfaas.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: queue-worker
heritage: {{ .Release.Service }}
Expand Down
6 changes: 3 additions & 3 deletions openfaas/templates/rbac.yaml → chart/openfaas/templates/rbac.yaml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
labels:
app: {{ template "faas-netesd.name" . }}
app: {{ template "openfaas.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: faas-controller
heritage: {{ .Release.Service }}
Expand Down Expand Up @@ -47,7 +47,7 @@ apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
labels:
app: {{ template "faas-netesd.name" . }}
app: {{ template "openfaas.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: faas-controller
heritage: {{ .Release.Service }}
Expand All @@ -68,7 +68,7 @@ apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
labels:
app: {{ template "faas-netesd.name" . }}
app: {{ template "openfaas.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: faas-controller
heritage: {{ .Release.Service }}
Expand Down
File renamed without changes.
7 changes: 0 additions & 7 deletions openfaas/Chart.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions openfaas/templates/_helpers.tpl

This file was deleted.

0 comments on commit 89c9b04

Please sign in to comment.