Initial release
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.14.0
|
||||
labels:
|
||||
group: fission.io
|
||||
name: canaryconfigs.fission.io
|
||||
spec:
|
||||
group: fission.io
|
||||
names:
|
||||
kind: CanaryConfig
|
||||
listKind: CanaryConfigList
|
||||
plural: canaryconfigs
|
||||
singular: canaryconfig
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: CanaryConfig is for canary deployment of two functions.
|
||||
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: CanaryConfigSpec defines the canary configuration spec
|
||||
properties:
|
||||
duration:
|
||||
description: 'Weight increment interval, string representation of
|
||||
time.Duration, ex : 1m, 2h, 2d (default: "2m")'
|
||||
type: string
|
||||
failureType:
|
||||
description: FailureType refers to the type of failure
|
||||
type: string
|
||||
failurethreshold:
|
||||
description: Threshold in percentage beyond which the new version
|
||||
of the function is considered unstable
|
||||
type: integer
|
||||
newfunction:
|
||||
description: New version of the function
|
||||
type: string
|
||||
oldfunction:
|
||||
description: Old stable version of the function
|
||||
type: string
|
||||
trigger:
|
||||
description: HTTP trigger that this config references
|
||||
type: string
|
||||
weightincrement:
|
||||
description: Weight increment step for function
|
||||
type: integer
|
||||
required:
|
||||
- newfunction
|
||||
- oldfunction
|
||||
- trigger
|
||||
type: object
|
||||
status:
|
||||
description: CanaryConfigStatus represents canary config status
|
||||
properties:
|
||||
status:
|
||||
type: string
|
||||
required:
|
||||
- status
|
||||
type: object
|
||||
required:
|
||||
- metadata
|
||||
- spec
|
||||
- status
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,150 @@
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.14.0
|
||||
labels:
|
||||
group: fission.io
|
||||
name: httptriggers.fission.io
|
||||
spec:
|
||||
group: fission.io
|
||||
names:
|
||||
kind: HTTPTrigger
|
||||
listKind: HTTPTriggerList
|
||||
plural: httptriggers
|
||||
singular: httptrigger
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: HTTPTrigger is the trigger invokes user functions when receiving
|
||||
HTTP requests.
|
||||
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: HTTPTriggerSpec is for router to expose user functions at
|
||||
the given URL path.
|
||||
properties:
|
||||
createingress:
|
||||
description: If CreateIngress is true, router will create an ingress
|
||||
definition.
|
||||
type: boolean
|
||||
functionref:
|
||||
description: FunctionReference is a reference to the target function.
|
||||
properties:
|
||||
functionweights:
|
||||
additionalProperties:
|
||||
type: integer
|
||||
description: |-
|
||||
Function Reference by weight. this map contains function name as key and its weight
|
||||
as the value. This is for canary upgrade purpose.
|
||||
nullable: true
|
||||
type: object
|
||||
name:
|
||||
description: Name of the function.
|
||||
type: string
|
||||
type:
|
||||
description: |-
|
||||
Type indicates whether this function reference is by name or selector. For now,
|
||||
the only supported reference type is by "name". Future reference types:
|
||||
* Function by label or annotation
|
||||
* Branch or tag of a versioned function
|
||||
* A "rolling upgrade" from one version of a function to another
|
||||
Available value:
|
||||
- name
|
||||
- function-weights
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
- type
|
||||
type: object
|
||||
host:
|
||||
description: |-
|
||||
TODO: remove this field since we have IngressConfig already
|
||||
Deprecated: the original idea of this field is not for setting Ingress.
|
||||
Since we have IngressConfig now, remove Host after couple releases.
|
||||
type: string
|
||||
ingressconfig:
|
||||
description: |-
|
||||
TODO: make IngressConfig an independent Fission resource
|
||||
IngressConfig for router to set up Ingress.
|
||||
properties:
|
||||
annotations:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: Annotations will be added to metadata when creating
|
||||
Ingress.
|
||||
nullable: true
|
||||
type: object
|
||||
host:
|
||||
description: |-
|
||||
Host is for ingress controller to apply rules. If
|
||||
host is empty or "*", the rule applies to all
|
||||
inbound HTTP traffic.
|
||||
type: string
|
||||
path:
|
||||
description: |-
|
||||
Path is for path matching. The format of path
|
||||
depends on what ingress controller you used.
|
||||
type: string
|
||||
tls:
|
||||
description: |-
|
||||
TLS is for user to specify a Secret that contains
|
||||
TLS key and certificate. The domain name in the
|
||||
key and crt must match the value of Host field.
|
||||
type: string
|
||||
type: object
|
||||
keepPrefix:
|
||||
description: |-
|
||||
When function is exposed with Prefix based path,
|
||||
keepPrefix decides whether to keep or trim prefix in URL while invoking function.
|
||||
type: boolean
|
||||
method:
|
||||
description: |-
|
||||
Use Methods instead of Method. This field is going to be deprecated in a future release
|
||||
HTTP method to access a function.
|
||||
type: string
|
||||
methods:
|
||||
description: HTTP methods to access a function
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
prefix:
|
||||
description: |-
|
||||
Prefix with which functions are exposed.
|
||||
NOTE: Prefix takes precedence over URL/RelativeURL.
|
||||
Note that it does not treat slashes specially ("/foobar/" will be matched by
|
||||
the prefix "/foobar").
|
||||
type: string
|
||||
relativeurl:
|
||||
description: RelativeURL is the exposed URL for external client to
|
||||
access a function with.
|
||||
type: string
|
||||
required:
|
||||
- functionref
|
||||
type: object
|
||||
required:
|
||||
- metadata
|
||||
- spec
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
@@ -0,0 +1,97 @@
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.14.0
|
||||
labels:
|
||||
group: fission.io
|
||||
name: kuberneteswatchtriggers.fission.io
|
||||
spec:
|
||||
group: fission.io
|
||||
names:
|
||||
kind: KubernetesWatchTrigger
|
||||
listKind: KubernetesWatchTriggerList
|
||||
plural: kuberneteswatchtriggers
|
||||
singular: kuberneteswatchtrigger
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: KubernetesWatchTrigger watches kubernetes resource events and
|
||||
invokes functions.
|
||||
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: KubernetesWatchTriggerSpec defines spec of KuberenetesWatchTrigger
|
||||
properties:
|
||||
functionref:
|
||||
description: |-
|
||||
The reference to a function for kubewatcher to invoke with
|
||||
when receiving events.
|
||||
properties:
|
||||
functionweights:
|
||||
additionalProperties:
|
||||
type: integer
|
||||
description: |-
|
||||
Function Reference by weight. this map contains function name as key and its weight
|
||||
as the value. This is for canary upgrade purpose.
|
||||
nullable: true
|
||||
type: object
|
||||
name:
|
||||
description: Name of the function.
|
||||
type: string
|
||||
type:
|
||||
description: |-
|
||||
Type indicates whether this function reference is by name or selector. For now,
|
||||
the only supported reference type is by "name". Future reference types:
|
||||
* Function by label or annotation
|
||||
* Branch or tag of a versioned function
|
||||
* A "rolling upgrade" from one version of a function to another
|
||||
Available value:
|
||||
- name
|
||||
- function-weights
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
- type
|
||||
type: object
|
||||
labelselector:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: Resource labels
|
||||
type: object
|
||||
namespace:
|
||||
type: string
|
||||
type:
|
||||
description: Type of resource to watch (Pod, Service, etc.)
|
||||
type: string
|
||||
required:
|
||||
- functionref
|
||||
- namespace
|
||||
- type
|
||||
type: object
|
||||
required:
|
||||
- metadata
|
||||
- spec
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,159 @@
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.14.0
|
||||
labels:
|
||||
group: fission.io
|
||||
name: packages.fission.io
|
||||
spec:
|
||||
group: fission.io
|
||||
names:
|
||||
kind: Package
|
||||
listKind: PackageList
|
||||
plural: packages
|
||||
shortNames:
|
||||
- pkg
|
||||
singular: package
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: Package Think of these as function-level images.
|
||||
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: PackageSpec includes source/deploy archives and the reference
|
||||
of environment to build the package.
|
||||
properties:
|
||||
buildcmd:
|
||||
description: BuildCommand is a custom build command that builder used
|
||||
to build the source archive.
|
||||
type: string
|
||||
deployment:
|
||||
description: Deployment is the deployable archive that environment
|
||||
runtime used to run user function.
|
||||
properties:
|
||||
checksum:
|
||||
description: |-
|
||||
Checksum ensures the integrity of packages
|
||||
referenced by URL. Ignored for literals.
|
||||
properties:
|
||||
sum:
|
||||
type: string
|
||||
type:
|
||||
description: |-
|
||||
ChecksumType specifies the checksum algorithm, such as
|
||||
sha256, used for a checksum.
|
||||
type: string
|
||||
type: object
|
||||
literal:
|
||||
description: |-
|
||||
Literal contents of the package. Can be used for
|
||||
encoding packages below TODO (256 KB?) size.
|
||||
format: byte
|
||||
type: string
|
||||
type:
|
||||
description: |-
|
||||
Type defines how the package is specified: literal or URL.
|
||||
Available value:
|
||||
- literal
|
||||
- url
|
||||
type: string
|
||||
url:
|
||||
description: URL references a package.
|
||||
type: string
|
||||
type: object
|
||||
environment:
|
||||
description: Environment is a reference to the environment for building
|
||||
source archive.
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
namespace:
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
- namespace
|
||||
type: object
|
||||
source:
|
||||
description: |-
|
||||
Source is the archive contains source code and dependencies file.
|
||||
If the package status is in PENDING state, builder manager will then
|
||||
notify builder to compile source and save the result as deployable archive.
|
||||
properties:
|
||||
checksum:
|
||||
description: |-
|
||||
Checksum ensures the integrity of packages
|
||||
referenced by URL. Ignored for literals.
|
||||
properties:
|
||||
sum:
|
||||
type: string
|
||||
type:
|
||||
description: |-
|
||||
ChecksumType specifies the checksum algorithm, such as
|
||||
sha256, used for a checksum.
|
||||
type: string
|
||||
type: object
|
||||
literal:
|
||||
description: |-
|
||||
Literal contents of the package. Can be used for
|
||||
encoding packages below TODO (256 KB?) size.
|
||||
format: byte
|
||||
type: string
|
||||
type:
|
||||
description: |-
|
||||
Type defines how the package is specified: literal or URL.
|
||||
Available value:
|
||||
- literal
|
||||
- url
|
||||
type: string
|
||||
url:
|
||||
description: URL references a package.
|
||||
type: string
|
||||
type: object
|
||||
required:
|
||||
- environment
|
||||
type: object
|
||||
status:
|
||||
description: Status indicates the build status of package.
|
||||
properties:
|
||||
buildlog:
|
||||
description: BuildLog stores build log during the compilation.
|
||||
type: string
|
||||
buildstatus:
|
||||
default: pending
|
||||
description: BuildStatus is the package build status.
|
||||
type: string
|
||||
lastUpdateTimestamp:
|
||||
description: |-
|
||||
LastUpdateTimestamp will store the timestamp the package was last updated
|
||||
metav1.Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON.
|
||||
https://github.com/kubernetes/apimachinery/blob/44bd77c24ef93cd3a5eb6fef64e514025d10d44e/pkg/apis/meta/v1/time.go#L26-L35
|
||||
format: date-time
|
||||
nullable: true
|
||||
type: string
|
||||
type: object
|
||||
required:
|
||||
- metadata
|
||||
- spec
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
@@ -0,0 +1,88 @@
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.14.0
|
||||
labels:
|
||||
group: fission.io
|
||||
name: timetriggers.fission.io
|
||||
spec:
|
||||
group: fission.io
|
||||
names:
|
||||
kind: TimeTrigger
|
||||
listKind: TimeTriggerList
|
||||
plural: timetriggers
|
||||
singular: timetrigger
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: TimeTrigger invokes functions based on given cron schedule.
|
||||
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: |-
|
||||
TimeTriggerSpec invokes the specific function at a time or
|
||||
times specified by a cron string.
|
||||
properties:
|
||||
cron:
|
||||
description: Cron schedule
|
||||
type: string
|
||||
functionref:
|
||||
description: The reference to function
|
||||
properties:
|
||||
functionweights:
|
||||
additionalProperties:
|
||||
type: integer
|
||||
description: |-
|
||||
Function Reference by weight. this map contains function name as key and its weight
|
||||
as the value. This is for canary upgrade purpose.
|
||||
nullable: true
|
||||
type: object
|
||||
name:
|
||||
description: Name of the function.
|
||||
type: string
|
||||
type:
|
||||
description: |-
|
||||
Type indicates whether this function reference is by name or selector. For now,
|
||||
the only supported reference type is by "name". Future reference types:
|
||||
* Function by label or annotation
|
||||
* Branch or tag of a versioned function
|
||||
* A "rolling upgrade" from one version of a function to another
|
||||
Available value:
|
||||
- name
|
||||
- function-weights
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
- type
|
||||
type: object
|
||||
required:
|
||||
- cron
|
||||
- functionref
|
||||
type: object
|
||||
required:
|
||||
- metadata
|
||||
- spec
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
17
crd/fission/datas.tf
Normal file
17
crd/fission/datas.tf
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
locals {
|
||||
common-labels = {
|
||||
"vynil.solidite.fr/owner-name" = var.instance
|
||||
"vynil.solidite.fr/owner-namespace" = var.namespace
|
||||
"vynil.solidite.fr/owner-category" = var.category
|
||||
"vynil.solidite.fr/owner-component" = var.component
|
||||
"app.kubernetes.io/managed-by" = "vynil"
|
||||
"app.kubernetes.io/name" = var.component
|
||||
"app.kubernetes.io/instance" = var.instance
|
||||
}
|
||||
}
|
||||
data "kustomization_overlay" "data" {
|
||||
common_labels = local.common-labels
|
||||
namespace = var.namespace
|
||||
resources = []
|
||||
}
|
||||
36
crd/fission/index.rhai
Normal file
36
crd/fission/index.rhai
Normal file
@@ -0,0 +1,36 @@
|
||||
const VERSION="1.20.1";
|
||||
const SRC=src;
|
||||
const DEST=dest;
|
||||
const DOIT=config.apply;
|
||||
const crdFiles=[
|
||||
"apiextensions.k8s.io_v1_CustomResourceDefinition_canaryconfigs.fission.io.yaml",
|
||||
"apiextensions.k8s.io_v1_CustomResourceDefinition_environments.fission.io.yaml",
|
||||
"apiextensions.k8s.io_v1_CustomResourceDefinition_functions.fission.io.yaml",
|
||||
"apiextensions.k8s.io_v1_CustomResourceDefinition_httptriggers.fission.io.yaml",
|
||||
"apiextensions.k8s.io_v1_CustomResourceDefinition_kuberneteswatchtriggers.fission.io.yaml",
|
||||
"apiextensions.k8s.io_v1_CustomResourceDefinition_messagequeuetriggers.fission.io.yaml",
|
||||
"apiextensions.k8s.io_v1_CustomResourceDefinition_packages.fission.io.yaml",
|
||||
"apiextensions.k8s.io_v1_CustomResourceDefinition_timetriggers.fission.io.yaml",
|
||||
];
|
||||
fn pre_pack() {
|
||||
shell(`kubectl kustomize github.com/fission/fission//crds/v1/?ref=v${global::VERSION} > ${global::SRC}/fission.yaml`);
|
||||
}
|
||||
fn post_pack() {
|
||||
shell(`for i in $(ls -1 "${global::DEST}"|awk '/yaml$/&&!/^index/&&!/apiextensions/');do rm -f "${global::DEST}/$i";done`);
|
||||
}
|
||||
fn pre_install() {
|
||||
if ! global::DOIT {
|
||||
return;
|
||||
}
|
||||
for file in global::crdFiles {
|
||||
shell(`kubectl replace -f ${global::SRC}/${file} || kubectl create -f ${global::SRC}/${file}`);
|
||||
}
|
||||
}
|
||||
fn post_destroy() {
|
||||
if ! global::DOIT {
|
||||
return;
|
||||
}
|
||||
for file in global::crdFiles {
|
||||
shell(`kubectl delete -f ${global::SRC}/${file}`);
|
||||
}
|
||||
}
|
||||
16
crd/fission/index.yaml
Normal file
16
crd/fission/index.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
apiVersion: vinyl.solidite.fr/v1beta1
|
||||
kind: Component
|
||||
category: crd
|
||||
metadata:
|
||||
name: fission
|
||||
description: CRD for fission.io
|
||||
options:
|
||||
apply:
|
||||
default: true
|
||||
examples:
|
||||
- true
|
||||
type: boolean
|
||||
dependencies: []
|
||||
providers: null
|
||||
tfaddtype: null
|
||||
Reference in New Issue
Block a user