Add message queue nats-streaming example (#1472)

This commit is contained in:
Ta-Ching Chen
2019-12-20 02:19:11 +08:00
committed by GitHub
parent 38f96c7e46
commit 0274ceb312
11 changed files with 299 additions and 0 deletions
@@ -0,0 +1,42 @@
Fission Specs
=============
This is a set of specifications for a Fission app. This includes functions,
environments, and triggers; we collectively call these things "resources".
How to use these specs
----------------------
These specs are handled with the 'fission spec' command. See 'fission spec --help'.
'fission spec apply' will "apply" all resources specified in this directory to your
cluster. That means it checks what resources exist on your cluster, what resources are
specified in the specs directory, and reconciles the difference by creating, updating or
deleting resources on the cluster.
'fission spec apply' will also package up your source code (or compiled binaries) and
upload the archives to the cluster if needed. It uses 'ArchiveUploadSpec' resources in
this directory to figure out which files to archive.
You can use 'fission spec apply --watch' to watch for file changes and continuously keep
the cluster updated.
You can add YAMLs to this directory by writing them manually, but it's easier to generate
them. Use 'fission function create --spec' to generate a function spec,
'fission environment create --spec' to generate an environment spec, and so on.
You can edit any of the files in this directory, except 'fission-deployment-config.yaml',
which contains a UID that you should never change. To apply your changes simply use
'fission spec apply'.
fission-deployment-config.yaml
------------------------------
fission-deployment-config.yaml contains a UID. This UID is what fission uses to correlate
resources on the cluster to resources in this directory.
All resources created by 'fission spec apply' are annotated with this UID. Resources on
the cluster that are _not_ annotated with this UID are never modified or deleted by
fission.
@@ -0,0 +1,17 @@
apiVersion: fission.io/v1
kind: Environment
metadata:
creationTimestamp: null
name: go
namespace: default
spec:
builder:
command: build
image: fission/go-builder-1.12:1.7.1
imagepullsecret: ""
keeparchive: false
poolsize: 3
resources: {}
runtime:
image: fission/go-env-1.12:1.7.1
version: 2
@@ -0,0 +1,7 @@
# This file is generated by the 'fission spec init' command.
# See the README in this directory for background and usage information.
# Do not edit the UID below: that will break 'fission spec apply'
apiVersion: fission.io/v1
kind: DeploymentConfig
name: nats-streaming
uid: 9d6b82e4-3d73-49de-9007-1e47fbc377de
@@ -0,0 +1,54 @@
include:
- hello.go
kind: ArchiveUploadSpec
name: hello-go-zqZW
---
apiVersion: fission.io/v1
kind: Package
metadata:
creationTimestamp: null
name: hello-98476132-84ff-4e74-8b0f-2d1005871d1c
namespace: default
spec:
deployment:
checksum: {}
environment:
name: go
namespace: default
source:
checksum: {}
type: url
url: archive://hello-go-zqZW
status:
buildstatus: pending
lastUpdateTimestamp: "2019-12-19T17:31:23.43918Z"
---
apiVersion: fission.io/v1
kind: Function
metadata:
creationTimestamp: null
name: hello
namespace: default
spec:
InvokeStrategy:
ExecutionStrategy:
ExecutorType: poolmgr
MaxScale: 0
MinScale: 0
SpecializationTimeout: 120
TargetCPUPercent: 0
StrategyType: execution
configmaps: null
environment:
name: go
namespace: default
functionTimeout: 60
package:
functionName: Handler
packageref:
name: hello-98476132-84ff-4e74-8b0f-2d1005871d1c
namespace: default
resources: {}
secrets: null
@@ -0,0 +1,27 @@
apiVersion: fission.io/v1
kind: Function
metadata:
creationTimestamp: null
name: publisher
namespace: default
spec:
InvokeStrategy:
ExecutionStrategy:
ExecutorType: poolmgr
MaxScale: 0
MinScale: 0
SpecializationTimeout: 120
TargetCPUPercent: 0
StrategyType: execution
configmaps: null
environment:
name: go
namespace: default
functionTimeout: 60
package:
functionName: Handler
packageref:
name: publisher
namespace: default
resources: {}
secrets: null
@@ -0,0 +1,25 @@
include:
- mqtrigger/*
kind: ArchiveUploadSpec
name: mqtrigger-Z3l6
---
apiVersion: fission.io/v1
kind: Package
metadata:
creationTimestamp: null
name: publisher
namespace: default
spec:
deployment:
checksum: {}
environment:
name: go
namespace: default
source:
checksum: {}
type: url
url: archive://mqtrigger-Z3l6
status:
buildstatus: pending
lastUpdateTimestamp: "2019-12-19T17:18:45.81397Z"