This changes the core fission function, environment and trigger types. It also changes Fission's storage to use ThirdPartyResources. - Functions are now specified by packages. Functions can also have both source and deployment packages. A package can be specified by a literal, or by a URL. - Environments have a build and runtime component. - Triggers reference functions by a FunctionReference. This is a layer of indirection between triggers and functions, and will allow things like incremental function upgrades in future releases. See Documentation/wip/env-v2.md for design discussion about points 1 and 2. Changes: * V2 Types All types now have a spec, following the pattern of K8s objects. Functions now have source and deployment packages. A Package can be specified by literal, or by URL. Environments now have a builder and runtime component. All triggers use a new FunctionReference to specify the function. This for now only uses a function name, but in the future can be extended to be more flexible. A new FunctionLoadRequest type is added for specialization requests to the environment runtime. * TPR types, TPR init code, and a "fission client" Implements TPR types using the spec types in fission/types.go. Adds code for adding creating TPR types, and convenient types for crud operations on each of our resource types. Adds code for connecting to K8s API and configuring a REST client with fission types set up. * Change old stateful controller into a thin apiserver This apiserver is now simply a stateless api layer on top of the TPR types. At the moment it doesn't do anything that couldn't be done by simply talking to the TPR types. In the future we can have better validation and potentially some higher level APIs (like versioning for example) in here. * Split controller client into files and update for v2 types. * Update CLI for v2 types. As far as possible we keep the CLI flags the same. We'll have to add flags for source/deploy packages and builder/runtime environments. That will come in the next change. * Update poolmgr and fetcher for v2 types. Also adds a poolmgr_test. * Update router for new types. Also adds a function reference resolver, which separates out the job of resolving a FunctionReference to a function. * Update kubewatcher and timer for v2 types. * Update Message Queue trigger type for v2 types. * Minor odds and ends. * Fission bundle CLI updates Remove controllerUrl flag, since we don't need it any more. * Remove etcd deployment (replaced by storing state in TPR) Also update the poolmgr commandline, and use an env var for the fetcher image URL. * Explicit ChecksumType and consts * Clarify separation of environment interface types
141 lines
2.6 KiB
YAML
141 lines
2.6 KiB
YAML
apiVersion: v1
|
|
kind: Namespace
|
|
metadata:
|
|
name: fission
|
|
labels:
|
|
name: fission
|
|
---
|
|
apiVersion: v1
|
|
kind: Namespace
|
|
metadata:
|
|
name: fission-function
|
|
labels:
|
|
name: fission-function
|
|
---
|
|
apiVersion: v1
|
|
kind: ServiceAccount
|
|
metadata:
|
|
name: fission-svc
|
|
namespace: fission
|
|
---
|
|
kind: RoleBinding
|
|
apiVersion: rbac.authorization.k8s.io/v1alpha1
|
|
metadata:
|
|
name: fission-admin
|
|
namespace: fission
|
|
subjects:
|
|
- kind: ServiceAccount
|
|
name: fission-svc
|
|
namespace: fission
|
|
roleRef:
|
|
kind: ClusterRole
|
|
name: admin
|
|
apiGroup: rbac.authorization.k8s.io
|
|
---
|
|
kind: RoleBinding
|
|
apiVersion: rbac.authorization.k8s.io/v1alpha1
|
|
metadata:
|
|
name: fission-function-admin
|
|
namespace: fission-function
|
|
subjects:
|
|
- kind: ServiceAccount
|
|
name: fission-svc
|
|
namespace: fission
|
|
roleRef:
|
|
kind: ClusterRole
|
|
name: admin
|
|
apiGroup: rbac.authorization.k8s.io
|
|
---
|
|
apiVersion: extensions/v1beta1
|
|
kind: Deployment
|
|
metadata:
|
|
name: controller
|
|
namespace: fission
|
|
spec:
|
|
replicas: 1
|
|
template:
|
|
metadata:
|
|
labels:
|
|
svc: controller
|
|
spec:
|
|
containers:
|
|
- name: controller
|
|
image: fission/fission-bundle
|
|
command: ["/fission-bundle"]
|
|
args: ["--controllerPort", "8888"]
|
|
serviceAccountName: fission-svc
|
|
---
|
|
apiVersion: extensions/v1beta1
|
|
kind: Deployment
|
|
metadata:
|
|
name: router
|
|
namespace: fission
|
|
spec:
|
|
replicas: 1
|
|
template:
|
|
metadata:
|
|
labels:
|
|
svc: router
|
|
spec:
|
|
containers:
|
|
- name: router
|
|
image: fission/fission-bundle
|
|
command: ["/fission-bundle"]
|
|
args: ["--routerPort", "8888"]
|
|
serviceAccountName: fission-svc
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: poolmgr
|
|
namespace: fission
|
|
labels:
|
|
svc: poolmgr
|
|
spec:
|
|
ports:
|
|
- port: 80
|
|
targetPort: 8888
|
|
selector:
|
|
svc: poolmgr
|
|
---
|
|
apiVersion: extensions/v1beta1
|
|
kind: Deployment
|
|
metadata:
|
|
name: poolmgr
|
|
namespace: fission
|
|
spec:
|
|
replicas: 1
|
|
template:
|
|
metadata:
|
|
labels:
|
|
svc: poolmgr
|
|
spec:
|
|
containers:
|
|
- name: poolmgr
|
|
image: fission/fission-bundle
|
|
command: ["/fission-bundle"]
|
|
args: ["--poolmgrPort", "8888"]
|
|
env:
|
|
- name: FETCHER_IMAGE
|
|
value: fission/fetcher:v2
|
|
serviceAccountName: fission-svc
|
|
---
|
|
apiVersion: extensions/v1beta1
|
|
kind: Deployment
|
|
metadata:
|
|
name: kubewatcher
|
|
namespace: fission
|
|
spec:
|
|
replicas: 1
|
|
template:
|
|
metadata:
|
|
labels:
|
|
svc: kubewatcher
|
|
spec:
|
|
containers:
|
|
- name: kubewatcher
|
|
image: fission/fission-bundle
|
|
command: ["/fission-bundle"]
|
|
args: ["--kubewatcher"]
|
|
serviceAccountName: fission-svc
|