Skip to content

Commit

Permalink
Profiles CRD toggle
Browse files Browse the repository at this point in the history
Introduces a toggle for creating the Profiles CRD. This is
to help users overcome #686

Makes a breaking change where "createCRDs" controls whether
any CRDs are created. This is on by default. Existing users
must take note when upgrading.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Nov 3, 2020
1 parent f38cbd2 commit 08ffc57
Show file tree
Hide file tree
Showing 23 changed files with 2,722 additions and 263 deletions.
2 changes: 1 addition & 1 deletion chart/openfaas/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
description: OpenFaaS - Serverless Functions Made Simple
name: openfaas
version: 6.0.4
version: 6.1.0
sources:
- https://github.com/openfaas/faas
- https://github.com/openfaas/faas-netes
Expand Down
107 changes: 107 additions & 0 deletions chart/openfaas/templates/function-crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{{- $functionNs := default .Release.Namespace .Values.functionNamespace }}
{{- if .Values.operator.create }}
{{- if .Values.createCRDs }}

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.3.0
creationTimestamp: null
name: functions.openfaas.com
spec:
group: openfaas.com
names:
kind: Function
listKind: FunctionList
plural: functions
singular: function
scope: Namespaced
validation:
openAPIV3Schema:
description: Function describes an OpenFaaS function
type: object
required:
- spec
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: FunctionSpec is the spec for a Function resource
type: object
required:
- image
- name
properties:
annotations:
type: object
additionalProperties:
type: string
constraints:
type: array
items:
type: string
environment:
type: object
additionalProperties:
type: string
handler:
type: string
image:
type: string
labels:
type: object
additionalProperties:
type: string
limits:
description: FunctionResources is used to set CPU and memory limits
and requests
type: object
properties:
cpu:
type: string
memory:
type: string
name:
type: string
readOnlyRootFilesystem:
type: boolean
requests:
description: FunctionResources is used to set CPU and memory limits
and requests
type: object
properties:
cpu:
type: string
memory:
type: string
secrets:
type: array
items:
type: string
version: v1
versions:
- name: v1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []


---
{{- end }}
{{- end }}
6 changes: 6 additions & 0 deletions chart/openfaas/templates/ingress-operator-crd.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{{- if .Values.ingressOperator.create }}
{{- if .Values.createCRDs }}

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
Expand Down Expand Up @@ -83,4 +85,8 @@ spec:
- name: v1alpha2
served: true
storage: true

---

{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,110 +1,4 @@
{{- $functionNs := default .Release.Namespace .Values.functionNamespace }}
{{- if .Values.operator.create }}
{{- if .Values.operator.createCRD }}

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.3.0
creationTimestamp: null
name: functions.openfaas.com
spec:
group: openfaas.com
names:
kind: Function
listKind: FunctionList
plural: functions
singular: function
scope: Namespaced
validation:
openAPIV3Schema:
description: Function describes an OpenFaaS function
type: object
required:
- spec
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: FunctionSpec is the spec for a Function resource
type: object
required:
- image
- name
properties:
annotations:
type: object
additionalProperties:
type: string
constraints:
type: array
items:
type: string
environment:
type: object
additionalProperties:
type: string
handler:
type: string
image:
type: string
labels:
type: object
additionalProperties:
type: string
limits:
description: FunctionResources is used to set CPU and memory limits
and requests
type: object
properties:
cpu:
type: string
memory:
type: string
name:
type: string
readOnlyRootFilesystem:
type: boolean
requests:
description: FunctionResources is used to set CPU and memory limits
and requests
type: object
properties:
cpu:
type: string
memory:
type: string
secrets:
type: array
items:
type: string
version: v1
versions:
- name: v1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []


---
{{- end }}
{{- end }}
{{- if .Values.createCRDs }}

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -912,4 +806,6 @@ status:
conditions: []
storedVersions: []

---

{{- end }}
3 changes: 3 additions & 0 deletions chart/openfaas/values-arm64.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
basic_auth: true

clusterRole: false
createCRDs: true

nodeSelector:
beta.kubernetes.io/arch: arm64

Expand Down
3 changes: 3 additions & 0 deletions chart/openfaas/values-armhf.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
basic_auth: false

clusterRole: false
createCRDs: true

nodeSelector:
beta.kubernetes.io/arch: arm

Expand Down
1 change: 1 addition & 0 deletions chart/openfaas/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ serviceType: NodePort
httpProbe: true # Setting to true will use HTTP for readiness and liveness probe on the OpenFaaS system Pods (incompatible with Istio < 1.1.5)
rbac: true
clusterRole: false # Set to true to have OpenFaaS administrate multiple namespaces
createCRDs: true

# create pod security policies for OpenFaaS control plane
# https://kubernetes.io/docs/concepts/policy/pod-security-policy/
Expand Down
Binary file modified docs/cron-connector-0.3.1.tgz
Binary file not shown.
Loading

0 comments on commit 08ffc57

Please sign in to comment.