apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: functions.openfaas.com
spec:
  group: openfaas.com
  names:
    plural: functions
    singular: function
    kind: Function
    shortNames:
    - fn
  scope: Namespaced
  versions:
    - name: v1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          description: Function describes an OpenFaaS function
          type: object
          required:
          - spec
          properties:
            apiVersion:
              type: string
            kind:
              type: string
            metadata:
              type: object
            spec:
              description: FunctionSpec is the spec for a Function resource
              type: object
              required:
                - name
                - image
              properties:
                annotations:
                  type: object
                  additionalProperties:
                    type: string
                constraints:
                  type: array
                  items:
                    type: string
                environment:
                  type: object
                  additionalProperties:
                    type: string
                handler:
                  type: string
                name:
                  type: string
                  pattern: "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
                image:
                  type: string
                labels:
                  type: object
                  additionalProperties:
                    type: string
                secrets:
                  type: array
                  items:
                    type: string
                readOnlyRootFilesystem:
                  type: boolean
                limits:
                  type: object
                  properties:
                    cpu:
                      type: string
                    memory:
                      type: string
                requests:
                  type: object
                  properties:
                    cpu:
                      type: string
                    memory:
                      type: string
    
