Declarative application specifications for Fission (#422)
This change enables users to have declarative specifications for Fission resources. Users can specify their "app" in a set of spec files, and use a new fission CLI command to "apply" these specs to a running cluster. The new "spec" CLI also includes archiving of local source files, and a file watcher that re-builds archives and uploads them on file changes, and a package build watcher that waits for package builds on the CLI. A "--spec" option is also added to "function create", and will be added to other resources in future changes. This option causes a YAML to be outputted to the specs directory instead of the resource being created on the cluster. The CLI "fission spec --help" outputs usage information.
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
apiVersion: fission.io/v1
|
||||
kind: Environment
|
||||
metadata:
|
||||
name: python-27
|
||||
namespace: default
|
||||
spec:
|
||||
version: 2
|
||||
builder:
|
||||
command: build
|
||||
image: fission/python-build-env-2.7:0.4.0rc
|
||||
runtime:
|
||||
image: fission/python-env-2.7:0.4.0rc
|
||||
@@ -0,0 +1,3 @@
|
||||
kind: DeploymentConfig
|
||||
name: spec-example
|
||||
uid: 27438a48-4191-4b5e-95b2-7793624317b9
|
||||
@@ -0,0 +1,38 @@
|
||||
apiVersion: fission.io/v1
|
||||
kind: Function
|
||||
metadata:
|
||||
name: hello
|
||||
namespace: default
|
||||
spec:
|
||||
environment:
|
||||
name: python-27
|
||||
namespace: default
|
||||
package:
|
||||
packageref:
|
||||
name: hello-pkg
|
||||
namespace: default
|
||||
functionName: hello.main
|
||||
|
||||
---
|
||||
apiVersion: fission.io/v1
|
||||
kind: Package
|
||||
metadata:
|
||||
name: hello-pkg
|
||||
namespace: default
|
||||
spec:
|
||||
source:
|
||||
url: archive://hello-archive
|
||||
buildcmd: "./build.sh"
|
||||
environment:
|
||||
name: python-27
|
||||
namespace: default
|
||||
status:
|
||||
buildstatus: pending
|
||||
|
||||
---
|
||||
kind: ArchiveUploadSpec
|
||||
name: hello-archive
|
||||
include:
|
||||
- "hello/*.py"
|
||||
- "hello/*.sh"
|
||||
- "hello/requirements.txt"
|
||||
Reference in New Issue
Block a user