fluxcd/flux

Add support for OpenFaaS Function CRD

Closed this issue · 1 comments

To support release automation of OpenFaaS function kind, Flux should detect and update the image field. The OpenFaaS function definition is similar to a Kubernetes deployment, the image field is part of the spec and has the same format. Ref #985

OpenFaas CRD:

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: functions.o6s.io
spec:
  group: o6s.io
  version: v1alpha1
  names:
    kind: Function
    plural: functions
  scope: Namespaced

Function example:

apiVersion: o6s.io/v1alpha1
kind: Function
metadata:
  name: certinfo
spec:
  name: certinfo
  replicas: 2
  image: stefanprodan/certinfo:0.3.0
  labels:
    com.openfaas.scale.min: "2"
    com.openfaas.scale.max: "12"
  environment:
    output: "verbose"
    debug: "true"
  secrets:
    - faas-token
    - faas-key
  limits:
    cpu: "100m"
    memory: "128Mi"
  requests:
    cpu: "10m"
    memory: "64Mi"
  constraints:
    - "cloud.google.com/gke-nodepool=default-pool"

This can be achieved by including the function definition in a Helm chart and exposing the image tag as a helm value.