Compare commits
224
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
50b5c74c52 | ||
|
|
23d6266335 | ||
|
|
4f8727f9d4 | ||
|
|
119d674207 | ||
|
|
1347d73b04 | ||
|
|
b55dc1fd78 | ||
|
|
1a52f3dce8 | ||
|
|
4a0bd1aa21 | ||
|
|
33473a4528 | ||
|
|
453debb6e9 | ||
|
|
81ccf6359d | ||
|
|
681e6f02fe | ||
|
|
5e226433b5 | ||
|
|
f4c56f81f3 | ||
|
|
ce85b27803 | ||
|
|
eb31381094 | ||
|
|
a1cbce810e | ||
|
|
f195975bda | ||
|
|
3636bb35ff | ||
|
|
1d5a09699b | ||
|
|
1df59316e7 | ||
|
|
d6b47c1a4e | ||
|
|
49fe2cb61f | ||
|
|
5f17b4f3c5 | ||
|
|
1b9d21b5e3 | ||
|
|
c51c6b7f7e | ||
|
|
0c8d7c26c5 | ||
|
|
c4585c8394 | ||
|
|
dfcf961f75 | ||
|
|
0cc3ecc2e9 | ||
|
|
a24934f1a0 | ||
|
|
9d54f5daac | ||
|
|
0f8b5e51a4 | ||
|
|
47295309b3 | ||
|
|
ba7ee3ed95 | ||
|
|
9b5eb069d6 | ||
|
|
672bdbba6f | ||
|
|
8271dfae07 | ||
|
|
f4702fe066 | ||
|
|
fea8dbef1a | ||
|
|
6a527d36a8 | ||
|
|
2292f472c9 | ||
|
|
2aaaeee5a7 | ||
|
|
ca161690da | ||
|
|
8bd1a71065 | ||
|
|
eb72fdc717 | ||
|
|
a7f819a78e | ||
|
|
d4d58e166b | ||
|
|
1d41a198cb | ||
|
|
6ced9d03d3 | ||
|
|
19c7616a4b | ||
|
|
a82281ad1c | ||
|
|
f3e1f9df90 | ||
|
|
c85b9e8cbc | ||
|
|
ece0475808 | ||
|
|
2e0bb9304a | ||
|
|
74c0142968 | ||
|
|
7c71d90d17 | ||
|
|
f86fde81e6 | ||
|
|
43814450e5 | ||
|
|
d5077ee816 | ||
|
|
2cf2c6979e | ||
|
|
154fe0d447 | ||
|
|
a493f0117d | ||
|
|
cc0400bdd4 | ||
|
|
8b57a035ee | ||
|
|
dc57f83d19 | ||
|
|
611f556cf9 | ||
|
|
d06ad04341 | ||
|
|
72c89268ec | ||
|
|
3f99b483cb | ||
|
|
9bef235252 | ||
|
|
18935dcfdd | ||
|
|
db2fb81654 | ||
|
|
6fbd4878be | ||
|
|
023a9905f6 | ||
|
|
6facdac464 | ||
|
|
377600d0a3 | ||
|
|
b6cf078395 | ||
|
|
673ca25cf2 | ||
|
|
4038f0384b | ||
|
|
f5dc6ab994 | ||
|
|
aa45703a99 | ||
|
|
f01de5c802 | ||
|
|
827b64d633 | ||
|
|
7bf82c7ea9 | ||
|
|
3055a3ada0 | ||
|
|
5b1883802e | ||
|
|
bef677678b | ||
|
|
61c59b514f | ||
|
|
8f998e799d | ||
|
|
c2f455ec1b | ||
|
|
3a8af97eb9 | ||
|
|
e6c13057ce | ||
|
|
5f47a25711 | ||
|
|
4c9b67ead4 | ||
|
|
adef5e0e6a | ||
|
|
4e2632e100 | ||
|
|
4ff204a0c4 | ||
|
|
1e0baf5f6c | ||
|
|
a9c56e5bb2 | ||
|
|
4a1fc11b2d | ||
|
|
42c22a7bbb | ||
|
|
369537e515 | ||
|
|
3880279e89 | ||
|
|
524e7bcfd3 | ||
|
|
3bac1d2d9d | ||
|
|
d7ac0ee17a | ||
|
|
462b7d861d | ||
|
|
f523f8b2e3 | ||
|
|
279b009882 | ||
|
|
ee4feb17c4 | ||
|
|
2a014e56b0 | ||
|
|
040763ebb2 | ||
|
|
dfd8d340a0 | ||
|
|
ca6bc12cfc | ||
|
|
5b4bf5964e | ||
|
|
f72bfd8f3a | ||
|
|
0d93c109fb | ||
|
|
1cd8f4d4f7 | ||
|
|
25acd7fd16 | ||
|
|
3e6dae9616 | ||
|
|
1dce070245 | ||
|
|
cc552d9777 | ||
|
|
c7d448ca49 | ||
|
|
fe0bd3ff67 | ||
|
|
b5adc2bf93 | ||
|
|
6f9bad3d05 | ||
|
|
f28799cc4c | ||
|
|
e2376c27b4 | ||
|
|
e4a0aa3480 | ||
|
|
045a365a1b | ||
|
|
1059e9873a | ||
|
|
e0522cc20e | ||
|
|
ef83d4314e | ||
|
|
3b4ca09931 | ||
|
|
19adf0cd7e | ||
|
|
3fb1fdf16a | ||
|
|
695b0759e4 | ||
|
|
6dbdf4d88b | ||
|
|
e55430f61a | ||
|
|
a68f3edcd4 | ||
|
|
e438df87fa | ||
|
|
bb9f4136f5 | ||
|
|
aaf9f18d93 | ||
|
|
2f23120a64 | ||
|
|
7743583f4d | ||
|
|
fe5542845e | ||
|
|
e65bfcdacf | ||
|
|
9d199c86c5 | ||
|
|
fca0a60e5b | ||
|
|
6e3c42f238 | ||
|
|
ab94b68571 | ||
|
|
0662a44017 | ||
|
|
78e530f506 | ||
|
|
ab0b43d51c | ||
|
|
d975534bf7 | ||
|
|
ec22e22bbd | ||
|
|
0face3e966 | ||
|
|
823aacdeba | ||
|
|
c605d1d2c6 | ||
|
|
ef65602b79 | ||
|
|
778f047376 | ||
|
|
2b805fc7ca | ||
|
|
f3fe3123b3 | ||
|
|
c1ac7fcd38 | ||
|
|
7e7d9720be | ||
|
|
4fbaae4b12 | ||
|
|
07b294778a | ||
|
|
8c0a368969 | ||
|
|
99c2020795 | ||
|
|
54b384efec | ||
|
|
975286c2ac | ||
|
|
70b01eb9c8 | ||
|
|
1755d3a017 | ||
|
|
22f385b809 | ||
|
|
f751546913 | ||
|
|
587b166a4e | ||
|
|
b208528d3d | ||
|
|
882abff431 | ||
|
|
892da2478b | ||
|
|
28f5cd7852 | ||
|
|
8e0571c7c9 | ||
|
|
d6fc9f71d0 | ||
|
|
108ef50bd5 | ||
|
|
90b7680392 | ||
|
|
a8a9831c16 | ||
|
|
a1f39bb7d3 | ||
|
|
a50c9f76ec | ||
|
|
f6e679e70e | ||
|
|
17bb1ac39f | ||
|
|
33c23c1341 | ||
|
|
9dd084810f | ||
|
|
d4e1cd4f1e | ||
|
|
aa8c27fd5d | ||
|
|
806104626f | ||
|
|
2331dffe4c | ||
|
|
2d69542265 | ||
|
|
3e8cbe112f | ||
|
|
31ff3f0290 | ||
|
|
f606c3705f | ||
|
|
758ee32aa9 | ||
|
|
163b1d0731 | ||
|
|
e732cf59e0 | ||
|
|
a571c7b72c | ||
|
|
9340e62895 | ||
|
|
efd86e1b27 | ||
|
|
f1e243c145 | ||
|
|
e867b220a1 | ||
|
|
a04c40d016 | ||
|
|
4fb1a8fbe8 | ||
|
|
b959dd2e49 | ||
|
|
5c09099084 | ||
|
|
fc5711ce7c | ||
|
|
cc14044b6b | ||
|
|
e0dc7f2f81 | ||
|
|
03ce1e27c7 | ||
|
|
735f9abef7 | ||
|
|
f2ddaa7921 | ||
|
|
75321d306a | ||
|
|
d2e9364e5e | ||
|
|
b61f994746 | ||
|
|
633593e412 | ||
|
|
e7c0ff7d41 |
@@ -0,0 +1,10 @@
|
||||
---
|
||||
name: Blog
|
||||
about: Suggest a blog
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
name: Documentation
|
||||
about: Suggest changes/addition to documentation
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe something that is unclear or not documented and needs a documentation update
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
@@ -0,0 +1,43 @@
|
||||
name: Code Scanning
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '**.go'
|
||||
- go.mod
|
||||
- go.sum
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '**.go'
|
||||
- go.mod
|
||||
- go.sum
|
||||
schedule:
|
||||
- cron: "0 0 * * 0"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
CodeQL-Build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/go/pkg/mod
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: go
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
@@ -0,0 +1,23 @@
|
||||
name: Greetings
|
||||
|
||||
on: [pull_request, issues]
|
||||
|
||||
jobs:
|
||||
greeting:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/first-interaction@v1
|
||||
if: env.month != 'Oct'
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
issue-message: 'Thank you for your first issue! ✨😊'
|
||||
pr-message: 'Thank you for contributing to this project! ✨😊'
|
||||
- uses: actions/first-interaction@v1
|
||||
if: env.month == 'Oct'
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
issue-message: 'Thank you for your first issue! Happy Hacktoberfest!!! ✨🎃👕✨'
|
||||
pr-message: 'Thank you for contributing to this project. Happy Hacktoberfest!!! ✨🎃👕'
|
||||
@@ -0,0 +1,71 @@
|
||||
name: Lint and Unit tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '**.go'
|
||||
- go.mod
|
||||
- go.sum
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '**.go'
|
||||
- go.mod
|
||||
- go.sum
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.16
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/go/pkg/mod
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
|
||||
- name: Verify dependencies
|
||||
run: |
|
||||
go mod verify
|
||||
go mod download
|
||||
|
||||
LINT_VERSION=1.42.0
|
||||
curl -fsSL https://github.com/golangci/golangci-lint/releases/download/v${LINT_VERSION}/golangci-lint-${LINT_VERSION}-linux-amd64.tar.gz | \
|
||||
tar xz --strip-components 1 --wildcards \*/golangci-lint
|
||||
mkdir -p bin && mv golangci-lint bin/
|
||||
|
||||
- name: Run checks
|
||||
run: |
|
||||
STATUS=0
|
||||
assert-nothing-changed() {
|
||||
local diff
|
||||
"$@" >/dev/null || return 1
|
||||
if ! diff="$(git diff -U1 --color --exit-code)"; then
|
||||
printf '\e[31mError: running `\e[1m%s\e[22m` results in modifications that you must check into version control:\e[0m\n%s\n\n' "$*" "$diff" >&2
|
||||
git checkout -- .
|
||||
STATUS=1
|
||||
fi
|
||||
}
|
||||
|
||||
assert-nothing-changed go fmt ./...
|
||||
assert-nothing-changed go mod tidy
|
||||
|
||||
bin/golangci-lint run --out-format=github-actions --timeout=5m || STATUS=$?
|
||||
|
||||
exit $STATUS
|
||||
|
||||
- name: Run unit tests
|
||||
run: ./hack/runtests.sh
|
||||
@@ -0,0 +1,127 @@
|
||||
name: Fission CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '**.go'
|
||||
- 'charts/**'
|
||||
- 'test/**'
|
||||
- go.mod
|
||||
- go.sum
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '**.go'
|
||||
- 'charts/**'
|
||||
- 'test/**'
|
||||
- go.mod
|
||||
- go.sum
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
# Job to run change detection
|
||||
integration-test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
kindimage : [ 'kindest/node:v1.19.11','kindest/node:v1.20.7', 'kindest/node:v1.21.1' ]
|
||||
os: [ ubuntu-latest ]
|
||||
steps:
|
||||
- name: setup go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.16
|
||||
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v2.3.4
|
||||
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v2.3.4
|
||||
with:
|
||||
repository: fission/examples
|
||||
path: examples
|
||||
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/go/pkg/mod
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
|
||||
- name: Helm installation
|
||||
uses: Azure/setup-helm@v1
|
||||
with:
|
||||
version: v3.3.4
|
||||
|
||||
- name: Kind Clutser
|
||||
uses: engineerd/setup-kind@v0.5.0
|
||||
with:
|
||||
image: ${{ matrix.kindimage }}
|
||||
version: v0.11.1
|
||||
config: kind.yaml
|
||||
|
||||
- name: Configuring and testing the Installation
|
||||
run: |
|
||||
kubectl cluster-info --context kind-kind
|
||||
kubectl get nodes
|
||||
sudo apt-get install -y apache2-utils
|
||||
|
||||
- name: Helm chart lint
|
||||
run: |
|
||||
helm lint charts/fission-all/ charts/fission-core/
|
||||
|
||||
- name: Helm update
|
||||
run: helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
|
||||
|
||||
- name: Install Skaffold
|
||||
run: |
|
||||
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64
|
||||
sudo install skaffold /usr/local/bin/
|
||||
skaffold version
|
||||
|
||||
- name: Install GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v2
|
||||
with:
|
||||
install-only: true
|
||||
|
||||
- name: Build and Install Fission
|
||||
run: |
|
||||
kubectl create ns fission
|
||||
make create-crds
|
||||
SKAFFOLD_PROFILE=kind-ci make skaffold-deploy
|
||||
|
||||
- name: Build and Install Fission CLI
|
||||
run: |
|
||||
make build-fission-cli
|
||||
sudo make install-fission-cli
|
||||
sudo chmod +x /usr/local/bin/fission
|
||||
|
||||
- name: Port-forward fission components
|
||||
run: |
|
||||
kubectl port-forward svc/router 8888:80 -nfission &
|
||||
kubectl port-forward svc/controller 8889:80 -nfission &
|
||||
kubectl port-forward svc/nats-streaming 8890:4222 -nfission &
|
||||
|
||||
- name: Get fission version
|
||||
run: |
|
||||
fission version
|
||||
|
||||
- name: Integration tests
|
||||
run: ./test/kind_CI.sh
|
||||
|
||||
- name: Collect Fission Dump
|
||||
if: ${{ always() }}
|
||||
run: |
|
||||
command -v fission && fission support dump
|
||||
|
||||
- name: Archive fission dump
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: fission-dump
|
||||
path: fission-dump/*.zip
|
||||
retention-days: 5
|
||||
@@ -0,0 +1,102 @@
|
||||
name: Fission CI upgrade
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '**.go'
|
||||
- 'charts/**'
|
||||
- 'test/**'
|
||||
- go.mod
|
||||
- go.sum
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '**.go'
|
||||
- 'charts/**'
|
||||
- 'test/**'
|
||||
- go.mod
|
||||
- go.sum
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
upgrade-test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
kindimage : [ 'kindest/node:v1.19.11' ]
|
||||
os: [ ubuntu-latest ]
|
||||
steps:
|
||||
- name: Setup go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.16
|
||||
|
||||
- name: Checkout action sources
|
||||
uses: actions/checkout@v2.3.4
|
||||
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/go/pkg/mod
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
|
||||
- name: Setup Helm
|
||||
uses: Azure/setup-helm@v1
|
||||
with:
|
||||
version: v3.3.4
|
||||
|
||||
- name: Setup Kind Clutser
|
||||
uses: engineerd/setup-kind@v0.5.0
|
||||
with:
|
||||
image: ${{ matrix.kindimage }}
|
||||
version: v0.11.1
|
||||
|
||||
- name: Install GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v2
|
||||
with:
|
||||
install-only: true
|
||||
|
||||
- name: Setup kubectl & fetch node information
|
||||
run: |
|
||||
kubectl cluster-info --context kind-kind
|
||||
kubectl get nodes
|
||||
kubectl get storageclasses.storage.k8s.io
|
||||
|
||||
- name: Dump system info
|
||||
run: |
|
||||
source ./test/upgrade_test/fission_objects.sh dump_system_info
|
||||
|
||||
- name: Install and configure previous stable fission
|
||||
run: |
|
||||
source ./test/upgrade_test/fission_objects.sh install_stable_release \
|
||||
&& create_fission_objects \
|
||||
&& test_fission_objects
|
||||
|
||||
- name: Upgrade fission to latest
|
||||
run: |
|
||||
source ./test/upgrade_test/fission_objects.sh build_docker_images \
|
||||
&& kind_image_load \
|
||||
&& install_current_release \
|
||||
&& install_fission_cli
|
||||
|
||||
- name: Test previously created fission objects with new release
|
||||
run: |
|
||||
source ./test/upgrade_test/fission_objects.sh test_fission_objects
|
||||
|
||||
- name: Collect Fission Dump
|
||||
if: ${{ always() }}
|
||||
run: |
|
||||
command -v fission && fission support dump
|
||||
|
||||
- name: Archive fission dump
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: fission-dump
|
||||
path: fission-dump/*.zip
|
||||
retention-days: 5
|
||||
+5
-4
@@ -5,6 +5,7 @@ cmd/fission-cli/fission-cli
|
||||
cmd/fetcher/fetcher
|
||||
cmd/builder/builder
|
||||
cmd/preupgradechecks/pre-upgrade-checks
|
||||
cmd/reporter/reporter
|
||||
|
||||
# Logs
|
||||
test/logs/
|
||||
@@ -28,7 +29,7 @@ environments/php7/vendor/
|
||||
.DS_Store
|
||||
vendor/
|
||||
local/
|
||||
environments/dotnet20/Builder/.vs/
|
||||
environments/dotnet20/.vs/
|
||||
environments/dotnet20/obj/
|
||||
environments/dotnet20/bin/
|
||||
|
||||
build/
|
||||
dist/
|
||||
manifest/
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
linters:
|
||||
enable:
|
||||
# Default linter
|
||||
- deadcode
|
||||
- errcheck
|
||||
- gosimple
|
||||
- govet
|
||||
- ineffassign
|
||||
- staticcheck
|
||||
- structcheck
|
||||
- typecheck
|
||||
- unused
|
||||
- varcheck
|
||||
# Additional linters
|
||||
- gofmt
|
||||
- goimports
|
||||
- misspell
|
||||
- nakedret
|
||||
- unconvert
|
||||
# Enable in future
|
||||
# - bodyclose
|
||||
# - dogsled
|
||||
# - dupl
|
||||
# - gosec
|
||||
# - ifshort
|
||||
# - nilerr
|
||||
# - prealloc
|
||||
# - revive
|
||||
# - unparam
|
||||
# - wrapcheck
|
||||
# - gocritic
|
||||
linters-settings:
|
||||
errcheck:
|
||||
ignore: go.uber.org/zap:Sync
|
||||
goimports:
|
||||
# put imports beginning with prefix after 3rd-party packages;
|
||||
# it's a comma-separated list of prefixes
|
||||
local-prefixes: github.com/fission/fission
|
||||
+245
@@ -0,0 +1,245 @@
|
||||
project_name: fission
|
||||
release:
|
||||
github:
|
||||
owner: fission
|
||||
name: fission
|
||||
prerelease: true
|
||||
draft: true
|
||||
header: |
|
||||
Release Highlights: https://docs.fission.io/docs/releases/{{ .Tag }}/
|
||||
Install Guide: https://docs.fission.io/installation/
|
||||
Full Changelog: https://github.com/fission/fission/blob/master/CHANGELOG.md
|
||||
extra_files:
|
||||
- glob: ./manifest/charts/*
|
||||
- glob: ./manifest/yamls/*
|
||||
|
||||
before:
|
||||
hooks:
|
||||
- go mod tidy
|
||||
snapshot:
|
||||
name_template: "{{ .Tag }}"
|
||||
builds:
|
||||
- &build-linux
|
||||
id: builder
|
||||
ldflags:
|
||||
- -s -w
|
||||
- -X github.com/fission/fission/pkg/info.GitCommit={{.ShortCommit}}
|
||||
- -X github.com/fission/fission/pkg/info.BuildDate={{.Date}}
|
||||
- -X github.com/fission/fission/pkg/info.Version={{.Tag}}
|
||||
gcflags:
|
||||
- all=-trimpath={{.Env.PWD}}
|
||||
asmflags:
|
||||
- all=-trimpath={{.Env.PWD}}
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
- linux
|
||||
goarch:
|
||||
- amd64
|
||||
- arm64
|
||||
- arm
|
||||
goarm:
|
||||
- 7
|
||||
binary: builder
|
||||
dir: ./cmd/builder
|
||||
- <<: *build-linux
|
||||
id: fetcher
|
||||
binary: fetcher
|
||||
dir: ./cmd/fetcher
|
||||
- <<: *build-linux
|
||||
id: fission-bundle
|
||||
binary: fission-bundle
|
||||
dir: ./cmd/fission-bundle
|
||||
- <<: *build-linux
|
||||
id: fission-cli
|
||||
goos:
|
||||
- linux
|
||||
- windows
|
||||
- darwin
|
||||
binary: fission
|
||||
dir: ./cmd/fission-cli
|
||||
ignore:
|
||||
- goos: windows
|
||||
goarch: arm64
|
||||
- goos: darwin
|
||||
goarch: arm
|
||||
goarm: 7
|
||||
- goos: windows
|
||||
goarch: arm
|
||||
goarm: 7
|
||||
- <<: *build-linux
|
||||
id: pre-upgrade-checks
|
||||
binary: pre-upgrade-checks
|
||||
dir: ./cmd/preupgradechecks
|
||||
- <<: *build-linux
|
||||
id: reporter
|
||||
binary: reporter
|
||||
dir: ./cmd/reporter
|
||||
dockers:
|
||||
- &docker-amd64
|
||||
use: buildx
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
ids:
|
||||
- builder
|
||||
image_templates:
|
||||
- "fission/builder:latest-amd64"
|
||||
- "fission/builder:{{ .Tag }}-amd64"
|
||||
dockerfile: cmd/builder/Dockerfile.fission-builder
|
||||
build_flag_templates:
|
||||
- "--platform=linux/amd64"
|
||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
||||
- "--label=org.opencontainers.image.version={{.Tag}}"
|
||||
- <<: *docker-amd64
|
||||
ids:
|
||||
- fetcher
|
||||
image_templates:
|
||||
- "fission/fetcher:latest-amd64"
|
||||
- "fission/fetcher:{{ .Tag }}-amd64"
|
||||
dockerfile: cmd/fetcher/Dockerfile.fission-fetcher
|
||||
- <<: *docker-amd64
|
||||
ids:
|
||||
- fission-bundle
|
||||
image_templates:
|
||||
- "fission/fission-bundle:latest-amd64"
|
||||
- "fission/fission-bundle:{{ .Tag }}-amd64"
|
||||
dockerfile: cmd/fission-bundle/Dockerfile.fission-bundle
|
||||
- <<: *docker-amd64
|
||||
ids:
|
||||
- pre-upgrade-checks
|
||||
image_templates:
|
||||
- "fission/pre-upgrade-checks:latest-amd64"
|
||||
- "fission/pre-upgrade-checks:{{ .Tag }}-amd64"
|
||||
dockerfile: cmd/preupgradechecks/Dockerfile.fission-preupgradechecks
|
||||
- <<: *docker-amd64
|
||||
ids:
|
||||
- reporter
|
||||
image_templates:
|
||||
- "fission/reporter:latest-amd64"
|
||||
- "fission/reporter:{{ .Tag }}-amd64"
|
||||
dockerfile: cmd/reporter/Dockerfile.reporter
|
||||
- &docker-arm64
|
||||
use: buildx
|
||||
goos: linux
|
||||
goarch: arm64
|
||||
ids:
|
||||
- builder
|
||||
image_templates:
|
||||
- "fission/builder:latest-arm64"
|
||||
- "fission/builder:{{ .Tag }}-arm64"
|
||||
dockerfile: cmd/builder/Dockerfile.fission-builder
|
||||
build_flag_templates:
|
||||
- "--platform=linux/arm64"
|
||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
||||
- "--label=org.opencontainers.image.version={{.Tag}}"
|
||||
- <<: *docker-arm64
|
||||
ids:
|
||||
- fetcher
|
||||
image_templates:
|
||||
- "fission/fetcher:latest-arm64"
|
||||
- "fission/fetcher:{{ .Tag }}-arm64"
|
||||
dockerfile: cmd/fetcher/Dockerfile.fission-fetcher
|
||||
- <<: *docker-arm64
|
||||
ids:
|
||||
- fission-bundle
|
||||
image_templates:
|
||||
- "fission/fission-bundle:latest-arm64"
|
||||
- "fission/fission-bundle:{{ .Tag }}-arm64"
|
||||
dockerfile: cmd/fission-bundle/Dockerfile.fission-bundle
|
||||
- <<: *docker-arm64
|
||||
ids:
|
||||
- pre-upgrade-checks
|
||||
image_templates:
|
||||
- "fission/pre-upgrade-checks:latest-arm64"
|
||||
- "fission/pre-upgrade-checks:{{ .Tag }}-arm64"
|
||||
dockerfile: cmd/preupgradechecks/Dockerfile.fission-preupgradechecks
|
||||
- <<: *docker-arm64
|
||||
ids:
|
||||
- reporter
|
||||
image_templates:
|
||||
- "fission/reporter:latest-arm64"
|
||||
- "fission/reporter:{{ .Tag }}-arm64"
|
||||
dockerfile: cmd/reporter/Dockerfile.reporter
|
||||
- &docker-armv7
|
||||
use: buildx
|
||||
goos: linux
|
||||
goarch: arm
|
||||
goarm: 7
|
||||
ids:
|
||||
- builder
|
||||
image_templates:
|
||||
- "fission/builder:latest-armv7"
|
||||
- "fission/builder:{{ .Tag }}-armv7"
|
||||
dockerfile: cmd/builder/Dockerfile.fission-builder
|
||||
build_flag_templates:
|
||||
- "--platform=linux/arm/v7"
|
||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
||||
- "--label=org.opencontainers.image.version={{.Tag}}"
|
||||
- <<: *docker-armv7
|
||||
ids:
|
||||
- fetcher
|
||||
image_templates:
|
||||
- "fission/fetcher:latest-armv7"
|
||||
- "fission/fetcher:{{ .Tag }}-armv7"
|
||||
dockerfile: cmd/fetcher/Dockerfile.fission-fetcher
|
||||
- <<: *docker-armv7
|
||||
ids:
|
||||
- fission-bundle
|
||||
image_templates:
|
||||
- "fission/fission-bundle:latest-armv7"
|
||||
- "fission/fission-bundle:{{ .Tag }}-armv7"
|
||||
dockerfile: cmd/fission-bundle/Dockerfile.fission-bundle
|
||||
- <<: *docker-armv7
|
||||
ids:
|
||||
- pre-upgrade-checks
|
||||
image_templates:
|
||||
- "fission/pre-upgrade-checks:latest-armv7"
|
||||
- "fission/pre-upgrade-checks:{{ .Tag }}-armv7"
|
||||
dockerfile: cmd/preupgradechecks/Dockerfile.fission-preupgradechecks
|
||||
- <<: *docker-armv7
|
||||
ids:
|
||||
- reporter
|
||||
image_templates:
|
||||
- "fission/reporter:latest-armv7"
|
||||
- "fission/reporter:{{ .Tag }}-armv7"
|
||||
dockerfile: cmd/reporter/Dockerfile.reporter
|
||||
docker_manifests:
|
||||
- name_template: fission/builder:{{ .Tag }}
|
||||
image_templates:
|
||||
- fission/builder:{{ .Tag }}-amd64
|
||||
- fission/builder:{{ .Tag }}-arm64
|
||||
- fission/builder:{{ .Tag }}-armv7
|
||||
- name_template: fission/fetcher:{{ .Tag }}
|
||||
image_templates:
|
||||
- fission/fetcher:{{ .Tag }}-amd64
|
||||
- fission/fetcher:{{ .Tag }}-arm64
|
||||
- fission/fetcher:{{ .Tag }}-armv7
|
||||
- name_template: fission/fission-bundle:{{ .Tag }}
|
||||
image_templates:
|
||||
- fission/fission-bundle:{{ .Tag }}-amd64
|
||||
- fission/fission-bundle:{{ .Tag }}-arm64
|
||||
- fission/fission-bundle:{{ .Tag }}-armv7
|
||||
- name_template: fission/pre-upgrade-checks:{{ .Tag }}
|
||||
image_templates:
|
||||
- fission/pre-upgrade-checks:{{ .Tag }}-amd64
|
||||
- fission/pre-upgrade-checks:{{ .Tag }}-arm64
|
||||
- fission/pre-upgrade-checks:{{ .Tag }}-armv7
|
||||
- name_template: fission/reporter:{{ .Tag }}
|
||||
image_templates:
|
||||
- fission/reporter:{{ .Tag }}-amd64
|
||||
- fission/reporter:{{ .Tag }}-arm64
|
||||
- fission/reporter:{{ .Tag }}-armv7
|
||||
changelog:
|
||||
skip: true
|
||||
archives:
|
||||
- id: fission
|
||||
builds:
|
||||
- fission-cli
|
||||
name_template: "{{ .ProjectName }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}"
|
||||
format: binary
|
||||
checksum:
|
||||
name_template: "checksums.txt"
|
||||
algorithm: sha256
|
||||
@@ -0,0 +1,13 @@
|
||||
pull_request_rules:
|
||||
- name: Automatic merge on approval
|
||||
conditions:
|
||||
- base=master
|
||||
- "#approved-reviews-by>=1"
|
||||
- label=ready-to-merge
|
||||
- label!=hold-off-merging
|
||||
- status-success=build
|
||||
actions:
|
||||
merge:
|
||||
method: squash
|
||||
commit_message: title+body
|
||||
strict: smart
|
||||
-61
@@ -1,61 +0,0 @@
|
||||
sudo: required
|
||||
|
||||
dist: trusty
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
|
||||
language: go
|
||||
|
||||
go:
|
||||
- 1.12.x
|
||||
|
||||
env:
|
||||
- KUBECONFIG=${HOME}/.kube/config PATH=$HOME/k8scli:$HOME/tool:$HOME/google-cloud-sdk/bin:${PATH} GO111MODULE=on DOCKER_CACHE_DIR=${HOME}/docker/
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/google-cloud-sdk/
|
||||
- $HOME/k8scli
|
||||
- $HOME/tool
|
||||
- $HOME/.cache/go-build
|
||||
- $HOME/gopath/pkg/mod
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
before_install:
|
||||
- sudo apt-get update
|
||||
# - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
|
||||
- sudo apt-get -y install apache2-utils parallel realpath
|
||||
- sudo sysctl net.ipv6.conf.all.disable_ipv6=0
|
||||
|
||||
install:
|
||||
- hack/travis-kube-setup.sh
|
||||
|
||||
before_script:
|
||||
- cd ${TRAVIS_BUILD_DIR}
|
||||
- go mod download
|
||||
- hack/verify-staticcheck.sh
|
||||
- hack/verify-gofmt.sh
|
||||
- hack/verify-govet.sh
|
||||
- helm lint charts/fission-all/ charts/fission-core/
|
||||
- hack/runtests.sh
|
||||
- test/build.sh
|
||||
|
||||
script:
|
||||
- cd ${TRAVIS_BUILD_DIR}
|
||||
- test/test.sh
|
||||
- test/upgrade/fission_upgrade_test.sh
|
||||
|
||||
after_script:
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
- kubectl --namespace default delete configmap -l travisID=${TRAVIS_BUILD_ID} # remove in-test configmap to indicate this CI build finished
|
||||
|
||||
notifications:
|
||||
slack:
|
||||
rooms:
|
||||
secure: YZ34vsfw1TtftJypg1MyP4+ihONI4gaxeS3FghBQli6+EezjzcxOXyj5VD+x0ucXfDeTaDrFfmVN0SAGObOoZUE+ea9KAoTo50tRLaD9kwOTACiekZalC4uuBguH0D1/A6vlbU8dchsr9mvIhbisG6mTncdPtqGYYHtyBQme6ngmmHbVAQFZcIBHmNuDb/HWhSr8KMEuyB6+mBXLYELHnXnf26cOhdGNaagqCOJTiemX85RGwIuOPxyBhKDFMLyHohDT7FJMH/qijveE6YgOYTQC5nYc2Np1KvC7hQkIu4nuyczyYlrNQl/TWv+SVI8PjIs0PYuCuD3gUqoVEi8d94HbrOPzFEpbwDS9P4qL39DGmco1Q56Vqxe6sRI0vDWPb5gCP1lSgs3PMECVn7Wor/pTvcL+C+U2jLwWJUl0vbyWCL7ngl/3iTssV7qBpUrI7Oclwp8LrQo9fPj0DL4gE9rNanpEWjQ6yPGaysIL1zLHtRghhm52A22NJGp71jkS2KEpLi6ZWFYjMeuXw5eOQFhqFlzyRJOmLYa3B607TLWuyo2L2CxAfMmq0FGfemvrkLZIWtlQKK4y9ImpsURwaGT2XCtThFtHl77wEss913nC+T2dX3O5Bl0UmxFd5S3mVM109I8c4lDosxnAjRfS9MheFlrG0gjSJSBCw57x7f0=
|
||||
on_success: change
|
||||
on_failure: always
|
||||
+510
-337
File diff suppressed because it is too large
Load Diff
+5
-40
@@ -1,45 +1,10 @@
|
||||
# Contributing to Fission
|
||||
|
||||
### Thank you!
|
||||
Thanks for helping make Fission better😍!
|
||||
|
||||
Thank you for taking the time and effort to contribute to Fission!
|
||||
There are many areas we can use contributions - ranging from code, documentation, feature proposals, issue triage, samples, and content creation.
|
||||
|
||||
First, please read the [code of conduct](CODE_OF_CONDUCT.md). By
|
||||
participating, you're expected to uphold this code.
|
||||
First, please read the [code of conduct](CODE_OF_CONDUCT.md). By participating, you're expected to uphold this code.
|
||||
|
||||
### Choose something to work on
|
||||
Please refer contributing docs for detailed guide.
|
||||
|
||||
The easiest way to start is to look at existing
|
||||
[issues](https://github.com/fission/fission/issues) and see if there's
|
||||
something there that you'd like to work on.
|
||||
|
||||
Also, if you're familiar with a language that we don't support today,
|
||||
adding an environment for a new language is a good task to take on.
|
||||
Take a look at the Python environment as an example.
|
||||
|
||||
If you're interested in working on something that doesn't have an
|
||||
existing issue, feel free to file a new one.
|
||||
|
||||
There's plenty of stuff to do. If you need help choosing something to
|
||||
work on, we'll be happy to suggest something depending on your
|
||||
interests.
|
||||
|
||||
### Talk to people
|
||||
|
||||
At any point, from thinking about contributing to merging your
|
||||
changes, please feel free to reach out to us! We're more than happy
|
||||
to talk.
|
||||
|
||||
If you choose a big chunk of work that involves design changes to
|
||||
Fission, please talk to us while planning the change; that way we can
|
||||
all be on the same page before you invest too much work into it.
|
||||
|
||||
* Drop by the [slack channel](http://slack.fission.io).
|
||||
* Say hi on [twitter](https://twitter.com/fissionio).
|
||||
|
||||
### Contribution Howto
|
||||
|
||||
* Fork this github repo
|
||||
* Make a branch in your fork
|
||||
* Commit your changes to that branch
|
||||
* Create a pull request
|
||||
[https://docs.fission.io/docs/contributing/](https://docs.fission.io/docs/contributing/)
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
# BUILDING MULTI-ARCHITECTURE IMAGES
|
||||
|
||||
While the Docker images for Fission can be built by running:
|
||||
|
||||
```
|
||||
make image
|
||||
```
|
||||
|
||||
the stable images are build for multiple architectures (and automatically pushed to the repository) by
|
||||
|
||||
```
|
||||
make images-multiarch
|
||||
```
|
||||
|
||||
However, there are several options and requirements for building these images, which are explained here.
|
||||
|
||||
## BUILDERS
|
||||
|
||||
We use `docker buildx` to build images for multiple architectures. At the moment, this is considered an
|
||||
experimental feature by Docker, and as such it requires access to experimental features to be enabled
|
||||
in the daemon.json file.
|
||||
|
||||
By default, this will use BuildKit and QEMU emulation support to build the image for each architecture
|
||||
locally. However, for faster building, it is possible to use native nodes to build each architecture,
|
||||
either simple remote Docker instances or a Kubernetes cluster. For information on how to set this up,
|
||||
please see the blog article here:
|
||||
|
||||
<https://www.docker.com/blog/multi-arch-images/>
|
||||
|
||||
And/or the command reference here:
|
||||
|
||||
<https://docs.docker.com/engine/reference/commandline/buildx_create/>
|
||||
|
||||
## BUILD OPTIONS
|
||||
|
||||
### PLATFORMS
|
||||
|
||||
The PLATFORMS variable can be set to a comma-separated list of platforms for which images should be
|
||||
built when running the multi-arch build. If unset, it defaults to _linux/amd64,linux/arm64,linux/arm_.
|
||||
|
||||
### REPOSITORY SELECTION
|
||||
|
||||
By default, the multi-arch build will automatically try to push the resulting images to the fission/*
|
||||
repositories, under the dev tag; i.e. fission/fission-bundle:dev, fission/fetcher:dev, and
|
||||
fission/builder:dev. However, for convenient, this can be customized by setting the REPO and TAG
|
||||
environment variables to set a different repository prefix and tag for the images.
|
||||
|
||||
For example:
|
||||
|
||||
```
|
||||
REPO=randomdev TAG=test make images-multiarch
|
||||
```
|
||||
|
||||
would build and push the images randomdev/fission-bundle:test, randomdev/fetcher:test, and
|
||||
randomdev/builder:test . Private Docker repositories can be used in the same manner.
|
||||
@@ -1,7 +1,7 @@
|
||||
# Multi-tenancy in Fission
|
||||
|
||||
Multi-tenancy in Fission allows users to create Fission objects, i.e functions, packages, environments and triggers in different namespaces.
|
||||
It mandates that a function reference secrets, configmaps and its package (if explicity referenced during function creation/updation) to be present in the same namespace as the function.
|
||||
It mandates that a function reference secrets, configmaps and its package (if explicitly referenced during function create/update operation) to be present in the same namespace as the function.
|
||||
This allows user separation and prevents in-advertent access to sensitive data of other users sharing the same cluster.
|
||||
However, users are allowed and encouraged to share environments to ensure optimal utilization of cluster resources. To achieve this, users can create all the necessary environments in a ns, say ns1 and then go on to create functions in different namespaces and refer to env in ns1.
|
||||
Users that prefer complete isolation can create their env, functions in the same ns.
|
||||
@@ -27,20 +27,20 @@ This SA is created in every namespace that a user creates builder environments i
|
||||
|
||||
1. Package-getter-binding
|
||||
|
||||
Every time a user creates a package explicity in a namespace, this rolebinding is created in package's namespace (which is also function's namespace). This grants package-getter role to fission-fetcher SA present in the referenced environment's namespace.
|
||||
If the package is a source package, then, fission-builder SA present in the environment namespace is also added to this rolebinding.
|
||||
Every time a user creates a package explicitly in a namespace, this role binding is created in package's namespace (which is also function's namespace). This grants package-getter role to fission-fetcher SA present in the referenced environment's namespace.
|
||||
If the package is a source package, then, fission-builder SA present in the environment namespace is also added to this role binding.
|
||||
|
||||
Next when the user creates a function in the same namespace, if the function's executor type is newdeploy, then, the fission-fetcher SA present in function namespace is also added to the same rolebinding.
|
||||
Next when the user creates a function in the same namespace, if the function's executor type is newdeploy, then, the fission-fetcher SA present in function namespace is also added to the same role binding.
|
||||
|
||||
Note : For functions that have executor type poolmgr, the env pods are created in the namespace that env object is created. Whereas, for those functions that have executor type New deploy mgr, the function pods are created in the namespace that function object is created in.
|
||||
|
||||
This is because, poolmgr allows env sharing and optimal resource utilization. so generic env pools are created in a different namespace and all functions that prefer sharing this env pool can reference these pools.
|
||||
If users require strict isolation, they can either create functions with new deploy backend, or, create env's in different namespaces and not share them across functions.
|
||||
If users require strict isolation, they can either create functions with new deploy backend, or, create envs in different namespaces and not share them across functions.
|
||||
|
||||
2. Secret-Configmap-getter-binding
|
||||
|
||||
Every time a user creates a function in a namespace, Secret-Configmap-getter-binding is created in the same namespace, granting secret-configmap-getter role to fission-fetcher SA present in the referenced environment's namespace in case the executor type is poolmgr.
|
||||
If the executor type is newdeploymgr, then the same rolebinding is created in the same namespace as the function, granting the same secret-configmap-getter role to fission-fetcher SA present in the function namespace.
|
||||
If the executor type is newdeploymgr, then the same role binding is created in the same namespace as the function, granting the same secret-configmap-getter role to fission-fetcher SA present in the function namespace.
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -51,7 +51,7 @@ $ fission env create --name python --image fission/python-env --envns ns1
|
||||
$ fission function create --name func1 --env python --code hello.py --fns ns2
|
||||
```
|
||||
|
||||
2. create a builder and runtime environment in ns3, a source pkg in ns3 and a function referring to this src pkg also in ns3. (for complete isolation, all objs are in ns3)
|
||||
2. create a builder and runtime environment in ns3, a source pkg in ns3 and a function referring to this src pkg also in ns3. (for complete isolation, all objects are in ns3)
|
||||
|
||||
```bash
|
||||
$ fission env create --name python-builder-env --builder fission/python-builder --image fission/python-env --ns3
|
||||
@@ -62,5 +62,5 @@ $ fission fn create --name func3 --fns ns3 --pkg $pkg --entrypoint "user.main"
|
||||
## Note
|
||||
|
||||
1. To maintain backward compatibility, fission objects that are created without the ns flags are created in default namespace. Also, the run time env pods in such a case will continue to live in fission-function ns and builder env pods in fission-builder ns
|
||||
2. Since all envs in a namespace have the same fission-fetcher SA mounted in them, even though multiple envs are created in a namespace and referenced by functions in different namespaces, the SA will have previleges to view those function's secrets if any.
|
||||
3. Similarly, if there are multiple functions in different namespaces but all sharing an env in one namespace, the fission-fetcher SA in that namespace will have previleges to see all of their secrets.
|
||||
2. Since all envs in a namespace have the same fission-fetcher SA mounted in them, even though multiple envs are created in a namespace and referenced by functions in different namespaces, the SA will have privileges to view those function's secrets if any.
|
||||
3. Similarly, if there are multiple functions in different namespaces but all sharing an env in one namespace, the fission-fetcher SA in that namespace will have privileges to see all of their secrets.
|
||||
|
||||
@@ -20,5 +20,5 @@ documentation on the context object in each environment.
|
||||
|
||||
## Kubernetes Watch Event Triggers
|
||||
|
||||
Kubernetes watches can be used to trigger functions. These functions
|
||||
Kubernetes watches can be used to trigger functions. These functions
|
||||
receive the Kubernetes watch.Event object in JSON-serialized form.
|
||||
|
||||
@@ -48,7 +48,7 @@ So we can write a simple logic - to check if a annotation is applicable for an i
|
||||
|
||||
### Implementation 2
|
||||
|
||||
- One of side effects of this is that the annotations will still stay on the source CRD object - for example annotation will stay on the httptrigger as well as the ingress object. This can cause problems in certain cases where something like Prometheus uses annotations to scrape objects. So instead we wrap the annotations needed by an object into another annotation name. This also solves problem of having to guess which annotations to apply to which object.
|
||||
- One of the side effects is that the annotations will still stay on the source CRD object - for example annotation will stay on the httptrigger as well as the ingress object. This can cause problems in certain cases where something like Prometheus uses annotations to scrape objects. So instead we wrap the annotations needed by an object into another annotation name. This also solves problem of having to guess which annotations to apply to which object.
|
||||
|
||||
```yaml
|
||||
apiVersion: fission.io/v1
|
||||
@@ -88,4 +88,4 @@ HTTPTriggerSpec struct {
|
||||
## Final thoughts
|
||||
|
||||
- The implementation idea 2 & 3 look better than 1. The third option involves HTTPTrigger Spec change.
|
||||
- For both (2) & (3) - if in future we have to implement annotations for Functions etc. we will have to consider the fact that a function will in turn create 3 objects (Service, Pod & HPA) and annotations for all three would need to be accommodated.
|
||||
- For both (2) & (3) - if in future we have to implement annotations for Functions etc. we will have to consider the fact that a function will in turn create 3 objects (Service, Pod & HPA) and annotations for all three would need to be accommodated.
|
||||
|
||||
@@ -57,7 +57,7 @@ If we look at this from CI/CD perspective this process requires:
|
||||
3. Fission CLI
|
||||
4. Kubernetes Config so that the apply command can be run
|
||||
|
||||
So if we build a container - which has the above requirements met as installed software (Ex. Fission & Kubectl CLI) or available as environment variable (Github pull token or Kubeconfig), the container can be used as part of CI workflow in any tool such as - Jenkins, Argo, Github Actions, Gitlab etc.
|
||||
So if we build a container - which has the above requirements met as installed software (Ex. Fission & Kubectl CLI) or available as environment variable (Github pull token or Kubeconfig), the container can be used as part of CI workflow in any tool such as - Jenkins, Argo, Github Actions, GitLab etc.
|
||||
|
||||
The idea is to build a generic container with Fission CLI, Kubernetes CLI and a way to read Github token and Kubeconfig from env variable/mounted files and being able to run `fission spec apply` command.
|
||||
|
||||
@@ -90,7 +90,7 @@ Without changing anything in Fission spec it is possible to change these things
|
||||
1. Generate and maintain specs for each environment. This is not a best practice as it leads to drift in code and configuration between environment over time.
|
||||
2. Use placeholder variables (i.e. $DB_CONNECTION_VALUE) and replace them for each environment before deploying. This is better in the sense that you are combining changes specific to each environment with spec code but is still a work around sort of.
|
||||
|
||||
For environment specific configurations, it is possible to use some sort of templating or overlay mechanism. One of interesting projects using overlays is [Kustomize](https://github.com/kubernetes-sigs/kustomize). In any case as of today the fission spec command does not have a way to use template or modify values using overlay and it is worth exploring this approach for fission spec.
|
||||
For environment specific configurations, it is possible to use some sort of templates or overlay mechanism. One of interesting projects using overlays is [Kustomize](https://github.com/kubernetes-sigs/kustomize). In any case as of today the fission spec command does not have a way to use template or modify values using overlay and it is worth exploring this approach for fission spec.
|
||||
|
||||
## 3 Promotion from one environment to another
|
||||
|
||||
@@ -98,4 +98,4 @@ This necessarily does not fall in the area of Fission per se but it would be fai
|
||||
|
||||
## Action Items
|
||||
|
||||
As a first step it would be good to build a simple container mentioned in (1) and use it in various tools to understand the value it adds and any unknowns. The next steps would be to build a full end to end pipeline from source to production.
|
||||
As a first step it would be good to build a simple container mentioned in (1) and use it in various tools to understand the value it adds and any unknowns. The next steps would be to build a full end to end pipeline from source to production.
|
||||
|
||||
@@ -125,4 +125,4 @@ Improving this is probably best left to future work.
|
||||
|
||||
|
||||
The more heavyweight solution solves some of these limitations to an extent, but these do not way up to the increased
|
||||
development and maintainance cost IMO. If needed we could explore this option (or some hybrid option) in the future.
|
||||
development and maintenance cost IMO. If needed we could explore this option (or some hybrid option) in the future.
|
||||
|
||||
@@ -46,8 +46,8 @@ directory (in case of deployment packages).
|
||||
|
||||
The load request may contain an EntryPoint. If it does, the loader
|
||||
must interpret this; usually it's the name of a function in a module
|
||||
or package containing multiple functions. If there is no entrypoint,
|
||||
the environment must use a default; again, the value of thsi default
|
||||
or package containing multiple functions. If there is no entry point,
|
||||
the environment must use a default; again, the value of this default
|
||||
is environment-specific.
|
||||
|
||||
The load request may contain a URL. If it does, requests to that URL
|
||||
|
||||
@@ -52,11 +52,11 @@ container.
|
||||
### Discussion
|
||||
|
||||
Early feedback shows that almost evey user ends up rebuilding images
|
||||
to add some dependecies. Some sort of automated dependecy resolution
|
||||
to add some dependencies. Some sort of automated dependency resolution
|
||||
would be very nice to have and improve the development workflow. In
|
||||
other words, just attach a package.json(nodejs) or
|
||||
requirements.txt(python) with a function, and fission will do the
|
||||
rest. There's also the possiblity of supporting buildpacks (simple
|
||||
rest. There's also the possibility of supporting buildpacks (simple
|
||||
zipfiles), a la AWS Lambda.
|
||||
|
||||
Though we can support compiled languages by doing the compilation
|
||||
@@ -82,7 +82,7 @@ use environments, I've already packaged up my function, here it is".
|
||||
Roughly in order of priority:
|
||||
|
||||
0. Retain the simplicity of the simple use cases. First user
|
||||
experience shoud remain trivial -- write a function, map a URL,
|
||||
experience should remain trivial -- write a function, map a URL,
|
||||
done.
|
||||
|
||||
1. Support compiled languages. Support error reporting on function
|
||||
@@ -91,7 +91,7 @@ Roughly in order of priority:
|
||||
2. Support functions as a collection of files rather than just one
|
||||
file.
|
||||
|
||||
3. Support automated environment-specific dependecy resolution.
|
||||
3. Support automated environment-specific dependency resolution.
|
||||
|
||||
(#3 may end up having the same solution as #1. You could think of
|
||||
gathering deps as a "compilation" of package.json,
|
||||
@@ -297,7 +297,7 @@ affinity rule, but k8s services only support IP based affinity.]
|
||||
|
||||
#### Poolmgr
|
||||
|
||||
Poolmgr remains relatively unchanged. Instead of contructing URLs for
|
||||
Poolmgr remains relatively unchanged. Instead of constructing URLs for
|
||||
function metadata, it uses the deployment package URL in the function
|
||||
object.
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ A new layer - executor now sits between the router and actual backends are respo
|
||||
|
||||
# Backend
|
||||
|
||||
A backend is responsible for execution of a function - which can involve provisioning appropriate objects in Kubernetes. So with the new design Pool manager becomes one of backends. As of this writing there are two backends which are described as:
|
||||
A backend is responsible for execution of a function - which can involve provisioning appropriate objects in Kubernetes. So with the new design Pool manager becomes one of the backends. As of this writing there are two backends which are described as:
|
||||
|
||||
### Pool Manager Backend
|
||||
|
||||
@@ -21,7 +21,7 @@ New Deploy backend create a Kubernetes deployment, a Kubernetes Service for a gi
|
||||
|
||||
### Execution Strategy
|
||||
|
||||
While this is still a WIP, parameters that affect execution behaviour of function are based on `InvokeStrategy`. A invoke strategy defines the `strategyType` and actual strategy parameters encapsulated in the strategy object.
|
||||
While this is still a WIP, parameters that affect execution behavior of function are based on `InvokeStrategy`. A invoke strategy defines the `strategyType` and actual strategy parameters encapsulated in the strategy object.
|
||||
|
||||
```
|
||||
InvokeStrategy struct {
|
||||
|
||||
@@ -8,7 +8,7 @@ This document documents the design and thoughts that lead to design of Java envi
|
||||
- Kotlin (Server side with Spring)
|
||||
|
||||
- In Java there are a few prominent frameworks which have a ecosystem of their own (See list below). How these framework fit in the environment will be detailed later, but it is important to understand their place in ecosystem and design for it.
|
||||
- A large percentage of entertprise developers use [Spring framework](https://spring.io/) as has been shown by multiple surveys
|
||||
- A large percentage of enterprise developers use [Spring framework](https://spring.io/) as has been shown by multiple surveys
|
||||
- Reactive has taken up recently with data intensive operations [Reactive extensions for JVM](https://github.com/ReactiveX/RxJava)
|
||||
- [Spark](http://sparkjava.com/) is a micro web framework
|
||||
|
||||
@@ -31,7 +31,7 @@ Now - the T & R could be different things and we discuss some options below:
|
||||
|
||||
From the early implementation in the branch mentioned above, the environment extracts the body and send it as a JSON string. The JSON then can be transformed into the appropriate object by the function.
|
||||
|
||||
This works well, but has one major limitation: the function does not get access to other things like headers etc. The same thing applies to the reponse: function can send the body but looses control over status code etc.
|
||||
This works well, but has one major limitation: the function does not get access to other things like headers etc. The same thing applies to the response: function can send the body but looses control over status code etc.
|
||||
|
||||
### HttpServletRequest and HttpServletResponse
|
||||
|
||||
@@ -64,4 +64,4 @@ The Spring cloud function project also discusses the issue of not having access
|
||||
JVM environment design is based on Spring boot and Spring MVC frameworks. The details can be found in branch, but here are some key points:
|
||||
|
||||
- All classes in the function and dependent classes are loaded into JVM. Which means the user should supply the uber/fat jar for execution.
|
||||
- The entrypoint class is specified by the user as ```entrypoint``` flag on the class. The method is by convention (```apply``` as per the Function interface contract)
|
||||
- The entrypoint class is specified by the user as ```entrypoint``` flag on the class. The method is by convention (```apply``` as per the Function interface contract)
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
# Profiling Fission with Pprof
|
||||
|
||||
Fission uses [net/pprof](https://pkg.go.dev/net/http/pprof) for profiling the code across Fission components.
|
||||
It would be helpful in identifying performance bottlenecks.
|
||||
|
||||
To enable profiling, just set `pprof.enabled` to `true` while installing Fission helm chart.
|
||||
|
||||
## Pprof data of component pod
|
||||
|
||||
Do port forwarding to port 6060 of the pod,
|
||||
|
||||
```sh
|
||||
kubectl port-forward pod/executor-668dfd7c89-2b2ff 6060:6060
|
||||
```
|
||||
|
||||
Run different commands to get or analyze pprof data,
|
||||
|
||||
```sh
|
||||
go tool pprof http://localhost:6060/debug/pprof/flamegraph
|
||||
|
||||
go tool pprof http://localhost:6060/debug/pprof/profile\?seconds\=60
|
||||
```
|
||||
|
||||
You can also analyze with binary to get correct references of source,
|
||||
|
||||
```sh
|
||||
# Download binary from pod
|
||||
kubectl cp fission/executor-668dfd7c89-2b2ff:/fission-bundle fission-bundle
|
||||
|
||||
go tool pprof -http ":49816" fission-bundle http://localhost:49513/debug/pprof
|
||||
```
|
||||
|
||||
You can also download pprof data and visualize/analyze with different compatible tools.
|
||||
@@ -9,7 +9,7 @@ Most of current integration tests are CLI driven. Fission CLI is used to test ex
|
||||
This section only explains the problems/best practices without going into tooling and language used for implementation.
|
||||
### Separating the test & data
|
||||
|
||||
Seperating the tests from test data has two aspects - one is separation of concerns and second is scaling the tests without touching the test logic. The test data is a simple data structure which holds all information and test can take data and execute the logic.
|
||||
Separating the tests from test data has two aspects - one is separation of concerns and second is scaling the tests without touching the test logic. The test data is a simple data structure which holds all information and test can take data and execute the logic.
|
||||
|
||||
As an example today we test "Hello world" for nodejs environment with a simple hello.js like this:
|
||||
|
||||
@@ -36,7 +36,7 @@ And feed it with a dictionary which has all possible combination of tests:
|
||||
node: {"fission/node-env", "test/hello.js", "/hellonode"},
|
||||
python: {"fission/python-env", "test/hello.py", "/hellopy"},
|
||||
golang: {"fission/go-env", "test/hello.go", "/hellogo"},
|
||||
binray: {"fission/binary-env", "test/hello.sh", "/hellobinary"},
|
||||
binary: {"fission/binary-env", "test/hello.sh", "/hellobinary"},
|
||||
}
|
||||
|
||||
```
|
||||
@@ -63,7 +63,7 @@ The ability to have clean and separate before and after blocks, apart from separ
|
||||
- Running a suite of tests for same setup (See tagging for suite of tests)
|
||||
### Tagging tests & running a selection
|
||||
|
||||
Over a period of time as tests grow, there will be unit, smkoe, integration, performance, soak tests and so on. Ability to run a perticular test suite only or a combination of them makes it easy to run for specific purpose.
|
||||
Over a period of time as tests grow, there will be unit, smoke, integration, performance, soak tests and so on. Ability to run a particular test suite only or a combination of them makes it easy to run for specific purpose.
|
||||
### Measuring test times
|
||||
|
||||
[Good to have, not a must] Measuring time for tests and reporting somewhere helps over time to monitor trends. Although this job is better done by performance/benchmark tests so it is not a strict requirement
|
||||
@@ -74,7 +74,7 @@ It would be good to have cleaner/relevant logging as part of build & test. For e
|
||||
|
||||
It would be good to be able to run tests in parallel.
|
||||
|
||||
## Evalutaing the tools/alternatives
|
||||
## Evaluating the tools/alternatives
|
||||
### BATS
|
||||
|
||||
Bash Automated Testing System is like a enhanced version of bash with support for @test tags and before and after steps & ability to skip tests etc. While it enhances the bash to certain extent, the overall improvement is only marginal.
|
||||
@@ -111,7 +111,7 @@ https://golang.org/pkg/os/exec
|
||||
|
||||
### Using CLI package
|
||||
|
||||
Currently we build a CLI and then execute the tests. The tests basically call one of functions from CLI package. If we decide to use a go lang based framework, then we can import the CLI package and then call those functions by providing them context. This is as good as calling the Fission from CLI, with added benefit of programmibility of Go langugage.
|
||||
Currently we build a CLI and then execute the tests. The tests basically call one of functions from CLI package. If we decide to use a go lang based framework, then we can import the CLI package and then call those functions by providing them context. This is as good as calling the Fission from CLI, with added benefit of programmability of Go language.
|
||||
|
||||
```
|
||||
func TestSomething(t *testing.T) {
|
||||
@@ -135,7 +135,7 @@ Ginkgo is a BDD framework which works with Gomega matcher library. I will state
|
||||
From Ginkgo:
|
||||
|
||||
- Global `BeforeSuite` and after `AfterSuite` can be used to have global setup and tear down phases
|
||||
- For tests `BeforeEach` and `AfterEach` and more such varients to do before and after test tasks.
|
||||
- For tests `BeforeEach` and `AfterEach` and more such variants to do before and after test tasks.
|
||||
|
||||
From Gomega:
|
||||
|
||||
@@ -180,7 +180,7 @@ Eventually(session.Out).Should(gbytes.Say("hello [A-Za-z], world"))
|
||||
```
|
||||
There are many more matchers which cane be found here: http://onsi.github.io/gomega/#provided-matchers
|
||||
|
||||
- We can build custom mathers in Go language for reusable logic.
|
||||
- We can build custom matchers in Go language for reusable logic.
|
||||
|
||||
#### Links
|
||||
Ginkgo: http://onsi.github.io/ginkgo/
|
||||
@@ -199,11 +199,11 @@ Based on the discussion with team, here are current thoughts and next action ite
|
||||
- How will migration of tests happen over time:
|
||||
- Aim is to keep existing tests around so that enough validation is in place
|
||||
- May be migrate one test at a time
|
||||
- How much of current setup etc. will move into framework? For example it is clear that helm commands should be part of test framework as part of setup/teardown. But other sections may or may not be. A RCA needs to be done to analyze and come up with clear demarkation.
|
||||
- How much of current setup etc. will move into framework? For example it is clear that helm commands should be part of test framework as part of setup/teardown. But other sections may or may not be. A RCA needs to be done to analyze and come up with clear demarcation.
|
||||
|
||||
## References
|
||||
|
||||
- EngineYard uses BATS: https://www.engineyard.com/blog/bats-test-command-line-tools
|
||||
- AWS CLI Tests, written in Python (CLI itself is also in Python): https://github.com/aws/aws-cli/tree/develop/tests
|
||||
- Kubernetes uses Ginkgo and Gomega extensively: https://github.com/kubernetes/kubernetes/search?l=Go&q=onsi&type=
|
||||
- Hashicorp's Mitchell's talk on Advanced testing with go talks about some good patterns to use: https://www.youtube.com/watch?v=8hQG7QlcLBk
|
||||
- Hashicorp's Mitchell's talk on Advanced testing with go talks about some good patterns to use: https://www.youtube.com/watch?v=8hQG7QlcLBk
|
||||
|
||||
@@ -14,35 +14,87 @@
|
||||
|
||||
.DEFAULT_GOAL := check
|
||||
|
||||
check: test-run build clean
|
||||
SKAFFOLD_PROFILE ?= kind
|
||||
|
||||
# run basic check scripts
|
||||
test-run:
|
||||
VERSION ?= v0.0.0
|
||||
TIMESTAMP ?= $(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
|
||||
COMMITSHA ?= $(shell git rev-parse HEAD)
|
||||
|
||||
GOOS ?= $(shell go env GOOS)
|
||||
GOARCH ?= $(shell go env GOARCH)
|
||||
|
||||
FISSION-CLI-SUFFIX :=
|
||||
ifeq ($(GOOS), windows)
|
||||
FISSION-CLI-SUFFIX := .exe
|
||||
endif
|
||||
|
||||
# Show this help.
|
||||
help:
|
||||
@awk '/^#/{c=substr($$0,3);next}c&&/^[[:alpha:]][[:alnum:]_-]+:/{print substr($$1,1,index($$1,":")),c}1{c=0}' $(MAKEFILE_LIST) | column -s: -t
|
||||
|
||||
### Static checks
|
||||
check: test-run build-fission-cli clean
|
||||
|
||||
code-checks:
|
||||
hack/verify-gofmt.sh
|
||||
hack/verify-govet.sh
|
||||
hack/verify-staticcheck.sh
|
||||
|
||||
# run basic check scripts
|
||||
test-run: code-checks
|
||||
hack/runtests.sh
|
||||
@rm -f coverage.txt
|
||||
|
||||
# ensure the changes are buildable
|
||||
build:
|
||||
go build -o cmd/fission-bundle/fission-bundle ./cmd/fission-bundle/
|
||||
go build -o cmd/fission-cli/fission ./cmd/fission-cli/
|
||||
go build -o cmd/fetcher/fetcher ./cmd/fetcher/
|
||||
go build -o cmd/fetcher/builder ./cmd/builder/
|
||||
### Binaries
|
||||
build-fission-cli:
|
||||
@GOOS=$(GOOS) GOARCH=$(GOARCH) GORELEASER_CURRENT_TAG=$(VERSION) goreleaser build --snapshot --rm-dist --single-target --id fission-cli
|
||||
|
||||
# install CLI binary to $PATH
|
||||
install: build
|
||||
mv cmd/fission-cli/fission $(GOPATH)/bin
|
||||
install-fission-cli:
|
||||
mv dist/fission-cli_$(GOOS)_$(GOARCH)/fission$(FISSION-CLI-SUFFIX) /usr/local/bin/fission
|
||||
|
||||
# build images (environment images are not included)
|
||||
image:
|
||||
docker build -t fission-bundle -f cmd/fission-bundle/Dockerfile.fission-bundle .
|
||||
docker build -t fetcher -f cmd/fetcher/Dockerfile.fission-fetcher .
|
||||
docker build -t builder -f cmd/builder/Dockerfile.fission-builder .
|
||||
### Codegen
|
||||
codegen:
|
||||
@./hack/update-codegen.sh
|
||||
|
||||
### CRDs
|
||||
generate-crds:
|
||||
controller-gen crd:trivialVersions=false,preserveUnknownFields=false \
|
||||
paths=./pkg/apis/core/v1 \
|
||||
output:crd:artifacts:config=crds/v1
|
||||
|
||||
create-crds:
|
||||
@kubectl create -k crds/v1
|
||||
|
||||
update-crds:
|
||||
@kubectl replace -k crds/v1
|
||||
|
||||
delete-crds:
|
||||
@kubectl delete -k crds/v1
|
||||
|
||||
### Cleanup
|
||||
clean:
|
||||
@rm -f cmd/fission-bundle/fission-bundle
|
||||
@rm -f cmd/fission-cli/fission
|
||||
@rm -f cmd/fetcher/fetcher
|
||||
@rm -f cmd/fetcher/builder
|
||||
@rm -f dist/
|
||||
|
||||
### Misc
|
||||
generate-swagger-doc:
|
||||
@./hack/update-swagger-docs.sh
|
||||
|
||||
all-generators: codegen generate-crds generate-swagger-doc
|
||||
|
||||
skaffold-prebuild:
|
||||
@GOOS=linux GOARCH=amd64 GORELEASER_CURRENT_TAG=$(VERSION) goreleaser build --snapshot --rm-dist --single-target
|
||||
@cp -v cmd/builder/Dockerfile.fission-builder dist/builder_linux_amd64/Dockerfile
|
||||
@cp -v cmd/fetcher/Dockerfile.fission-fetcher dist/fetcher_linux_amd64/Dockerfile
|
||||
@cp -v cmd/fission-bundle/Dockerfile.fission-bundle dist/fission-bundle_linux_amd64/Dockerfile
|
||||
@cp -v cmd/reporter/Dockerfile.reporter dist/reporter_linux_amd64/Dockerfile
|
||||
@cp -v cmd/preupgradechecks/Dockerfile.fission-preupgradechecks dist/pre-upgrade-checks_linux_amd64/Dockerfile
|
||||
|
||||
skaffold-deploy: skaffold-prebuild
|
||||
skaffold run -p $(SKAFFOLD_PROFILE)
|
||||
|
||||
### Release
|
||||
release:
|
||||
@./hack/generate-helm-manifest.sh $(VERSION)
|
||||
@./hack/release.sh $(VERSION)
|
||||
@./hack/release-tag.sh $(VERSION)
|
||||
@./hack/changelog.sh
|
||||
|
||||
@@ -1,9 +1,24 @@
|
||||
# Fission: Serverless Functions for Kubernetes
|
||||
<p align="center">
|
||||
<img src="https://docs.fission.io/images/logo-gh.svg" width="300" />
|
||||
<br>
|
||||
<h1 align="center">Fission: Serverless Functions for Kubernetes</h1>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://github.com/fission/fission/actions?query=workflow%3A%22Fission+CI%22">
|
||||
<img src="https://github.com/fission/fission/workflows/Fission%20CI/badge.svg?branch=master" alt="Build Status" />
|
||||
</a>
|
||||
|
||||
<a href="https://goreportcard.com/report/github.com/fission/fission">
|
||||
<img src="https://goreportcard.com/badge/github.com/fission/fission" alt="Go Report Card" />
|
||||
</a>
|
||||
<a href="https://codecov.io/gh/fission/fission">
|
||||
<img src="https://codecov.io/gh/fission/fission/branch/master/graph/badge.svg" alt="codecov" />
|
||||
</a>
|
||||
<br>
|
||||
<a href="http://fission.io">fission.io</a> | <a href="http://twitter.com/fissionio">@fissionio</a> | <a href="https://join.slack.com/t/fissionio/shared_invite/enQtOTI3NjgyMjE5NzE3LTllODJiODBmYTBiYWUwMWQxZWRhNDhiZDMyN2EyNjAzMTFiYjE2Nzc1NzE0MTU4ZTg2MzVjMDQ1NWY3MGJhZmE">Slack</a>
|
||||
</p>
|
||||
|
||||
[](https://travis-ci.org/fission/fission)
|
||||
[](https://goreportcard.com/report/github.com/fission/fission)
|
||||
|
||||
[fission.io](http://fission.io) | [@fissionio](http://twitter.com/fissionio) | [Slack](https://join.slack.com/t/fissionio/shared_invite/enQtOTI3NjgyMjE5NzE3LTllODJiODBmYTBiYWUwMWQxZWRhNDhiZDMyN2EyNjAzMTFiYjE2Nzc1NzE0MTU4ZTg2MzVjMDQ1NWY3MGJhZmE)
|
||||
--------------
|
||||
|
||||
Fission is a fast serverless framework for Kubernetes with a focus on
|
||||
developer productivity and high performance.
|
||||
@@ -17,7 +32,21 @@ language-specific parts are isolated in something called
|
||||
_environments_ (more below). Fission currently supports NodeJS, Python, Ruby, Go,
|
||||
PHP, Bash, and any Linux executable, with more languages coming soon.
|
||||
|
||||
# Performance: 100msec cold start
|
||||
Table of Contents
|
||||
=================
|
||||
|
||||
* [Fission: Serverless Functions for Kubernetes](#fission-serverless-functions-for-kubernetes)
|
||||
* [Performance: 100msec cold start](#performance-100msec-cold-start)
|
||||
* [Kubernetes is the right place for Serverless](#kubernetes-is-the-right-place-for-serverless)
|
||||
* [Getting Started](#getting-started)
|
||||
* [Learn More](#learn-more)
|
||||
* [Contributing](#contributing)
|
||||
* [Get Help & Community Meeting](#get-help--community-meeting)
|
||||
* [Official Releases](#official-releases)
|
||||
* [Sponsors](#sponsors)
|
||||
* [Licensing](#licensing)
|
||||
|
||||
## Performance: 100msec cold start
|
||||
|
||||
Fission maintains a pool of "warm" containers that each contain a
|
||||
small dynamic loader. When a function is first called,
|
||||
@@ -25,7 +54,7 @@ i.e. "cold-started", a running container is chosen and the function is
|
||||
loaded. This pool is what makes Fission fast: cold-start latencies
|
||||
are typically about 100msec.
|
||||
|
||||
# Kubernetes is the right place for Serverless
|
||||
## Kubernetes is the right place for Serverless
|
||||
|
||||
We're built on Kubernetes because we think any non-trivial app will
|
||||
use a combination of serverless functions and more conventional
|
||||
@@ -36,66 +65,58 @@ Building on Kubernetes also means that anything you do for operations
|
||||
on your Kubernetes cluster — such as monitoring or log
|
||||
aggregation — also helps with ops on your Fission deployment.
|
||||
|
||||
# Getting started and documentation
|
||||
|
||||
## Fission Concepts
|
||||
|
||||
Visit [concepts](https://docs.fission.io/docs/concepts/) for more details.
|
||||
|
||||
## Documentations
|
||||
|
||||
You can learn more about Fission and get started from [Fission Docs](https://docs.fission.io/docs).
|
||||
* See the [installation guide](https://docs.fission.io/docs/installation/) for installing and running Fission.
|
||||
* See the [troubleshooting guide](https://docs.fission.io/docs/trouble-shooting/) for debugging your functions and Fission installation.
|
||||
|
||||
## Usage
|
||||
## Getting Started
|
||||
|
||||
```bash
|
||||
# Add the stock NodeJS env to your Fission deployment
|
||||
$ fission env create --name nodejs --image fission/node-env
|
||||
|
||||
# A javascript one-liner that prints "hello world"
|
||||
$ curl https://raw.githubusercontent.com/fission/fission/master/examples/nodejs/hello.js > hello.js
|
||||
|
||||
# Upload your function code to fission
|
||||
$ fission function create --name hello --env nodejs --code hello.js
|
||||
|
||||
# Map GET /hello to your new function
|
||||
$ fission route create --method GET --url /hello --function hello
|
||||
# Create a function with a javascript one-liner that prints "hello world"
|
||||
$ fission function create --name hello --env nodejs --code https://raw.githubusercontent.com/fission/examples/master/nodejs/hello.js
|
||||
|
||||
# Run the function. This takes about 100msec the first time.
|
||||
$ fission function test --name hello
|
||||
Hello, world!
|
||||
```
|
||||
|
||||
# Contributing
|
||||
## Learn More
|
||||
|
||||
## Building Fission
|
||||
See the [compilation guide](https://docs.fission.io/docs/contributing/).
|
||||
* Understand [Fission Concepts](https://docs.fission.io/docs/concepts/).
|
||||
* See the [installation guide](https://docs.fission.io/docs/installation/) for installing and running Fission.
|
||||
* You can learn more about Fission and get started from [Fission Docs](https://docs.fission.io/docs).
|
||||
* See the [troubleshooting guide](https://docs.fission.io/docs/trouble-shooting/) for debugging your functions and Fission installation.
|
||||
|
||||
## Contributing
|
||||
|
||||
Check out the [contributing guide](CONTRIBUTING.md).
|
||||
|
||||
## Get Help & Community Meeting
|
||||
|
||||
## Contact
|
||||
Fission is a project by [many contributors](https://github.com/fission/fission/graphs/contributors).
|
||||
Reach us on [slack](https://join.slack.com/t/fissionio/shared_invite/enQtOTI3NjgyMjE5NzE3LTllODJiODBmYTBiYWUwMWQxZWRhNDhiZDMyN2EyNjAzMTFiYjE2Nzc1NzE0MTU4ZTg2MzVjMDQ1NWY3MGJhZmE) or [twitter](https://twitter.com/fissionio).
|
||||
|
||||
## Community meeting
|
||||
A regular community meeting takes place every other Thursday at 09:00 AM PT (Pacific Time). [Convert to your local timezone](http://www.thetimezoneconverter.com/?t=09:00&tz=PT%20%28Pacific%20Time%29).
|
||||
|
||||
A regular community meeting takes place every other Thursday at 08:30 AM PT (Pacific Time). [Convert to your local timezone](http://www.thetimezoneconverter.com/?t=08:30&tz=PT%20%28Pacific%20Time%29).
|
||||
Meeting Link: https://zoom.us/j/413921817
|
||||
|
||||
# Official Releases
|
||||
The meeting agenda for next meeting and notes from past meetings are maintained in [this document](https://docs.google.com/document/d/1E-xw4KJgka4sUpETHxr9BJBYntzrtxlAN_CE3Wt8kws). You are welcome to join to discuss direction of project, design and implementation reviews and general questions about project etc.
|
||||
|
||||
## Official Releases
|
||||
|
||||
Official releases of Fission can be found on [the releases page](https://github.com/fission/fission/releases).
|
||||
Please note that it is strongly recommended that you use official releases of Fission, as unreleased versions from
|
||||
the master branch are subject to changes and incompatibilities that will not be supported in the official releases.
|
||||
Builds from the master branch can have functionality changed and even removed at any time without compatibility support
|
||||
and without prior notice.
|
||||
|
||||
# Sponsors
|
||||
The following companies, organizations, and individuals support Fission's ongoing maintenance and development.
|
||||
Become a sponsor to get your logo on our README on Github with a link to your site.
|
||||
## Sponsors
|
||||
|
||||
The following companies, organizations, and individuals support Fission's ongoing maintenance and development. If you are using/contributing to Fission, we would be happy to list you here, please raise a Pull request.
|
||||
|
||||
<p>
|
||||
<a href="https://infracloud.io/"><img src="https://fission.io/sponsors/infracloud.png" alt="InfraCloud" height="70"></a>
|
||||
<a href="https://srcmesh.com/"><img src="https://fission.io/sponsors/srcmesh.png" alt="Srcmesh" height="70"></a>
|
||||
<a href="https://www.digitalocean.com/?utm_medium=opensource&utm_source=fissionio">
|
||||
<img src="https://opensource.nyc3.cdn.digitaloceanspaces.com/attribution/assets/PoweredByDO/DO_Powered_by_Badge_blue.svg" width="201px">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
# Licensing
|
||||
|
||||
+11
-2
@@ -43,10 +43,10 @@ Parameter | Description | Default
|
||||
`routerServiceType` | Type of Fission Router service to use. For minikube, set this to NodePort, elsewhere use LoadBalancer or ClusterIP. | `LoadBalancer`
|
||||
`repository` | Image base repository | `index.docker.io`
|
||||
`image` | Fission image repository | `fission/fission-bundle`
|
||||
`imageTag` | Fission image tag | `1.8.0`
|
||||
`imageTag` | Fission image tag | `1.13.1`
|
||||
`pullPolicy` | Image pull policy | `IfNotPresent`
|
||||
`fetcher.image` | Fission fetcher repository | `fission/fetcher`
|
||||
`fetcher.imageTag` | Fission fetcher image tag | `1.8.0`
|
||||
`fetcher.imageTag` | Fission fetcher image tag | `1.13.1`
|
||||
`controllerPort` | Fission Controller service port | `31313`
|
||||
`routerPort` | Fission Router service port | ` 31314`
|
||||
`functionNamespace` | Namespace in which to run fission functions (this is different from the release namespace) | `fission-function`
|
||||
@@ -68,6 +68,7 @@ Parameter | Description | Default
|
||||
`extraCoreComponentPodConfig` | Extend the container specs for the core fission pods. Can be used to add things like affinty/tolerations/nodeSelectors/etc. | None
|
||||
`executor.adoptExistingResources` | If true, executor will try to adopt existing resources created by the old executor instance. | `false`
|
||||
`router.deployAsDaemonSet` | Deploy router as DaemonSet instead of Deployment | `false`
|
||||
`router.extraCoreComponentPodConfig` | Extend the container specs for the router fission pods. Can be used to add things like affinty/tolerations/nodeSelectors/etc. Overrides the generic `extraCoreComponentPodConfig`| None
|
||||
`router.svcAddressMaxRetries` | Max retries times for router to retry on a certain service URL returns from cache/executor | `5`
|
||||
`router.svcAddressUpdateTimeout` | The length of update lock expiry time for router to get a service URL returns from executor | `30`
|
||||
`router.svcAnnotations` | Annotations for router service | None
|
||||
@@ -78,6 +79,10 @@ Parameter | Description | Default
|
||||
`router.roundTrip.timeout` | HTTP transport request timeout | `50ms`
|
||||
`router.roundTrip.timeoutExponent` | The length of request timeout will multiply with timeoutExponent after each retry | `2`
|
||||
`router.roundTrip.maxRetries` | Max retries times of a failed request | `10`
|
||||
`openTracing.enabled` | If true, OpenTracing is enabled | `false`
|
||||
`openTracing.collectorEndpoint` | Jaeger collector endpoint | ``
|
||||
`openTracing.samplingRate` | Probabilistic sampling rate | `0.5`
|
||||
`otelCollectorEndpoint` | OpenTelemetry collector endpoint | None
|
||||
|
||||
### Extra configuration for `fission-all`
|
||||
|
||||
@@ -89,8 +94,12 @@ Parameter | Description | Default
|
||||
`logger.fluentdImage` | Logger fluentbit image | `fluent/fluent-bit`
|
||||
`logger.fluentdImageTag` | Logger fluentbit image tag | `1.0.4`
|
||||
`nats.enabled` | Nats streaming enabled | `true`
|
||||
`nats.external` | Use external Nats installation | `false`
|
||||
`nats.hostaddress` | Address of NATS cluster | `nats-streaming:4222`
|
||||
`nats.authToken` | Nats streaming auth token | `defaultFissionAuthToken`
|
||||
`nats.clusterID` | Nats streaming clusterID | `fissionMQTrigger`
|
||||
`nats.clientID` | Client name registered with nats streaming | `fission`
|
||||
`nats.queueGroup` | Queue group registered with nats streaming | `fission-messageQueueNatsTrigger`
|
||||
`natsStreamingPort` | Nats streaming service port | `31316`
|
||||
`azureStorageQueue.enabled` | Azure storage account name | `false`
|
||||
`azureStorageQueue.key` | Azure storage account name | `""`
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
dependencies:
|
||||
- name: prometheus
|
||||
repository: https://prometheus-community.github.io/helm-charts
|
||||
version: 13.2.1
|
||||
digest: sha256:136360a97bdc11f1933d75bab77728acc75dd9583257b973cb3336b6d136c9b6
|
||||
generated: "2021-05-27T18:51:04.509283+05:30"
|
||||
@@ -1,15 +1,21 @@
|
||||
apiVersion: v1
|
||||
apiVersion: v2
|
||||
name: fission-all
|
||||
version: 1.8.0
|
||||
version: v1.15.0-rc1
|
||||
description: Fission is a fast serverless framework for Kubernetes.
|
||||
keywords:
|
||||
- fission
|
||||
- serverless
|
||||
home: http://fission.io/
|
||||
home: https://fission.io/
|
||||
maintainers:
|
||||
- name: Soam Vasani
|
||||
email: soamvasani+1@gmail.com
|
||||
- name: Ta Ching Chen
|
||||
email: hello@tachingchen.com
|
||||
- name: Vishal Biyani
|
||||
email: vishal@infracloud.io
|
||||
- name: Sanket Sudake
|
||||
email: sanket@infracloud.io
|
||||
engine: gotpl
|
||||
appVersion: 1.8.0
|
||||
appVersion: v1.15.0-rc1
|
||||
type: application
|
||||
dependencies:
|
||||
- name: prometheus
|
||||
version: 13.2.1
|
||||
repository: https://prometheus-community.github.io/helm-charts
|
||||
condition: prometheus.enabled
|
||||
@@ -16,7 +16,8 @@
|
||||
|
||||
[FILTER]
|
||||
Name kubernetes
|
||||
Match log.*
|
||||
Match *
|
||||
Kube_Tag_Prefix log.var.log.fission.
|
||||
Kube_URL https://kubernetes.default.svc.cluster.local:443
|
||||
|
||||
#
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
dependencies:
|
||||
- name: prometheus
|
||||
repository: https://kubernetes-charts.storage.googleapis.com
|
||||
version: 9.3.1
|
||||
digest: sha256:89a63a5f01c08032106a94c59fc7a5929e449458bf5fd06d86c8b048ac628bf4
|
||||
generated: "2019-11-18T10:16:20.334338911Z"
|
||||
@@ -1,5 +0,0 @@
|
||||
dependencies:
|
||||
- name: prometheus
|
||||
version: 9.3.1
|
||||
repository: https://kubernetes-charts.storage.googleapis.com
|
||||
condition: prometheus.enabled
|
||||
@@ -1,13 +1,13 @@
|
||||
1. Install the client CLI.
|
||||
|
||||
Mac:
|
||||
$ curl -Lo fission https://github.com/fission/fission/releases/download/{{ .Chart.Version }}/fission-cli-osx && chmod +x fission && sudo mv fission /usr/local/bin/
|
||||
$ curl -Lo fission https://github.com/fission/fission/releases/download/{{ .Chart.Version }}/fission-{{ .Chart.Version }}-darwin-amd64 && chmod +x fission && sudo mv fission /usr/local/bin/
|
||||
|
||||
Linux:
|
||||
$ curl -Lo fission https://github.com/fission/fission/releases/download/{{ .Chart.Version }}/fission-cli-linux && chmod +x fission && sudo mv fission /usr/local/bin/
|
||||
$ curl -Lo fission https://github.com/fission/fission/releases/download/{{ .Chart.Version }}/fission-{{ .Chart.Version }}-linux-amd64 && chmod +x fission && sudo mv fission /usr/local/bin/
|
||||
|
||||
Windows:
|
||||
For Windows, you can use the linux binary on WSL. Or you can download this windows executable: https://github.com/fission/fission/releases/download/{{ .Chart.Version }}/fission-cli-windows.exe
|
||||
For Windows, you can use the linux binary on WSL. Or you can download this windows executable: https://github.com/fission/fission/releases/download/{{ .Chart.Version }}/fission-{{ .Chart.Version }}-windows-amd64.exe
|
||||
|
||||
2. You're ready to use Fission!
|
||||
|
||||
@@ -15,7 +15,7 @@ Windows:
|
||||
$ fission env create --name nodejs --image fission/node-env
|
||||
|
||||
# Get a hello world
|
||||
$ curl https://raw.githubusercontent.com/fission/fission/master/examples/nodejs/hello.js > hello.js
|
||||
$ curl https://raw.githubusercontent.com/fission/examples/master/nodejs/hello.js > hello.js
|
||||
|
||||
# Register this function with Fission
|
||||
$ fission function create --name hello --env nodejs --code hello.js
|
||||
|
||||
@@ -38,8 +38,42 @@ This template generates the image name for the deployment depending on the value
|
||||
*/}}
|
||||
{{- define "fission-bundleImage" -}}
|
||||
{{- if .Values.repository -}}
|
||||
{{- if eq .Values.imageTag "" -}}
|
||||
{{ .Values.repository }}/{{ .Values.image }}
|
||||
{{- else -}}
|
||||
{{ .Values.repository }}/{{ .Values.image }}:{{ .Values.imageTag }}
|
||||
{{- end }}
|
||||
{{- else -}}
|
||||
{{ .Values.image }}:{{ .Values.imageTag }}
|
||||
{{- if eq .Values.imageTag "" -}}
|
||||
{{ .Values.image }}
|
||||
{{- else -}}
|
||||
{{ .Values.image }}:{{ .Values.imageTag }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "opentelemtry.envs" }}
|
||||
- name: OTEL_EXPORTER_OTLP_ENDPOINT
|
||||
value: "{{ .Values.openTelemetry.otlpCollectorEndpoint }}"
|
||||
- name: OTEL_EXPORTER_OTLP_INSECURE
|
||||
value: "{{ .Values.openTelemetry.otlpInsecure }}"
|
||||
{{- if .Values.openTelemetry.otlpHeaders }}
|
||||
- name: OTEL_EXPORTER_OTLP_HEADERS
|
||||
value: "{{ .Values.openTelemetry.otlpHeaders }}"
|
||||
{{- end }}
|
||||
- name: OTEL_TRACES_SAMPLER
|
||||
value: "{{ .Values.openTelemetry.tracesSampler }}"
|
||||
- name: OTEL_TRACES_SAMPLER_ARG
|
||||
value: "{{ .Values.openTelemetry.tracesSamplingRate }}"
|
||||
- name: OTEL_PROPAGATORS
|
||||
value: "{{ .Values.openTelemetry.propagators }}"
|
||||
{{- end }}
|
||||
|
||||
{{- define "opentracing.envs" }}
|
||||
- name: OPENTRACING_ENABLED
|
||||
value: {{ .Values.openTracing.enabled | default false | quote }}
|
||||
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||
value: "{{ .Values.openTracing.collectorEndpoint }}"
|
||||
- name: TRACING_SAMPLING_RATE
|
||||
value: {{ .Values.openTracing.samplingRate | default "0.5" | quote }}
|
||||
{{- end }}
|
||||
@@ -49,9 +49,114 @@ rules:
|
||||
resources:
|
||||
- packages
|
||||
verbs:
|
||||
- '*'
|
||||
- apiGroups:
|
||||
- rbac.authorization.k8s.io
|
||||
resources:
|
||||
- rolebindings
|
||||
verbs:
|
||||
- '*'
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: fission-cr-admin
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- configmaps
|
||||
- pods
|
||||
- secrets
|
||||
- services
|
||||
- serviceaccounts
|
||||
- namespaces
|
||||
- events
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- watch
|
||||
- list
|
||||
- watch
|
||||
- patch
|
||||
- apiGroups:
|
||||
- apps
|
||||
resources:
|
||||
- deployments
|
||||
- deployments/scale
|
||||
- replicasets
|
||||
verbs:
|
||||
- '*'
|
||||
- apiGroups:
|
||||
- apiextensions.k8s.io
|
||||
resources:
|
||||
- customresourcedefinitions
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- patch
|
||||
- apiGroups:
|
||||
- fission.io
|
||||
resources:
|
||||
- canaryconfigs
|
||||
- environments
|
||||
- functions
|
||||
- httptriggers
|
||||
- kuberneteswatchtriggers
|
||||
- messagequeuetriggers
|
||||
- packages
|
||||
- timetriggers
|
||||
verbs:
|
||||
- '*'
|
||||
- apiGroups:
|
||||
- autoscaling
|
||||
resources:
|
||||
- horizontalpodautoscalers
|
||||
verbs:
|
||||
- '*'
|
||||
- apiGroups:
|
||||
- rbac.authorization.k8s.io
|
||||
resources:
|
||||
- rolebindings
|
||||
verbs:
|
||||
- '*'
|
||||
- apiGroups: ["rbac.authorization.k8s.io"]
|
||||
resources: ["clusterroles"]
|
||||
verbs: ["bind"]
|
||||
- apiGroups:
|
||||
- keda.sh
|
||||
resources:
|
||||
- scaledjobs
|
||||
- scaledobjects
|
||||
- scaledjobs/finalizers
|
||||
- scaledjobs/status
|
||||
- triggerauthentications
|
||||
- triggerauthentications/status
|
||||
verbs:
|
||||
- '*'
|
||||
- apiGroups:
|
||||
- keda.k8s.io
|
||||
resources:
|
||||
- scaledjobs
|
||||
- scaledobjects
|
||||
- scaledjobs/finalizers
|
||||
- scaledjobs/status
|
||||
- triggerauthentications
|
||||
- triggerauthentications/status
|
||||
verbs:
|
||||
- '*'
|
||||
- apiGroups:
|
||||
- metrics.k8s.io
|
||||
resources:
|
||||
- pods
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
@@ -86,7 +191,7 @@ subjects:
|
||||
namespace: {{ .Release.Namespace }}
|
||||
roleRef:
|
||||
kind: ClusterRole
|
||||
name: cluster-admin
|
||||
name: fission-cr-admin
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
|
||||
---
|
||||
@@ -95,6 +200,59 @@ kind: ServiceAccount
|
||||
metadata:
|
||||
name: fission-fetcher
|
||||
namespace: {{ .Values.functionNamespace }}
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: fission-fetcher
|
||||
namespace: default
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- configmaps
|
||||
- secrets
|
||||
- pods
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- events
|
||||
verbs:
|
||||
- '*'
|
||||
- apiGroups:
|
||||
- fission.io
|
||||
resources:
|
||||
- canaryconfigs
|
||||
- environments
|
||||
- functions
|
||||
- httptriggers
|
||||
- kuberneteswatchtriggers
|
||||
- messagequeuetriggers
|
||||
- packages
|
||||
- timetriggers
|
||||
verbs:
|
||||
- '*'
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: fission-fetcher
|
||||
namespace: default
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: fission-fetcher
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: fission-fetcher
|
||||
namespace: {{ .Values.functionNamespace }}
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
@@ -102,6 +260,42 @@ metadata:
|
||||
name: fission-builder
|
||||
namespace: {{ .Values.builderNamespace }}
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: fission-builder
|
||||
namespace: default
|
||||
rules:
|
||||
- apiGroups:
|
||||
- fission.io
|
||||
resources:
|
||||
- canaryconfigs
|
||||
- environments
|
||||
- functions
|
||||
- httptriggers
|
||||
- kuberneteswatchtriggers
|
||||
- messagequeuetriggers
|
||||
- packages
|
||||
- timetriggers
|
||||
verbs:
|
||||
- '*'
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: fission-builder
|
||||
namespace: default
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: fission-builder
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: fission-builder
|
||||
namespace: {{ .Values.builderNamespace }}
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
@@ -141,16 +335,16 @@ spec:
|
||||
env:
|
||||
- name: FISSION_FUNCTION_NAMESPACE
|
||||
value: "{{ .Values.functionNamespace }}"
|
||||
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||
- name: TRACING_SAMPLING_RATE
|
||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
||||
- name: DEBUG_ENV
|
||||
value: {{ .Values.debugEnv | quote }}
|
||||
- name: PPROF_ENABLED
|
||||
value: {{ .Values.pprof.enabled | quote }}
|
||||
- name: POD_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
{{- include "opentracing.envs" . | indent 8 }}
|
||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: "/healthz"
|
||||
@@ -171,6 +365,10 @@ spec:
|
||||
ports:
|
||||
- containerPort: 8888
|
||||
name: http
|
||||
{{- if .Values.pprof.enabled }}
|
||||
- containerPort: 6060
|
||||
name: pprof
|
||||
{{- end }}
|
||||
serviceAccountName: fission-svc
|
||||
volumes:
|
||||
- name: config-volume
|
||||
@@ -210,19 +408,21 @@ spec:
|
||||
args: ["--executorPort", "8888", "--namespace", "{{ .Values.functionNamespace }}"]
|
||||
env:
|
||||
- name: FETCHER_IMAGE
|
||||
{{- if eq .Values.fetcher.imageTag "" }}
|
||||
value: "{{ .Values.fetcher.image }}"
|
||||
{{- else }}
|
||||
value: "{{ .Values.fetcher.image }}:{{ .Values.fetcher.imageTag }}"
|
||||
{{- end }}
|
||||
- name: FETCHER_IMAGE_PULL_POLICY
|
||||
value: "{{ .Values.pullPolicy }}"
|
||||
- name: RUNTIME_IMAGE_PULL_POLICY
|
||||
value: "{{ .Values.pullPolicy }}"
|
||||
- name: ADOPT_EXISTING_RESOURCES
|
||||
value: {{ .Values.executor.adoptExistingResources | default false | quote }}
|
||||
- name: POD_READY_TIMEOUT
|
||||
value: {{ .Values.executor.podReadyTimeout | default false | quote }}
|
||||
- name: ENABLE_ISTIO
|
||||
value: "{{ .Values.enableIstio }}"
|
||||
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||
- name: TRACING_SAMPLING_RATE
|
||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
||||
- name: FETCHER_MINCPU
|
||||
value: {{ .Values.fetcher.resource.cpu.requests | quote }}
|
||||
- name: FETCHER_MINMEM
|
||||
@@ -233,6 +433,10 @@ spec:
|
||||
value: {{ .Values.fetcher.resource.mem.limits | quote }}
|
||||
- name: DEBUG_ENV
|
||||
value: {{ .Values.debugEnv | quote }}
|
||||
- name: PPROF_ENABLED
|
||||
value: {{ .Values.pprof.enabled | quote }}
|
||||
{{- include "opentracing.envs" . | indent 8 }}
|
||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: "/healthz"
|
||||
@@ -251,6 +455,10 @@ spec:
|
||||
name: metrics
|
||||
- containerPort: 8888
|
||||
name: http
|
||||
{{- if .Values.pprof.enabled }}
|
||||
- containerPort: 6060
|
||||
name: pprof
|
||||
{{- end }}
|
||||
serviceAccountName: fission-svc
|
||||
{{- if .Values.extraCoreComponentPodConfig }}
|
||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||
@@ -282,17 +490,17 @@ spec:
|
||||
args: ["--builderMgr", "--storageSvcUrl", "http://storagesvc.{{ .Release.Namespace }}", "--envbuilder-namespace", "{{ .Values.builderNamespace }}"]
|
||||
env:
|
||||
- name: FETCHER_IMAGE
|
||||
{{- if eq .Values.fetcher.imageTag "" }}
|
||||
value: "{{ .Values.fetcher.image }}"
|
||||
{{- else }}
|
||||
value: "{{ .Values.fetcher.image }}:{{ .Values.fetcher.imageTag }}"
|
||||
{{- end }}
|
||||
- name: FETCHER_IMAGE_PULL_POLICY
|
||||
value: "{{ .Values.pullPolicy }}"
|
||||
- name: BUILDER_IMAGE_PULL_POLICY
|
||||
value: "{{ .Values.pullPolicy }}"
|
||||
- name: ENABLE_ISTIO
|
||||
value: "{{ .Values.enableIstio }}"
|
||||
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||
- name: TRACING_SAMPLING_RATE
|
||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
||||
- name: FETCHER_MINCPU
|
||||
value: {{ .Values.fetcher.resource.cpu.requests | quote }}
|
||||
- name: FETCHER_MINMEM
|
||||
@@ -303,6 +511,10 @@ spec:
|
||||
value: {{ .Values.fetcher.resource.mem.limits | quote }}
|
||||
- name: DEBUG_ENV
|
||||
value: {{ .Values.debugEnv | quote }}
|
||||
- name: PPROF_ENABLED
|
||||
value: {{ .Values.pprof.enabled | quote }}
|
||||
{{- include "opentracing.envs" . | indent 8 }}
|
||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||
serviceAccountName: fission-svc
|
||||
{{- if .Values.extraCoreComponentPodConfig }}
|
||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||
@@ -333,17 +545,17 @@ spec:
|
||||
command: ["/fission-bundle"]
|
||||
args: ["--kubewatcher", "--routerUrl", "http://router.{{ .Release.Namespace }}"]
|
||||
env:
|
||||
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||
- name: TRACING_SAMPLING_RATE
|
||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
||||
- name: DEBUG_ENV
|
||||
value: {{ .Values.debugEnv | quote }}
|
||||
- name: PPROF_ENABLED
|
||||
value: {{ .Values.pprof.enabled | quote }}
|
||||
{{- include "opentracing.envs" . | indent 8 }}
|
||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||
serviceAccountName: fission-svc
|
||||
{{- if .Values.extraCoreComponentPodConfig }}
|
||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||
{{- end }}
|
||||
|
||||
{{- if .Values.influxdb.enabled }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
@@ -380,17 +592,17 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- name: influxdb
|
||||
image: fission/influxdb
|
||||
image: {{ .Values.influxdb.image | quote }}
|
||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||
env:
|
||||
- name: PRE_CREATE_DB
|
||||
- name: INFLUXDB_DB
|
||||
value: fissionFunctionLog
|
||||
- name: ADMIN_USER
|
||||
- name: INFLUXDB_ADMIN_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: influxdb
|
||||
key: username
|
||||
- name: INFLUXDB_INIT_PWD
|
||||
- name: INFLUXDB_ADMIN_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: influxdb
|
||||
@@ -398,7 +610,7 @@ spec:
|
||||
{{- if .Values.extraCoreComponentPodConfig }}
|
||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||
{{- end }}
|
||||
|
||||
{{- end }}
|
||||
{{- if .Values.heapster }}
|
||||
---
|
||||
apiVersion: v1
|
||||
@@ -412,7 +624,7 @@ metadata:
|
||||
kubernetes.io/cluster-service: 'true'
|
||||
kubernetes.io/name: heapster
|
||||
spec:
|
||||
type: ClusterIP
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 8082
|
||||
@@ -441,7 +653,7 @@ spec:
|
||||
- name: heapster
|
||||
image: gcr.io/google_containers/heapster-amd64:v1.5.0
|
||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||
command:
|
||||
command:
|
||||
- /heapster
|
||||
- --source=kubernetes:https://kubernetes.default
|
||||
serviceAccountName: {{ .Release.Namespace }}/fission-svc
|
||||
@@ -473,6 +685,10 @@ spec:
|
||||
env:
|
||||
- name: DEBUG_ENV
|
||||
value: {{ .Values.debugEnv | quote }}
|
||||
- name: PPROF_ENABLED
|
||||
value: {{ .Values.pprof.enabled | quote }}
|
||||
{{- include "opentracing.envs" . | indent 8 }}
|
||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||
serviceAccountName: fission-svc
|
||||
{{- if .Values.extraCoreComponentPodConfig }}
|
||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||
@@ -507,6 +723,13 @@ spec:
|
||||
# serviceAccountName: fission-svc
|
||||
|
||||
{{- if .Values.nats.enabled }}
|
||||
{{- if not .Values.nats.external }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: fission-nats-streaming
|
||||
namespace: {{ .Release.Namespace }}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
@@ -524,9 +747,10 @@ spec:
|
||||
labels:
|
||||
svc: nats-streaming
|
||||
spec:
|
||||
serviceAccount: fission-nats-streaming
|
||||
containers:
|
||||
- name: nats-streaming
|
||||
image: nats-streaming
|
||||
image: {{ .Values.nats.streamingserver.image | quote }}
|
||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||
args: [
|
||||
"--cluster_id", "{{ .Values.nats.clusterID }}",
|
||||
@@ -555,6 +779,7 @@ spec:
|
||||
{{- if .Values.extraCoreComponentPodConfig }}
|
||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
@@ -585,14 +810,24 @@ spec:
|
||||
env:
|
||||
- name: MESSAGE_QUEUE_TYPE
|
||||
value: nats-streaming
|
||||
- name: MESSAGE_QUEUE_CLUSTER_ID
|
||||
value: {{ .Values.nats.clusterID }}
|
||||
- name: MESSAGE_QUEUE_QUEUE_GROUP
|
||||
value: {{ .Values.nats.queueGroup }}
|
||||
- name: MESSAGE_QUEUE_CLIENT_ID
|
||||
value: {{ .Values.nats.clientID }}
|
||||
- name: MESSAGE_QUEUE_URL
|
||||
value: nats://{{ .Values.nats.authToken }}@nats-streaming:4222
|
||||
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||
- name: TRACING_SAMPLING_RATE
|
||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
||||
{{- if .Values.nats.authToken }}
|
||||
value: nats://{{ .Values.nats.authToken }}@{{ .Values.nats.hostaddress }}
|
||||
{{- else }}
|
||||
value: nats://{{ .Values.nats.hostaddress }}
|
||||
{{- end }}
|
||||
- name: DEBUG_ENV
|
||||
value: {{ .Values.debugEnv | quote }}
|
||||
- name: PPROF_ENABLED
|
||||
value: {{ .Values.pprof.enabled | quote }}
|
||||
{{- include "opentracing.envs" . | indent 8 }}
|
||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||
serviceAccountName: fission-svc
|
||||
{{- if .Values.extraCoreComponentPodConfig }}
|
||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||
@@ -623,7 +858,11 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- name: mqtrigger
|
||||
{{- if eq .Values.imageTag "" }}
|
||||
image: "{{ .Values.image }}"
|
||||
{{- else }}
|
||||
image: "{{ .Values.image }}:{{ .Values.imageTag }}"
|
||||
{{- end }}
|
||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||
command: ["/fission-bundle"]
|
||||
args: ["--mqt", "--routerUrl", "http://router.{{ .Release.Namespace }}"]
|
||||
@@ -634,23 +873,25 @@ spec:
|
||||
value: "{{.Values.kafka.brokers}}"
|
||||
- name: MESSAGE_QUEUE_KAFKA_VERSION
|
||||
value: "{{.Values.kafka.version}}"
|
||||
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||
- name: TRACING_SAMPLING_RATE
|
||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
||||
- name: DEBUG_ENV
|
||||
value: {{ .Values.debugEnv | quote }}
|
||||
- name: PPROF_ENABLED
|
||||
value: {{ .Values.pprof.enabled | quote }}
|
||||
{{- include "opentracing.envs" . | indent 8 }}
|
||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||
# TLS authentication is TLS with authentication (2 way)
|
||||
# More info: https://docs.confluent.io/current/kafka/authentication_ssl.html#ssl-overview
|
||||
{{- if .Values.kafka.authentication.tls.enabled }}
|
||||
- name: TLS_ENABLED
|
||||
value: "true"
|
||||
- name: MESSAGE_QUEUE_SECRETS
|
||||
value: /etc/fission/secrets
|
||||
value: /etc/fission/secrets
|
||||
- name: INSECURE_SKIP_VERIFY
|
||||
value: "{{ .Values.kafka.authentication.tls.insecureSkipVerify }}"
|
||||
volumeMounts:
|
||||
- name: kafka-secrets
|
||||
mountPath: /etc/fission/secrets
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
serviceAccountName: fission-svc
|
||||
{{- if .Values.kafka.authentication.tls.enabled }}
|
||||
volumes:
|
||||
@@ -663,7 +904,7 @@ spec:
|
||||
{{- if .Values.kafka.authentication.tls.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
metadata:
|
||||
name: mqtrigger-kafka-secrets
|
||||
labels:
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
@@ -713,15 +954,15 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- name: mqtrigger
|
||||
{{- if eq .Values.imageTag "" }}
|
||||
image: "{{ .Values.image }}"
|
||||
{{- else }}
|
||||
image: "{{ .Values.image }}:{{ .Values.imageTag }}"
|
||||
{{- end }}
|
||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||
command: ["/fission-bundle"]
|
||||
args: ["--mqt", "--routerUrl", "http://router.{{ .Release.Namespace }}"]
|
||||
env:
|
||||
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||
- name: TRACING_SAMPLING_RATE
|
||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
||||
- name: MESSAGE_QUEUE_TYPE
|
||||
value: azure-storage-queue
|
||||
- name: AZURE_STORAGE_ACCOUNT_NAME
|
||||
@@ -733,6 +974,10 @@ spec:
|
||||
key: key
|
||||
- name: DEBUG_ENV
|
||||
value: {{ .Values.debugEnv | quote }}
|
||||
- name: PPROF_ENABLED
|
||||
value: {{ .Values.pprof.enabled | quote }}
|
||||
{{- include "opentracing.envs" . | indent 8 }}
|
||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||
serviceAccountName: fission-svc
|
||||
{{- if .Values.extraCoreComponentPodConfig }}
|
||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||
@@ -764,19 +1009,39 @@ spec:
|
||||
image: {{ include "fission-bundleImage" . | quote }}
|
||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||
command: ["/fission-bundle"]
|
||||
args: ["--storageServicePort", "8000", "--filePath", "/fission"]
|
||||
{{- if and (.Values.persistence.enabled) (eq (.Values.persistence.storageType | default "local") "s3") }}
|
||||
args: ["--storageServicePort", "8000", "--storageType", "s3"]
|
||||
{{- else }}
|
||||
args: ["--storageServicePort", "8000", "--storageType", "local"]
|
||||
{{- end }}
|
||||
env:
|
||||
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||
- name: TRACING_SAMPLING_RATE
|
||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
||||
- name: PRUNE_INTERVAL
|
||||
value: "{{.Values.pruneInterval}}"
|
||||
- name: DEBUG_ENV
|
||||
value: {{ .Values.debugEnv | quote }}
|
||||
- name: PPROF_ENABLED
|
||||
value: {{ .Values.pprof.enabled | quote }}
|
||||
{{- if and (.Values.persistence.enabled) (eq (.Values.persistence.storageType | default "local") "s3") }}
|
||||
- name: STORAGE_S3_ENDPOINT
|
||||
value: {{ .Values.persistence.s3.endPoint }}
|
||||
- name: STORAGE_S3_BUCKET_NAME
|
||||
value: {{ .Values.persistence.s3.bucketName }}
|
||||
- name: STORAGE_S3_SUB_DIR
|
||||
value: {{ .Values.persistence.s3.subDir }}
|
||||
- name: STORAGE_S3_ACCESS_KEY_ID
|
||||
value: {{ .Values.persistence.s3.accessKeyId }}
|
||||
- name: STORAGE_S3_SECRET_ACCESS_KEY
|
||||
value: {{ .Values.persistence.s3.secretAccessKey }}
|
||||
- name: STORAGE_S3_REGION
|
||||
value: {{ .Values.persistence.s3.region }}
|
||||
{{- end }}
|
||||
{{- include "opentracing.envs" . | indent 8 }}
|
||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||
{{- if ne (.Values.persistence.storageType | default "local") "s3" }}
|
||||
volumeMounts:
|
||||
- name: fission-storage
|
||||
mountPath: /fission
|
||||
{{- end }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: "/healthz"
|
||||
@@ -793,15 +1058,104 @@ spec:
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
name: http
|
||||
{{- if .Values.pprof.enabled }}
|
||||
- containerPort: 6060
|
||||
name: pprof
|
||||
{{- end }}
|
||||
serviceAccountName: fission-svc
|
||||
{{- if and (.Values.persistence.enabled) (ne (.Values.persistence.storageType | default "local") "s3") }}
|
||||
volumes:
|
||||
- name: fission-storage
|
||||
{{- if .Values.persistence.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Values.persistence.existingClaim | default "fission-storage-pvc" }}
|
||||
{{- else }}
|
||||
volumes:
|
||||
- name: fission-storage
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- if .Values.extraCoreComponentPodConfig }}
|
||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||
{{- end }}
|
||||
|
||||
{{- if .Values.mqt_keda.enabled }}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mqtrigger-keda
|
||||
labels:
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
svc: mqtrigger-keda
|
||||
messagequeue: keda
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
svc: mqtrigger-keda
|
||||
messagequeue: keda
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
svc: mqtrigger-keda
|
||||
messagequeue: keda
|
||||
spec:
|
||||
containers:
|
||||
- name: mqtrigger-keda
|
||||
image: {{ include "fission-bundleImage" . | quote }}
|
||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||
command: ["/fission-bundle"]
|
||||
args: ["--mqt_keda", "--routerUrl", "http://router.{{ .Release.Namespace }}"]
|
||||
env:
|
||||
- name: DEBUG_ENV
|
||||
value: {{ .Values.debugEnv | quote }}
|
||||
- name: CONNECTOR_IMAGE_PULL_POLICY
|
||||
value: "{{ .Values.pullPolicy }}"
|
||||
- name: KAFKA_IMAGE
|
||||
value: "{{ .Values.mqt_keda.connector_images.kafka.image }}:{{ .Values.mqt_keda.connector_images.kafka.tag }}"
|
||||
- name: RABBITMQ_IMAGE
|
||||
value: "{{ .Values.mqt_keda.connector_images.rabbitmq.image }}:{{ .Values.mqt_keda.connector_images.rabbitmq.tag }}"
|
||||
- name: AWS-KINESIS-STREAM_IMAGE
|
||||
value: "{{ .Values.mqt_keda.connector_images.awskinesis.image }}:{{ .Values.mqt_keda.connector_images.awskinesis.tag }}"
|
||||
- name: AWS-SQS-QUEUE_IMAGE
|
||||
value: "{{ .Values.mqt_keda.connector_images.aws_sqs.image }}:{{ .Values.mqt_keda.connector_images.aws_sqs.tag }}"
|
||||
- name: STAN_IMAGE
|
||||
value: "{{ .Values.mqt_keda.connector_images.nats_steaming.image }}:{{ .Values.mqt_keda.connector_images.nats_steaming.tag }}"
|
||||
- name: GCP-PUB-SUB_IMAGE
|
||||
value: "{{ .Values.mqt_keda.connector_images.gcp_pub_sub.image }}:{{ .Values.mqt_keda.connector_images.gcp_pub_sub.tag }}"
|
||||
- name: REDIS_IMAGE
|
||||
value: "{{ .Values.mqt_keda.connector_images.redis.image }}:{{ .Values.mqt_keda.connector_images.redis.tag }}"
|
||||
{{- include "opentracing.envs" . | indent 8 }}
|
||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||
serviceAccountName: fission-svc
|
||||
{{- if .Values.extraCoreComponentPodConfig }}
|
||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
namespace: {{ .Values.functionNamespace }}
|
||||
name: event-fetcher
|
||||
rules:
|
||||
- apiGroups: [""] # "" indicates the core API group
|
||||
resources: ["pods"]
|
||||
verbs: ["get", "watch", "list"]
|
||||
- apiGroups: [""] # "" indicates the core API group
|
||||
resources: ["events"]
|
||||
verbs: ["*"]
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: fission-fetcher-pod-reader
|
||||
namespace: {{ .Values.functionNamespace }}
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: event-fetcher
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: fission-fetcher
|
||||
namespace: {{ .Values.functionNamespace }}
|
||||
|
||||
@@ -19,6 +19,64 @@ data:
|
||||
{{ else }}
|
||||
{{ fail "invalid chart" }}
|
||||
{{- end }}
|
||||
{{- if .Values.logger.podSecurityPolicy.enabled }}
|
||||
---
|
||||
apiVersion: policy/v1beta1
|
||||
kind: PodSecurityPolicy
|
||||
metadata:
|
||||
name: {{ .Release.Name }}-fission-logger-privileged
|
||||
labels:
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
svc: logger
|
||||
spec:
|
||||
privileged: true
|
||||
seLinux:
|
||||
rule: RunAsAny
|
||||
supplementalGroups:
|
||||
rule: RunAsAny
|
||||
runAsUser:
|
||||
rule: RunAsAny
|
||||
fsGroup:
|
||||
rule: RunAsAny
|
||||
volumes:
|
||||
- '*'
|
||||
{{- if .Values.logger.podSecurityPolicy.additionalCapabilities }}
|
||||
allowedCapabilities:
|
||||
{{- range .Values.logger.podSecurityPolicy.additionalCapabilities }}
|
||||
- {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: psp:{{ .Release.Name }}-fission-logger-privileged
|
||||
labels:
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
svc: logger
|
||||
rules:
|
||||
- apiGroups: ['policy']
|
||||
resources: ['podsecuritypolicies']
|
||||
verbs: ['use']
|
||||
resourceNames:
|
||||
- {{ .Release.Name }}-fission-logger-privileged
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: psp:{{ .Release.Name }}-fission-logger-privileged
|
||||
labels:
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
svc: logger
|
||||
roleRef:
|
||||
kind: Role
|
||||
name: psp:{{ .Release.Name }}-fission-logger-privileged
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: default
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- end }}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
@@ -38,7 +96,7 @@ spec:
|
||||
spec:
|
||||
initContainers:
|
||||
- name: init
|
||||
image: busybox
|
||||
image: {{ .Values.busyboxImage | quote }}
|
||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||
command: ['mkdir', '-p', '/var/log/fission']
|
||||
volumeMounts:
|
||||
@@ -51,11 +109,7 @@ spec:
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: logger
|
||||
{{ if .Values.repository }}
|
||||
image: "{{ .Values.repository }}/{{ .Values.image }}:{{ .Values.imageTag }}"
|
||||
{{ else }}
|
||||
image: "{{ .Values.image }}:{{ .Values.imageTag }}"
|
||||
{{ end }}
|
||||
image: {{ include "fission-bundleImage" . | quote }}
|
||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||
env:
|
||||
- name: NODE_NAME
|
||||
@@ -63,6 +117,8 @@ spec:
|
||||
fieldRef:
|
||||
apiVersion: v1
|
||||
fieldPath: spec.nodeName
|
||||
- name: OPENTRACING_ENABLED
|
||||
value: {{ .Values.openTracing.enabled | default false | quote }}
|
||||
command: ["/fission-bundle"]
|
||||
args: ["--logger"]
|
||||
volumeMounts:
|
||||
@@ -104,6 +160,8 @@ spec:
|
||||
key: password
|
||||
- name: LOG_PATH
|
||||
value: /var/log/fission/*.log
|
||||
- name: OPENTRACING_ENABLED
|
||||
value: {{ .Values.openTracing.enabled | default false | quote }}
|
||||
{{- if .Values.logger.enableSecurityContext }}
|
||||
securityContext:
|
||||
privileged: true
|
||||
|
||||
@@ -26,7 +26,16 @@ spec:
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: post-install-job
|
||||
image: "fission/alpinecurl"
|
||||
{{- if .Values.imageTag }}
|
||||
image: {{ .Values.postInstallReportImage }}:{{ .Values.imageTag }}
|
||||
{{- else }}
|
||||
image: {{ .Values.postInstallReportImage }}
|
||||
{{- end }}
|
||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||
command: ["sh", "-c", "/usr/bin/curl -m 5 -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"yaml-post-install\", \"chartName\": \"{{ .Chart.Name }}\", \"chartVersion\": \"{{ .Chart.Version }}\"}' https://g.fission.io/analytics || true"]
|
||||
command: [ "/reporter" ]
|
||||
args: ["event", "-c", "fission-use", "-a", "yaml-post-install", "-l", "{{ .Chart.Name }}-{{ .Chart.Version }}"]
|
||||
env:
|
||||
- name: GA_TRACKING_ID
|
||||
value: "{{ .Values.gaTrackingID }}"
|
||||
serviceAccountName: fission-svc
|
||||
{{- end }}
|
||||
|
||||
@@ -30,7 +30,16 @@ spec:
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: post-install-job
|
||||
image: "fission/alpinecurl"
|
||||
{{- if .Values.imageTag }}
|
||||
image: {{ .Values.postInstallReportImage }}:{{ .Values.imageTag }}
|
||||
{{- else }}
|
||||
image: {{ .Values.postInstallReportImage }}
|
||||
{{- end }}
|
||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||
command: ["sh", "-c", "/usr/bin/curl -m 5 -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"helm-post-install\", \"chartName\": \"{{ .Chart.Name }}\", \"chartVersion\": \"{{ .Chart.Version }}\"}' https://g.fission.io/analytics || true"]
|
||||
command: [ "/reporter" ]
|
||||
args: ["event", "-c", "fission-use", "-a", "helm-post-install", "-l", "{{ .Chart.Name }}-{{ .Chart.Version }}"]
|
||||
env:
|
||||
- name: GA_TRACKING_ID
|
||||
value: "{{ .Values.gaTrackingID }}"
|
||||
serviceAccountName: fission-svc
|
||||
{{- end }}
|
||||
|
||||
@@ -30,7 +30,16 @@ spec:
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: post-upgrade-job
|
||||
image: "fission/alpinecurl"
|
||||
{{- if .Values.imageTag }}
|
||||
image: {{ .Values.postInstallReportImage }}:{{ .Values.imageTag }}
|
||||
{{- else }}
|
||||
image: {{ .Values.postInstallReportImage }}
|
||||
{{- end }}
|
||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||
command: ["sh", "-c", "/usr/bin/curl -m 5 -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"helm-post-upgrade\", \"chartName\": \"{{ .Chart.Name }}\", \"chartVersion\": \"{{ .Chart.Version }}\"}' https://g.fission.io/analytics || true"]
|
||||
command: [ "/reporter" ]
|
||||
args: ["event", "-c", "fission-use", "-a", "helm-post-upgrade", "-l", "{{ .Chart.Name }}-{{ .Chart.Version }}"]
|
||||
env:
|
||||
- name: GA_TRACKING_ID
|
||||
value: "{{ .Values.gaTrackingID }}"
|
||||
serviceAccountName: fission-svc
|
||||
{{- end }}
|
||||
|
||||
@@ -26,7 +26,11 @@ spec:
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: pre-upgrade-job
|
||||
{{- if .Values.imageTag }}
|
||||
image: {{ .Values.preUpgradeChecksImage }}:{{ .Values.imageTag }}
|
||||
{{- else }}
|
||||
image: {{ .Values.preUpgradeChecksImage }}
|
||||
{{- end }}
|
||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||
command: [ "/pre-upgrade-checks" ]
|
||||
args: ["--fn-pod-namespace", "{{ .Values.functionNamespace }}", "--envbuilder-namespace", "{{ .Values.builderNamespace }}"]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
|
||||
{{- if and (.Values.persistence.enabled) (not .Values.persistence.existingClaim) (eq (.Values.persistence.storageType | default "local") "local") }}
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
|
||||
@@ -35,41 +35,38 @@ spec:
|
||||
command: ["/fission-bundle"]
|
||||
args: ["--routerPort", "8888", "--executorUrl", "http://executor.{{ .Release.Namespace }}"]
|
||||
env:
|
||||
- name: POD_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: ROUTER_ROUND_TRIP_TIMEOUT
|
||||
value: {{ .Values.router.roundTrip.timeout | default "50ms" | quote }}
|
||||
- name: ROUTER_ROUNDTRIP_TIMEOUT_EXPONENT
|
||||
value: {{ .Values.router.roundTrip.timeoutExponent | default 2 | quote }}
|
||||
- name: ROUTER_ROUND_TRIP_KEEP_ALIVE_TIME
|
||||
value: {{ .Values.router.roundTrip.keepAliveTime | default "30s" | quote }}
|
||||
- name: ROUTER_ROUND_TRIP_DISABLE_KEEP_ALIVE
|
||||
value: {{ .Values.router.roundTrip.disableKeepAlive | default true | quote }}
|
||||
- name: ROUTER_ROUND_TRIP_MAX_RETRIES
|
||||
value: {{ .Values.router.roundTrip.maxRetries | default 10 | quote }}
|
||||
- name: ROUTER_SVC_ADDRESS_MAX_RETRIES
|
||||
value: {{ .Values.router.svcAddressMaxRetries | default 5 | quote }}
|
||||
- name: ROUTER_SVC_ADDRESS_UPDATE_TIMEOUT
|
||||
value: {{ .Values.router.svcAddressUpdateTimeout | default "30s" | quote }}
|
||||
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||
- name: TRACING_SAMPLING_RATE
|
||||
value: {{ .Values.router.traceSamplingRate | default "0.5" | quote }}
|
||||
- name: USE_ENCODED_PATH
|
||||
value: {{ .Values.router.useEncodedPath | default false | quote }}
|
||||
- name: DEBUG_ENV
|
||||
value: {{ .Values.debugEnv | quote }}
|
||||
- name: DISPLAY_ACCESS_LOG
|
||||
value: {{ .Values.router.displayAccessLog | default false | quote }}
|
||||
{{- if .Values.analytics }}
|
||||
- name: ANALYTICS_URL
|
||||
value: "https://g.fission.io/metrics"
|
||||
{{- else if .Values.analyticsNonHelmInstall }}
|
||||
- name: ANALYTICS_URL
|
||||
value: "https://g.fission.io/metrics"
|
||||
{{- end }}
|
||||
- name: POD_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: ROUTER_ROUND_TRIP_TIMEOUT
|
||||
value: {{ .Values.router.roundTrip.timeout | default "50ms" | quote }}
|
||||
- name: ROUTER_ROUNDTRIP_TIMEOUT_EXPONENT
|
||||
value: {{ .Values.router.roundTrip.timeoutExponent | default 2 | quote }}
|
||||
- name: ROUTER_ROUND_TRIP_KEEP_ALIVE_TIME
|
||||
value: {{ .Values.router.roundTrip.keepAliveTime | default "30s" | quote }}
|
||||
- name: ROUTER_ROUND_TRIP_DISABLE_KEEP_ALIVE
|
||||
value: {{ .Values.router.roundTrip.disableKeepAlive | default true | quote }}
|
||||
- name: ROUTER_ROUND_TRIP_MAX_RETRIES
|
||||
value: {{ .Values.router.roundTrip.maxRetries | default 10 | quote }}
|
||||
- name: ROUTER_SVC_ADDRESS_MAX_RETRIES
|
||||
value: {{ .Values.router.svcAddressMaxRetries | default 5 | quote }}
|
||||
- name: ROUTER_SVC_ADDRESS_UPDATE_TIMEOUT
|
||||
value: {{ .Values.router.svcAddressUpdateTimeout | default "30s" | quote }}
|
||||
- name: ROUTER_UNTAP_SERVICE_TIMEOUT
|
||||
value: {{ .Values.router.unTapServiceTimeout | default "3600s" | quote }}
|
||||
- name: USE_ENCODED_PATH
|
||||
value: {{ .Values.router.useEncodedPath | default false | quote }}
|
||||
- name: DEBUG_ENV
|
||||
value: {{ .Values.debugEnv | quote }}
|
||||
- name: PPROF_ENABLED
|
||||
value: {{ .Values.pprof.enabled | quote }}
|
||||
- name: DISPLAY_ACCESS_LOG
|
||||
value: {{ .Values.router.displayAccessLog | default false | quote }}
|
||||
{{- include "opentracing.envs" . | indent 8 }}
|
||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||
resources:
|
||||
{{- toYaml .Values.router.resources | indent 10 }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: "/router-healthz"
|
||||
@@ -88,7 +85,15 @@ spec:
|
||||
name: metrics
|
||||
- containerPort: 8888
|
||||
name: http
|
||||
{{- if .Values.pprof.enabled }}
|
||||
- containerPort: 6060
|
||||
name: pprof
|
||||
{{- end }}
|
||||
serviceAccountName: fission-svc
|
||||
{{- if .Values.router.extraCoreComponentPodConfig }}
|
||||
{{ toYaml .Values.router.extraCoreComponentPodConfig | indent 6 -}}
|
||||
{{- else }}
|
||||
{{- if .Values.extraCoreComponentPodConfig }}
|
||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@@ -41,7 +41,7 @@ spec:
|
||||
selector:
|
||||
svc: controller
|
||||
|
||||
{{- if .Values.nats.enabled }}
|
||||
{{- if and .Values.nats.enabled (not .Values.nats.external) }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
|
||||
+188
-22
@@ -20,7 +20,7 @@ image: fission/fission-bundle
|
||||
pullPolicy: IfNotPresent
|
||||
|
||||
## Fission image version
|
||||
imageTag: 1.8.0
|
||||
imageTag: v1.15.0-rc1
|
||||
|
||||
## Port at which Fission controller service should be exposed
|
||||
controllerPort: 31313
|
||||
@@ -29,6 +29,7 @@ controllerPort: 31313
|
||||
routerPort: 31314
|
||||
|
||||
## Port at which NATS streaming service should be exposed
|
||||
## (only if nats enabled and not external)
|
||||
natsStreamingPort: 31316
|
||||
|
||||
## Set to false if you create the namespaces manually
|
||||
@@ -49,8 +50,8 @@ fetcher:
|
||||
## Fetcher repository
|
||||
image: fission/fetcher
|
||||
## Fetcher image version
|
||||
imageTag: 1.8.0
|
||||
|
||||
imageTag: v1.15.0-rc1
|
||||
|
||||
## Fetcher is only for to downloading or uploading archive.
|
||||
## Normally, you don't need to change the value here, unless necessary.
|
||||
resource:
|
||||
@@ -67,8 +68,8 @@ logger:
|
||||
influxdbAdmin: "admin"
|
||||
fluentdImageRepository: index.docker.io
|
||||
fluentdImage: fluent/fluent-bit
|
||||
fluentdImageTag: 1.0.4
|
||||
|
||||
fluentdImageTag: 1.5.1
|
||||
|
||||
## Fluent-bit writes/reads it’s own sqlite database to record a history of tracked
|
||||
## files and a state of offsets, this is very useful to resume a state if the ser-
|
||||
## vice is restarted. For Kubernetes environment with constraints like OpenShift,
|
||||
@@ -76,29 +77,41 @@ logger:
|
||||
## security context and set privileged to true.
|
||||
enableSecurityContext: false
|
||||
|
||||
## Enable PodSecurityPolicies to allow privileged container
|
||||
## Only required in some clusters and when enableSecurityContext is true
|
||||
podSecurityPolicy:
|
||||
enabled: false
|
||||
|
||||
## Configure additional capabilities
|
||||
additionalCapabilities:
|
||||
# example values for linkerd
|
||||
#- NET_RAW
|
||||
#- NET_ADMIN
|
||||
|
||||
executor:
|
||||
adoptExistingResources: false
|
||||
podReadyTimeout: 300s
|
||||
|
||||
## Router config
|
||||
router:
|
||||
deployAsDaemonSet: false
|
||||
svcAddressMaxRetries: 5
|
||||
svcAddressUpdateTimeout: 30s
|
||||
|
||||
unTapServiceTimeout: 3600s
|
||||
## Display endpoint access logs
|
||||
## To be aware of enabling logging endpoint access log, it increases
|
||||
## router resource utilization when under heavy workloads.
|
||||
displayAccessLog: false
|
||||
|
||||
|
||||
## Add annotations for router
|
||||
# svcAnnotations:
|
||||
# cloud.google.com/load-balancer-type: Internal
|
||||
|
||||
|
||||
## For router to match encoded path.
|
||||
## If true, "/foo%2Fbar" will match the path "/{var}";
|
||||
## Otherwise, it will match the path "/foo/bar".
|
||||
useEncodedPath: false
|
||||
|
||||
|
||||
roundTrip:
|
||||
## If true, router will disable the HTTP keep-alive which result in performance degradation.
|
||||
## But it ensures that router can redirect new coming requests to new function pods.
|
||||
@@ -128,31 +141,83 @@ router:
|
||||
## Sample with a rate per time window (traces/second)
|
||||
traceSamplingRate: 0.5
|
||||
|
||||
## Extend the container specs for the core fission pods.
|
||||
## Can be used to add things like affinty/tolerations/nodeSelectors/etc.
|
||||
## For example:
|
||||
## extraCoreComponentPodConfig:
|
||||
## affinity:
|
||||
## nodeAffinity:
|
||||
## requiredDuringSchedulingIgnoredDuringExecution:
|
||||
## nodeSelectorTerms:
|
||||
## - matchExpressions:
|
||||
## - key: capability
|
||||
## operator: In
|
||||
## values:
|
||||
## - app
|
||||
#extraCoreComponentPodConfig:
|
||||
# affinity:
|
||||
# tolerations:
|
||||
# nodeSelector:
|
||||
|
||||
# Pod resources as:
|
||||
# resources:
|
||||
# limits:
|
||||
# cpu: <tbd>
|
||||
# memory: <tbd>
|
||||
# requests:
|
||||
# cpu: <tbd>
|
||||
# memory: <tbd>
|
||||
resources: {}
|
||||
|
||||
## Message queue trigger config
|
||||
### NATS Streaming, enabled by default
|
||||
nats:
|
||||
# whether or not to use NATS
|
||||
enabled: true
|
||||
|
||||
# if true, don't install NATS, but
|
||||
external: false
|
||||
|
||||
# Address of NATS server (domain:port)
|
||||
# change from default for external NATS
|
||||
hostaddress: "nats-streaming:4222"
|
||||
|
||||
# Authorization token to use with NATS
|
||||
authToken: "defaultFissionAuthToken"
|
||||
|
||||
# NATS streaming clusterID
|
||||
clusterID: "fissionMQTrigger"
|
||||
|
||||
# Client name registered with NATS streaming
|
||||
clientID: "fission"
|
||||
|
||||
# Queue group registered with NATS streaming
|
||||
queueGroup: "fission-messageQueueNatsTrigger"
|
||||
|
||||
# The image to use for NATS streaming server
|
||||
streamingserver:
|
||||
image: nats-streaming
|
||||
|
||||
## Azure-storage-queue: enable and configure the details
|
||||
azureStorageQueue:
|
||||
enabled: false
|
||||
key: ""
|
||||
accountName: ""
|
||||
|
||||
|
||||
## Kafka: enable and configure the details
|
||||
kafka:
|
||||
enabled: false
|
||||
# note: below link is only for reference.
|
||||
# Please use the brokers link for your kafka here.
|
||||
brokers: 'broker.kafka:9092' # or your-bootstrap-server.kafka:9092/9093
|
||||
# note: below link is only for reference.
|
||||
# Please use the brokers link for your kafka here.
|
||||
brokers: "broker.kafka:9092" # or your-bootstrap-server.kafka:9092/9093
|
||||
authentication:
|
||||
tls:
|
||||
enabled: false
|
||||
caCert: '' # path to certificate containing public key of CA authority
|
||||
userCert: '' # path to certificate containing public key of the user signed by CA authority
|
||||
userKey: '' # path to private key of the user
|
||||
# InsecureSkipVerify controls whether a client verifies the server's certificate chain and host name.
|
||||
insecureSkipVerify: false # Warning: Setting this to true, makes TLS susceptible to man-in-the-middle attacks
|
||||
caCert: "" # path to certificate containing public key of CA authority
|
||||
userCert: "" # path to certificate containing public key of the user signed by CA authority
|
||||
userKey: "" # path to private key of the user
|
||||
|
||||
# brokers: 'my-broker.kafka:9092' # or my-bootstrap-server.kafka:9092/9093
|
||||
# Sample config for authentication
|
||||
@@ -173,11 +238,23 @@ kafka:
|
||||
|
||||
## Persist data to a persistent volume.
|
||||
persistence:
|
||||
## If true, fission will create/use a Persistent Volume Claim
|
||||
## If true, fission will create/use a Persistent Volume Claim unless storageType is set to s3
|
||||
## If false, use emptyDir
|
||||
##
|
||||
enabled: true
|
||||
|
||||
## Must be set to either local or S3.
|
||||
## If storateType is set(other than local), one of its backend configuration must be set as below.
|
||||
#storageType: local | s3
|
||||
|
||||
## Sample configruation for AWS s3 storage backend
|
||||
#s3:
|
||||
# bucketName: <awsBucketName>
|
||||
# subDir: <sub directory within a bucket>
|
||||
# accessKeyId: <awsAccessKeyId>
|
||||
# secretAccessKey: <awsSecretAccessKey>
|
||||
# region: <awsRegion>
|
||||
|
||||
## A manually managed Persistent Volume Claim name
|
||||
## Requires persistence.enabled: true
|
||||
## If defined, PVC must be created manually before volume will be bound
|
||||
@@ -195,7 +272,7 @@ persistence:
|
||||
accessMode: ReadWriteOnce
|
||||
size: 8Gi
|
||||
|
||||
## Extend the container specs for the core fission pods.
|
||||
## Extend the container specs for the core fission pods.
|
||||
## Can be used to add things like affinty/tolerations/nodeSelectors/etc.
|
||||
## For example:
|
||||
## extraCoreComponentPodConfig:
|
||||
@@ -220,9 +297,20 @@ analytics: true
|
||||
## Internally used for generating an analytics job for non-helm installs
|
||||
analyticsNonHelmInstall: false
|
||||
|
||||
## Google Analytics Tracking ID
|
||||
gaTrackingID: UA-196546703-1
|
||||
|
||||
## Enable Heapster only in clusters where heapster does not exist already
|
||||
heapster: false
|
||||
|
||||
## Enable InfluxDB
|
||||
influxdb:
|
||||
enabled: true
|
||||
image: influxdb:1.7
|
||||
|
||||
# Allow user to override busybox image used in fluent-bit init container
|
||||
busyboxImage: busybox
|
||||
|
||||
## Archive pruner is a garbage collector for archives on the fission storage service.
|
||||
## This interval configures the frequency at which it runs inside the storagesvc pod.
|
||||
## The value is in minutes.
|
||||
@@ -231,6 +319,9 @@ pruneInterval: 60
|
||||
## Fission pre-install/pre-upgrade checks live in this image
|
||||
preUpgradeChecksImage: fission/pre-upgrade-checks
|
||||
|
||||
## Fission ppost-install/post-upgrade reporting live in this image
|
||||
postInstallReportImage: fission/reporter
|
||||
|
||||
## if there are any pod specialization errors when a function is triggered and this flag is set to true, the error
|
||||
## summary is returned as part of http response
|
||||
debugEnv: false
|
||||
@@ -239,7 +330,7 @@ debugEnv: false
|
||||
prometheus:
|
||||
## set this flag to true if prometheus needs to be deployed along with fission
|
||||
enabled: true
|
||||
|
||||
|
||||
## If enabled is false, please assign the prometheus service URL
|
||||
## that is accessible by components.
|
||||
serviceEndpoint: ""
|
||||
@@ -248,6 +339,81 @@ prometheus:
|
||||
canaryDeployment:
|
||||
enabled: true
|
||||
|
||||
# Use these flags to enable opentracing, the variable is endpoint of Jaeger collector in the format shown below
|
||||
#traceCollectorEndpoint: "http://jaeger-collector.jaeger.svc:14268/api/traces?format=jaeger.thrift"
|
||||
#traceSamplingRate: 0.75
|
||||
# Use the following flags to enable OpenTracing.
|
||||
# Note: OpenTracing support will be removed in an upcoming release.
|
||||
# Please prefer using OpenTelemetry instead.
|
||||
openTracing:
|
||||
## set this flag to true if you wish to enable OpenTracing
|
||||
enabled: false
|
||||
|
||||
## if enabled is true, the variable is endpoint of Jaeger collector in the format shown below
|
||||
#collectorEndpoint: "http://jaeger-collector.jaeger.svc:14268/api/traces?format=jaeger.thrift"
|
||||
|
||||
## uniformly sample traces with the given probabilistic sampling rate
|
||||
#samplingRate: 0.75
|
||||
|
||||
# It is an alternate to OpenTracing.
|
||||
openTelemetry:
|
||||
# Use this flag to set the collector endpoint for OpenTelemetry.
|
||||
# The variable is endpoint of the collector in the format shown below.
|
||||
# otlpCollectorEndpoint: "otel-collector.observability.svc:4317"
|
||||
otlpCollectorEndpoint: ""
|
||||
# Set this flag to false if you are using secure endpoint for the collector.
|
||||
otlpInsecure: true
|
||||
# Key-value pairs to be used as headers associated with gRPC or HTTP requests
|
||||
# to the collector.
|
||||
# Eg. otlpHeaders: "key1=value1,key2=value2"
|
||||
otlpHeaders: ""
|
||||
# Supported samplers:
|
||||
# always_on - Sampler that always samples spans, regardless of the parent span's sampling decision.
|
||||
# always_off - Sampler that never samples spans, regardless of the parent span's sampling decision.
|
||||
# traceidratio - Sampler that samples probabalistically based on rate.
|
||||
# parentbased_always_on - (default if empty) Sampler that respects its parent span's sampling decision, but otherwise always samples.
|
||||
# parentbased_always_off - Sampler that respects its parent span's sampling decision, but otherwise never samples.
|
||||
# parentbased_traceidratio - Sampler that respects its parent span's sampling decision, but otherwise samples probabalistically based on rate.
|
||||
tracesSampler: "parentbased_traceidratio"
|
||||
# Each Sampler type defines its own expected input, if any.
|
||||
# Currently we get trace ratio for the case of,
|
||||
# 1. traceidratio
|
||||
# 2. parentbased_traceidratio
|
||||
# Sampling probability, a number in the [0..1] range, e.g. "0.1". Default is 0.1.
|
||||
tracesSamplingRate: "0.1"
|
||||
# Supported providers:
|
||||
# tracecontext - W3C Trace Context
|
||||
# baggage - W3C Baggage
|
||||
# b3 - B3 Single
|
||||
# b3multi - B3 Multi
|
||||
# jaeger - Jaeger uber-trace-id header
|
||||
# xray - AWS X-Ray (third party)
|
||||
# ottrace - OpenTracing Trace (third party)
|
||||
propagators: "tracecontext,baggage"
|
||||
|
||||
## Message Queue Trigger Kind, KEDA: enable and configuration
|
||||
mqt_keda:
|
||||
enabled: true
|
||||
connector_images:
|
||||
kafka:
|
||||
image: fission/keda-kafka-http-connector
|
||||
tag: v0.8
|
||||
rabbitmq:
|
||||
image: fission/keda-rabbitmq-http-connector
|
||||
tag: v0.8
|
||||
awskinesis:
|
||||
image: fission/keda-aws-kinesis-http-connector
|
||||
tag: v0.8
|
||||
aws_sqs:
|
||||
image: fission/keda-aws-sqs-http-connector
|
||||
tag: v0.8
|
||||
nats_steaming:
|
||||
image: fission/keda-nats-streaming-http-connector
|
||||
tag: v0.9
|
||||
gcp_pub_sub:
|
||||
image: fission/keda-gcp-pubsub-http-connector
|
||||
tag: v0.3
|
||||
redis:
|
||||
image: fission/keda-redis-http-connector
|
||||
tag: v0.1
|
||||
|
||||
## Enable Pprof based profiling
|
||||
pprof:
|
||||
enabled: false
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
dependencies:
|
||||
- name: prometheus
|
||||
repository: https://prometheus-community.github.io/helm-charts
|
||||
version: 13.2.1
|
||||
digest: sha256:136360a97bdc11f1933d75bab77728acc75dd9583257b973cb3336b6d136c9b6
|
||||
generated: "2021-05-31T21:04:26.076006+05:30"
|
||||
@@ -1,15 +1,21 @@
|
||||
apiVersion: v1
|
||||
apiVersion: v2
|
||||
name: fission-core
|
||||
version: 1.8.0
|
||||
version: v1.15.0-rc1
|
||||
description: Fission is a fast serverless framework for Kubernetes.
|
||||
keywords:
|
||||
- fission
|
||||
- serverless
|
||||
home: http://fission.io/
|
||||
home: https://fission.io/
|
||||
maintainers:
|
||||
- name: Soam Vasani
|
||||
email: soamvasani+1@gmail.com
|
||||
- name: Ta Ching Chen
|
||||
email: hello@tachingchen.com
|
||||
- name: Vishal Biyani
|
||||
email: vishal@infracloud.io
|
||||
- name: Sanket Sudake
|
||||
email: sanket@infracloud.io
|
||||
engine: gotpl
|
||||
appVersion: 1.8.0
|
||||
appVersion: v1.15.0-rc1
|
||||
type: application
|
||||
dependencies:
|
||||
- name: prometheus
|
||||
version: 13.2.1
|
||||
repository: https://prometheus-community.github.io/helm-charts
|
||||
condition: prometheus.enabled
|
||||
@@ -1,6 +0,0 @@
|
||||
dependencies:
|
||||
- name: prometheus
|
||||
repository: https://kubernetes-charts.storage.googleapis.com
|
||||
version: 9.3.1
|
||||
digest: sha256:89a63a5f01c08032106a94c59fc7a5929e449458bf5fd06d86c8b048ac628bf4
|
||||
generated: "2019-11-18T10:16:25.945208326Z"
|
||||
@@ -1,5 +0,0 @@
|
||||
dependencies:
|
||||
- name: prometheus
|
||||
version: 9.3.1
|
||||
repository: https://kubernetes-charts.storage.googleapis.com
|
||||
condition: prometheus.enabled
|
||||
@@ -1,13 +1,13 @@
|
||||
1. Install the client CLI.
|
||||
|
||||
Mac:
|
||||
$ curl -Lo fission https://github.com/fission/fission/releases/download/{{ .Chart.Version }}/fission-cli-osx && chmod +x fission && sudo mv fission /usr/local/bin/
|
||||
$ curl -Lo fission https://github.com/fission/fission/releases/download/{{ .Chart.Version }}/fission-{{ .Chart.Version }}-darwin-amd64 && chmod +x fission && sudo mv fission /usr/local/bin/
|
||||
|
||||
Linux:
|
||||
$ curl -Lo fission https://github.com/fission/fission/releases/download/{{ .Chart.Version }}/fission-cli-linux && chmod +x fission && sudo mv fission /usr/local/bin/
|
||||
$ curl -Lo fission https://github.com/fission/fission/releases/download/{{ .Chart.Version }}/fission-{{ .Chart.Version }}-linux-amd64 && chmod +x fission && sudo mv fission /usr/local/bin/
|
||||
|
||||
Windows:
|
||||
For Windows, you can use the linux binary on WSL. Or you can download this windows executable: https://github.com/fission/fission/releases/download/{{ .Chart.Version }}/fission-cli-windows.exe
|
||||
For Windows, you can use the linux binary on WSL. Or you can download this windows executable: https://github.com/fission/fission/releases/download/{{ .Chart.Version }}/fission-{{ .Chart.Version }}-windows-amd64.exe
|
||||
|
||||
2. You're ready to use Fission!
|
||||
|
||||
@@ -15,7 +15,7 @@ Windows:
|
||||
$ fission env create --name nodejs --image fission/node-env
|
||||
|
||||
# Get a hello world
|
||||
$ curl https://raw.githubusercontent.com/fission/fission/master/examples/nodejs/hello.js > hello.js
|
||||
$ curl https://raw.githubusercontent.com/fission/examples/master/nodejs/hello.js > hello.js
|
||||
|
||||
# Register this function with Fission
|
||||
$ fission function create --name hello --env nodejs --code hello.js
|
||||
|
||||
@@ -42,3 +42,29 @@ This template generates the image name for the deployment depending on the value
|
||||
{{ .Values.image }}:{{ .Values.imageTag }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "opentelemtry.envs" }}
|
||||
- name: OTEL_EXPORTER_OTLP_ENDPOINT
|
||||
value: "{{ .Values.openTelemetry.otlpCollectorEndpoint }}"
|
||||
- name: OTEL_EXPORTER_OTLP_INSECURE
|
||||
value: "{{ .Values.openTelemetry.otlpInsecure }}"
|
||||
{{- if .Values.openTelemetry.otlpHeaders }}
|
||||
- name: OTEL_EXPORTER_OTLP_HEADERS
|
||||
value: "{{ .Values.openTelemetry.otlpHeaders }}"
|
||||
{{- end }}
|
||||
- name: OTEL_TRACES_SAMPLER
|
||||
value: "{{ .Values.openTelemetry.tracesSampler }}"
|
||||
- name: OTEL_TRACES_SAMPLER_ARG
|
||||
value: "{{ .Values.openTelemetry.tracesSamplingRate }}"
|
||||
- name: OTEL_PROPAGATORS
|
||||
value: "{{ .Values.openTelemetry.propagators }}"
|
||||
{{- end }}
|
||||
|
||||
{{- define "opentracing.envs" }}
|
||||
- name: OPENTRACING_ENABLED
|
||||
value: {{ .Values.openTracing.enabled | default false | quote }}
|
||||
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||
value: "{{ .Values.openTracing.collectorEndpoint }}"
|
||||
- name: TRACING_SAMPLING_RATE
|
||||
value: {{ .Values.openTracing.samplingRate | default "0.5" | quote }}
|
||||
{{- end }}
|
||||
|
||||
@@ -140,16 +140,14 @@ spec:
|
||||
command: ["/fission-bundle"]
|
||||
args: ["--controllerPort", "8888"]
|
||||
env:
|
||||
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||
- name: TRACING_SAMPLING_RATE
|
||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
||||
- name: FISSION_FUNCTION_NAMESPACE
|
||||
value: "{{ .Values.functionNamespace }}"
|
||||
- name: POD_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: FISSION_FUNCTION_NAMESPACE
|
||||
value: "{{ .Values.functionNamespace }}"
|
||||
- name: POD_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
{{- include "opentracing.envs" . | indent 8 }}
|
||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: "/healthz"
|
||||
@@ -215,12 +213,10 @@ spec:
|
||||
value: "{{ .Values.pullPolicy }}"
|
||||
- name: FETCHER_IMAGE_PULL_POLICY
|
||||
value: "{{ .Values.pullPolicy }}"
|
||||
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||
- name: TRACING_SAMPLING_RATE
|
||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
||||
- name: ADOPT_EXISTING_RESOURCES
|
||||
value: {{ .Values.executor.adoptExistingResources | default false | quote }}
|
||||
- name: POD_READY_TIMEOUT
|
||||
value: {{ .Values.executor.podReadyTimeout | default false | quote }}
|
||||
- name: ENABLE_ISTIO
|
||||
value: "{{ .Values.enableIstio }}"
|
||||
- name: FETCHER_MINCPU
|
||||
@@ -231,6 +227,8 @@ spec:
|
||||
value: {{ .Values.fetcher.resource.cpu.limits | quote }}
|
||||
- name: FETCHER_MAXMEM
|
||||
value: {{ .Values.fetcher.resource.mem.limits | quote }}
|
||||
{{- include "opentracing.envs" . | indent 8 }}
|
||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: "/healthz"
|
||||
@@ -284,11 +282,7 @@ spec:
|
||||
- name: FETCHER_IMAGE_PULL_POLICY
|
||||
value: "{{ .Values.pullPolicy }}"
|
||||
- name: BUILDER_IMAGE_PULL_POLICY
|
||||
value: "{{ .Values.pullPolicy }}"
|
||||
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||
- name: TRACING_SAMPLING_RATE
|
||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
||||
value: "{{ .Values.pullPolicy }}"
|
||||
- name: ENABLE_ISTIO
|
||||
value: "{{ .Values.enableIstio }}"
|
||||
- name: FETCHER_MINCPU
|
||||
@@ -299,6 +293,8 @@ spec:
|
||||
value: {{ .Values.fetcher.resource.cpu.limits | quote }}
|
||||
- name: FETCHER_MAXMEM
|
||||
value: {{ .Values.fetcher.resource.mem.limits | quote }}
|
||||
{{- include "opentracing.envs" . | indent 8 }}
|
||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||
serviceAccountName: fission-svc
|
||||
{{- if .Values.extraCoreComponentPodConfig }}
|
||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||
@@ -329,10 +325,8 @@ spec:
|
||||
command: ["/fission-bundle"]
|
||||
args: ["--kubewatcher", "--routerUrl", "http://router.{{ .Release.Namespace }}"]
|
||||
env:
|
||||
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||
- name: TRACING_SAMPLING_RATE
|
||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
||||
{{- include "opentracing.envs" . | indent 8 }}
|
||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||
serviceAccountName: fission-svc
|
||||
{{- if .Values.extraCoreComponentPodConfig }}
|
||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||
@@ -363,10 +357,8 @@ spec:
|
||||
command: ["/fission-bundle"]
|
||||
args: ["--timer", "--routerUrl", "http://router.{{ .Release.Namespace }}"]
|
||||
env:
|
||||
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||
- name: TRACING_SAMPLING_RATE
|
||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
||||
{{- include "opentracing.envs" . | indent 8 }}
|
||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||
serviceAccountName: fission-svc
|
||||
{{- if .Values.extraCoreComponentPodConfig }}
|
||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||
@@ -398,29 +390,132 @@ spec:
|
||||
image: {{ include "fission-bundleImage" . | quote }}
|
||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||
command: ["/fission-bundle"]
|
||||
args: ["--storageServicePort", "8000", "--filePath", "/fission"]
|
||||
{{- if and (.Values.persistence.enabled) (eq (.Values.persistence.storageType | default "local") "s3") }}
|
||||
args: ["--storageServicePort", "8000", "--storageType", "s3"]
|
||||
{{- else }}
|
||||
args: ["--storageServicePort", "8000", "--storageType", "local"]
|
||||
{{- end }}
|
||||
env:
|
||||
- name: PRUNE_INTERVAL
|
||||
value: "{{.Values.pruneInterval}}"
|
||||
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||
- name: TRACING_SAMPLING_RATE
|
||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
||||
{{- if and (.Values.persistence.enabled) (eq (.Values.persistence.storageType | default "local") "s3") }}
|
||||
- name: STORAGE_S3_ENDPOINT
|
||||
value: {{ .Values.persistence.s3.endPoint }}
|
||||
- name: STORAGE_S3_BUCKET_NAME
|
||||
value: {{ .Values.persistence.s3.bucketName }}
|
||||
- name: STORAGE_S3_SUB_DIR
|
||||
value: {{ .Values.persistence.s3.subDir }}
|
||||
- name: STORAGE_S3_ACCESS_KEY_ID
|
||||
value: {{ .Values.persistence.s3.accessKeyId }}
|
||||
- name: STORAGE_S3_SECRET_ACCESS_KEY
|
||||
value: {{ .Values.persistence.s3.secretAccessKey }}
|
||||
- name: STORAGE_S3_REGION
|
||||
value: {{ .Values.persistence.s3.region }}
|
||||
{{- end }}
|
||||
{{- include "opentracing.envs" . | indent 8 }}
|
||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||
{{- if ne (.Values.persistence.storageType | default "local") "s3" }}
|
||||
volumeMounts:
|
||||
- name: fission-storage
|
||||
mountPath: /fission
|
||||
{{- end }}
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
name: http
|
||||
serviceAccountName: fission-svc
|
||||
{{- if and (.Values.persistence.enabled) (ne (.Values.persistence.storageType | default "local") "s3") }}
|
||||
volumes:
|
||||
- name: fission-storage
|
||||
{{- if .Values.persistence.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Values.persistence.existingClaim | default "fission-storage-pvc" }}
|
||||
{{- else }}
|
||||
volumes:
|
||||
- name: fission-storage
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- if .Values.extraCoreComponentPodConfig }}
|
||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||
{{- end }}
|
||||
|
||||
{{- if .Values.mqt_keda.enabled }}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mqtrigger-keda
|
||||
labels:
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
svc: mqtrigger-keda
|
||||
messagequeue: keda
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
svc: mqtrigger-keda
|
||||
messagequeue: keda
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
svc: mqtrigger-keda
|
||||
messagequeue: keda
|
||||
spec:
|
||||
containers:
|
||||
- name: mqtrigger-keda
|
||||
image: {{ include "fission-bundleImage" . | quote }}
|
||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||
command: ["/fission-bundle"]
|
||||
args: ["--mqt_keda", "--routerUrl", "http://router.{{ .Release.Namespace }}"]
|
||||
env:
|
||||
- name: DEBUG_ENV
|
||||
value: {{ .Values.debugEnv | quote }}
|
||||
- name: CONNECTOR_IMAGE_PULL_POLICY
|
||||
value: "{{ .Values.pullPolicy }}"
|
||||
- name: KAFKA_IMAGE
|
||||
value: "{{ .Values.mqt_keda.connector_images.kafka.image }}:{{ .Values.mqt_keda.connector_images.kafka.tag }}"
|
||||
- name: RABBITMQ_IMAGE
|
||||
value: "{{ .Values.mqt_keda.connector_images.rabbitmq.image }}:{{ .Values.mqt_keda.connector_images.rabbitmq.tag }}"
|
||||
- name: AWS-KINESIS-STREAM_IMAGE
|
||||
value: "{{ .Values.mqt_keda.connector_images.awskinesis.image }}:{{ .Values.mqt_keda.connector_images.awskinesis.tag }}"
|
||||
- name: AWS-SQS-QUEUE_IMAGE
|
||||
value: "{{ .Values.mqt_keda.connector_images.aws_sqs.image }}:{{ .Values.mqt_keda.connector_images.aws_sqs.tag }}"
|
||||
- name: STAN_IMAGE
|
||||
value: "{{ .Values.mqt_keda.connector_images.nats_steaming.image }}:{{ .Values.mqt_keda.connector_images.nats_steaming.tag }}"
|
||||
- name: GCP-PUB-SUB_IMAGE
|
||||
value: "{{ .Values.mqt_keda.connector_images.gcp_pub_sub.image }}:{{ .Values.mqt_keda.connector_images.gcp_pub_sub.tag }}"
|
||||
- name: REDIS_IMAGE
|
||||
value: "{{ .Values.mqt_keda.connector_images.redis.image }}:{{ .Values.mqt_keda.connector_images.redis.tag }}"
|
||||
{{- include "opentracing.envs" . | indent 8 }}
|
||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||
serviceAccountName: fission-svc
|
||||
{{- if .Values.extraCoreComponentPodConfig }}
|
||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
namespace: {{ .Values.functionNamespace }}
|
||||
name: event-fetcher
|
||||
rules:
|
||||
- apiGroups: [""] # "" indicates the core API group
|
||||
resources: ["pods"]
|
||||
verbs: ["get", "watch", "list"]
|
||||
- apiGroups: [""] # "" indicates the core API group
|
||||
resources: ["events"]
|
||||
verbs: ["*"]
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: fission-fetcher-pod-reader
|
||||
namespace: {{ .Values.functionNamespace }}
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: event-fetcher
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: fission-fetcher
|
||||
namespace: {{ .Values.functionNamespace }}
|
||||
@@ -26,6 +26,16 @@ spec:
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: post-install-job
|
||||
image: "fission/alpinecurl"
|
||||
command: ["sh", "-c", "/usr/bin/curl -m 5 -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"yaml-post-install\", \"chartName\": \"{{ .Chart.Name }}\", \"chartVersion\": \"{{ .Chart.Version }}\"}' https://g.fission.io/analytics || true"]
|
||||
{{- if .Values.imageTag }}
|
||||
image: {{ .Values.postInstallReportImage }}:{{ .Values.imageTag }}
|
||||
{{- else }}
|
||||
image: {{ .Values.postInstallReportImage }}
|
||||
{{- end }}
|
||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||
command: [ "/reporter" ]
|
||||
args: ["event", "-c", "fission-use", "-a", "yaml-post-install", "-l", "{{ .Chart.Name }}-{{ .Chart.Version }}"]
|
||||
env:
|
||||
- name: GA_TRACKING_ID
|
||||
value: "{{ .Values.gaTrackingID }}"
|
||||
serviceAccountName: fission-svc
|
||||
{{- end }}
|
||||
|
||||
@@ -30,6 +30,16 @@ spec:
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: post-install-job
|
||||
image: "fission/alpinecurl"
|
||||
command: ["sh", "-c", "/usr/bin/curl -m 5 -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"helm-post-install\", \"chartName\": \"{{ .Chart.Name }}\", \"chartVersion\": \"{{ .Chart.Version }}\"}' https://g.fission.io/analytics || true"]
|
||||
{{- if .Values.imageTag }}
|
||||
image: {{ .Values.postInstallReportImage }}:{{ .Values.imageTag }}
|
||||
{{- else }}
|
||||
image: {{ .Values.postInstallReportImage }}
|
||||
{{- end }}
|
||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||
command: [ "/reporter" ]
|
||||
args: ["event", "-c", "fission-use", "-a", "helm-post-install", "-l", "{{ .Chart.Name }}-{{ .Chart.Version }}"]
|
||||
env:
|
||||
- name: GA_TRACKING_ID
|
||||
value: "{{ .Values.gaTrackingID }}"
|
||||
serviceAccountName: fission-svc
|
||||
{{- end }}
|
||||
|
||||
@@ -30,6 +30,16 @@ spec:
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: post-upgrade-job
|
||||
image: "fission/alpinecurl"
|
||||
command: ["sh", "-c", "/usr/bin/curl -m 5 -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"helm-post-upgrade\", \"chartName\": \"{{ .Chart.Name }}\", \"chartVersion\": \"{{ .Chart.Version }}\"}' https://g.fission.io/analytics || true"]
|
||||
{{- if .Values.imageTag }}
|
||||
image: {{ .Values.postInstallReportImage }}:{{ .Values.imageTag }}
|
||||
{{- else }}
|
||||
image: {{ .Values.postInstallReportImage }}
|
||||
{{- end }}
|
||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||
command: [ "/reporter" ]
|
||||
args: ["event", "-c", "fission-use", "-a", "helm-post-upgrade", "-l", "{{ .Chart.Name }}-{{ .Chart.Version }}"]
|
||||
env:
|
||||
- name: GA_TRACKING_ID
|
||||
value: "{{ .Values.gaTrackingID }}"
|
||||
serviceAccountName: fission-svc
|
||||
{{- end }}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
|
||||
{{- if and (.Values.persistence.enabled) (not .Values.persistence.existingClaim) (eq (.Values.persistence.storageType | default "local") "local") }}
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
|
||||
@@ -35,41 +35,36 @@ spec:
|
||||
command: ["/fission-bundle"]
|
||||
args: ["--routerPort", "8888", "--executorUrl", "http://executor.{{ .Release.Namespace }}"]
|
||||
env:
|
||||
- name: POD_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: ROUTER_ROUND_TRIP_TIMEOUT
|
||||
value: {{ .Values.router.roundTrip.timeout | default "50ms" | quote }}
|
||||
- name: ROUTER_ROUNDTRIP_TIMEOUT_EXPONENT
|
||||
value: {{ .Values.router.roundTrip.timeoutExponent | default 2 | quote }}
|
||||
- name: ROUTER_ROUND_TRIP_KEEP_ALIVE_TIME
|
||||
value: {{ .Values.router.roundTrip.keepAliveTime | default "30s" | quote }}
|
||||
- name: ROUTER_ROUND_TRIP_DISABLE_KEEP_ALIVE
|
||||
value: {{ .Values.router.roundTrip.disableKeepAlive | default true | quote }}
|
||||
- name: ROUTER_ROUND_TRIP_MAX_RETRIES
|
||||
value: {{ .Values.router.roundTrip.maxRetries | default 10 | quote }}
|
||||
- name: ROUTER_SVC_ADDRESS_MAX_RETRIES
|
||||
value: {{ .Values.router.svcAddressMaxRetries | default 5 | quote }}
|
||||
- name: ROUTER_SVC_ADDRESS_UPDATE_TIMEOUT
|
||||
value: {{ .Values.router.svcAddressUpdateTimeout | default "30s" | quote }}
|
||||
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||
- name: TRACING_SAMPLING_RATE
|
||||
value: {{ .Values.router.traceSamplingRate | default "0.5" | quote }}
|
||||
- name: USE_ENCODED_PATH
|
||||
value: {{ .Values.router.useEncodedPath | default false | quote }}
|
||||
- name: DEBUG_ENV
|
||||
value: {{ .Values.debugEnv | quote }}
|
||||
- name: DISPLAY_ACCESS_LOG
|
||||
value: {{ .Values.router.displayAccessLog | default false | quote }}
|
||||
{{- if .Values.analytics }}
|
||||
- name: ANALYTICS_URL
|
||||
value: "https://g.fission.io/metrics"
|
||||
{{- else if .Values.analyticsNonHelmInstall }}
|
||||
- name: ANALYTICS_URL
|
||||
value: "https://g.fission.io/metrics"
|
||||
{{- end }}
|
||||
- name: POD_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: ROUTER_ROUND_TRIP_TIMEOUT
|
||||
value: {{ .Values.router.roundTrip.timeout | default "50ms" | quote }}
|
||||
- name: ROUTER_ROUNDTRIP_TIMEOUT_EXPONENT
|
||||
value: {{ .Values.router.roundTrip.timeoutExponent | default 2 | quote }}
|
||||
- name: ROUTER_ROUND_TRIP_KEEP_ALIVE_TIME
|
||||
value: {{ .Values.router.roundTrip.keepAliveTime | default "30s" | quote }}
|
||||
- name: ROUTER_ROUND_TRIP_DISABLE_KEEP_ALIVE
|
||||
value: {{ .Values.router.roundTrip.disableKeepAlive | default true | quote }}
|
||||
- name: ROUTER_ROUND_TRIP_MAX_RETRIES
|
||||
value: {{ .Values.router.roundTrip.maxRetries | default 10 | quote }}
|
||||
- name: ROUTER_SVC_ADDRESS_MAX_RETRIES
|
||||
value: {{ .Values.router.svcAddressMaxRetries | default 5 | quote }}
|
||||
- name: ROUTER_SVC_ADDRESS_UPDATE_TIMEOUT
|
||||
value: {{ .Values.router.svcAddressUpdateTimeout | default "30s" | quote }}
|
||||
- name: ROUTER_UNTAP_SERVICE_TIMEOUT
|
||||
value: {{ .Values.router.unTapServiceTimeout | default "3600s" | quote }}
|
||||
- name: USE_ENCODED_PATH
|
||||
value: {{ .Values.router.useEncodedPath | default false | quote }}
|
||||
- name: DEBUG_ENV
|
||||
value: {{ .Values.debugEnv | quote }}
|
||||
- name: DISPLAY_ACCESS_LOG
|
||||
value: {{ .Values.router.displayAccessLog | default false | quote }}
|
||||
{{- include "opentracing.envs" . | indent 8 }}
|
||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||
resources:
|
||||
{{- toYaml .Values.router.resources | indent 10 }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: "/router-healthz"
|
||||
@@ -89,6 +84,10 @@ spec:
|
||||
- containerPort: 8888
|
||||
name: http
|
||||
serviceAccountName: fission-svc
|
||||
{{- if .Values.router.extraCoreComponentPodConfig }}
|
||||
{{ toYaml .Values.router.extraCoreComponentPodConfig | indent 6 -}}
|
||||
{{- else }}
|
||||
{{- if .Values.extraCoreComponentPodConfig }}
|
||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
+131
-13
@@ -17,7 +17,7 @@ repository: index.docker.io
|
||||
image: fission/fission-bundle
|
||||
|
||||
## Fission image version
|
||||
imageTag: 1.8.0
|
||||
imageTag: v1.15.0-rc1
|
||||
|
||||
## Image pull policy
|
||||
pullPolicy: IfNotPresent
|
||||
@@ -43,8 +43,8 @@ fetcher:
|
||||
## Fetcher repository
|
||||
image: fission/fetcher
|
||||
## Fetcher image version
|
||||
imageTag: 1.8.0
|
||||
|
||||
imageTag: v1.15.0-rc1
|
||||
|
||||
## Fetcher is only for to downloading or uploading archive.
|
||||
## Normally, you don't need to change the value here, unless necessary.
|
||||
resource:
|
||||
@@ -58,27 +58,28 @@ fetcher:
|
||||
|
||||
executor:
|
||||
adoptExistingResources: false
|
||||
podReadyTimeout: 300s
|
||||
|
||||
## Router config
|
||||
router:
|
||||
deployAsDaemonSet: false
|
||||
svcAddressMaxRetries: 5
|
||||
svcAddressUpdateTimeout: 30s
|
||||
|
||||
unTapServiceTimeout: 3600s
|
||||
## Display endpoint access logs
|
||||
## To be aware of enabling logging endpoint access log, it increases
|
||||
## router resource utilization when under heavy workloads.
|
||||
displayAccessLog: false
|
||||
|
||||
|
||||
## Add annotations for router
|
||||
# svcAnnotations:
|
||||
# cloud.google.com/load-balancer-type: Internal
|
||||
|
||||
|
||||
## For router to match encoded path.
|
||||
## If true, "/foo%2Fbar" will match the path "/{var}";
|
||||
## Otherwise, it will match the path "/foo/bar".
|
||||
useEncodedPath: false
|
||||
|
||||
|
||||
roundTrip:
|
||||
## If true, router will disable the HTTP keep-alive which result in performance degradation.
|
||||
## But it ensures that router can redirect new coming requests to new function pods.
|
||||
@@ -108,13 +109,53 @@ router:
|
||||
## Sample with a rate per time window (traces/second)
|
||||
traceSamplingRate: 0.5
|
||||
|
||||
## Extend the container specs for the router fission pods.
|
||||
## Can be used to add things like affinty/tolerations/nodeSelectors/etc.
|
||||
## For example:
|
||||
## extraCoreComponentPodConfig:
|
||||
## affinity:
|
||||
## nodeAffinity:
|
||||
## requiredDuringSchedulingIgnoredDuringExecution:
|
||||
## nodeSelectorTerms:
|
||||
## - matchExpressions:
|
||||
## - key: capability
|
||||
## operator: In
|
||||
## values:
|
||||
## - app
|
||||
#extraCoreComponentPodConfig:
|
||||
# affinity:
|
||||
# tolerations:
|
||||
# nodeSelector:
|
||||
|
||||
# Pod resources as:
|
||||
# resources:
|
||||
# limits:
|
||||
# cpu: <tbd>
|
||||
# memory: <tbd>
|
||||
# requests:
|
||||
# cpu: <tbd>
|
||||
# memory: <tbd>
|
||||
resources: {}
|
||||
|
||||
## Persist data to a persistent volume.
|
||||
persistence:
|
||||
## If true, fission will create/use a Persistent Volume Claim
|
||||
## If true, fission will create/use a Persistent Volume Claim unless storageType is set to s3
|
||||
## If false, use emptyDir
|
||||
##
|
||||
enabled: true
|
||||
|
||||
## Must be set to either local or S3.
|
||||
## If storateType is set(other than local), one of its backend configuration must be set as below.
|
||||
#storageType: local | s3
|
||||
|
||||
## Sample configruation for AWS s3 storage backend
|
||||
#s3:
|
||||
# bucketName: <awsBucketName>
|
||||
# subDir: <sub directory within a bucket>
|
||||
# accessKeyId: <awsAccessKeyId>
|
||||
# secretAccessKey: <awsSecretAccessKey>
|
||||
# region: <awsRegion>
|
||||
|
||||
## A manually managed Persistent Volume Claim name
|
||||
## Requires persistence.enabled: true
|
||||
## If defined, PVC must be created manually before volume will be bound
|
||||
@@ -132,7 +173,7 @@ persistence:
|
||||
accessMode: ReadWriteOnce
|
||||
size: 8Gi
|
||||
|
||||
## Extend the container specs for the core fission pods.
|
||||
## Extend the container specs for the core fission pods.
|
||||
## Can be used to add things like affinty/tolerations/nodeSelectors/etc.
|
||||
## For example:
|
||||
## extraCoreComponentPodConfig:
|
||||
@@ -157,6 +198,9 @@ analytics: true
|
||||
## Internally used for generating an analytics job for non-helm installs
|
||||
analyticsNonHelmInstall: false
|
||||
|
||||
## Google Analytics Tracking ID
|
||||
gaTrackingID: UA-196546703-1
|
||||
|
||||
## Archive pruner is a garbage collector for archives on the fission storage service.
|
||||
## This interval configures the frequency at which it runs inside the storagesvc pod.
|
||||
## The value is in minutes.
|
||||
@@ -165,6 +209,9 @@ pruneInterval: 60
|
||||
## Fission pre-install/pre-upgrade checks live in this image
|
||||
preUpgradeChecksImage: fission/pre-upgrade-checks
|
||||
|
||||
## Fission ppost-install/post-upgrade reporting live in this image
|
||||
postInstallReportImage: fission/reporter
|
||||
|
||||
## if there are any pod specialization errors when a function is triggered and this flag is set to true, the error
|
||||
## summary is returned as part of http response
|
||||
debugEnv: false
|
||||
@@ -173,7 +220,7 @@ debugEnv: false
|
||||
prometheus:
|
||||
## set this flag to true if prometheus needs to be deployed along with fission
|
||||
enabled: false
|
||||
|
||||
|
||||
## If enabled is false, please assign the prometheus service URL
|
||||
## that is accessible by components.
|
||||
serviceEndpoint: ""
|
||||
@@ -182,6 +229,77 @@ prometheus:
|
||||
canaryDeployment:
|
||||
enabled: false
|
||||
|
||||
# Use these flags to enable opentracing, the variable is endpoint of Jaeger collector in the format shown below
|
||||
#traceCollectorEndpoint: "http://jaeger-collector.jaeger.svc:14268/api/traces?format=jaeger.thrift"
|
||||
#traceSamplingRate: 0.75
|
||||
# Use the following flags to enable OpenTracing.
|
||||
# Note: OpenTracing support will be removed in an upcoming release.
|
||||
# Please prefer using OpenTelemetry instead.
|
||||
openTracing:
|
||||
## set this flag to true if you wish to enable OpenTracing
|
||||
enabled: false
|
||||
|
||||
## if enabled is true, the variable is endpoint of Jaeger collector in the format shown below
|
||||
#collectorEndpoint: "http://jaeger-collector.jaeger.svc:14268/api/traces?format=jaeger.thrift"
|
||||
|
||||
## uniformly sample traces with the given probabilistic sampling rate
|
||||
#samplingRate: 0.75
|
||||
|
||||
# It is an alternate to OpenTracing.
|
||||
openTelemetry:
|
||||
# Use this flag to set the collector endpoint for OpenTelemetry.
|
||||
# The variable is endpoint of the collector in the format shown below.
|
||||
# otlpCollectorEndpoint: "otel-collector.observability.svc:4317"
|
||||
otlpCollectorEndpoint: ""
|
||||
# Set this flag to false if you are using secure endpoint for the collector.
|
||||
otlpInsecure: true
|
||||
# Key-value pairs to be used as headers associated with gRPC or HTTP requests
|
||||
# to the collector.
|
||||
# Eg. otlpHeaders: "key1=value1,key2=value2"
|
||||
otlpHeaders: ""
|
||||
# Supported samplers:
|
||||
# always_on - Sampler that always samples spans, regardless of the parent span's sampling decision.
|
||||
# always_off - Sampler that never samples spans, regardless of the parent span's sampling decision.
|
||||
# traceidratio - Sampler that samples probabalistically based on rate.
|
||||
# parentbased_always_on - (default if empty) Sampler that respects its parent span's sampling decision, but otherwise always samples.
|
||||
# parentbased_always_off - Sampler that respects its parent span's sampling decision, but otherwise never samples.
|
||||
# parentbased_traceidratio - Sampler that respects its parent span's sampling decision, but otherwise samples probabalistically based on rate.
|
||||
tracesSampler: "parentbased_traceidratio"
|
||||
# Each Sampler type defines its own expected input, if any.
|
||||
# Currently we get trace ratio for the case of,
|
||||
# 1. traceidratio
|
||||
# 2. parentbased_traceidratio
|
||||
# Sampling probability, a number in the [0..1] range, e.g. "0.1". Default is 0.1.
|
||||
tracesSamplingRate: "0.1"
|
||||
# Supported providers:
|
||||
# tracecontext - W3C Trace Context
|
||||
# baggage - W3C Baggage
|
||||
# b3 - B3 Single
|
||||
# b3multi - B3 Multi
|
||||
# jaeger - Jaeger uber-trace-id header
|
||||
# xray - AWS X-Ray (third party)
|
||||
# ottrace - OpenTracing Trace (third party)
|
||||
propagators: "tracecontext,baggage"
|
||||
|
||||
## Message Queue Trigger Kind, KEDA: enable and configuration
|
||||
mqt_keda:
|
||||
enabled: true
|
||||
connector_images:
|
||||
kafka:
|
||||
image: fission/keda-kafka-http-connector
|
||||
tag: v0.8
|
||||
rabbitmq:
|
||||
image: fission/keda-rabbitmq-http-connector
|
||||
tag: v0.8
|
||||
awskinesis:
|
||||
image: fission/keda-aws-kinesis-http-connector
|
||||
tag: v0.8
|
||||
aws_sqs:
|
||||
image: fission/keda-aws-sqs-http-connector
|
||||
tag: v0.8
|
||||
nats_steaming:
|
||||
image: fission/keda-nats-streaming-http-connector
|
||||
tag: v0.9
|
||||
gcp_pub_sub:
|
||||
image: fission/keda-gcp-pubsub-http-connector
|
||||
tag: v0.3
|
||||
redis:
|
||||
image: fission/keda-redis-http-connector
|
||||
tag: v0.1
|
||||
|
||||
@@ -1,45 +1,4 @@
|
||||
FROM golang:1.12-alpine as godep
|
||||
RUN apk add bash ca-certificates git gcc g++ libc-dev
|
||||
|
||||
ARG GOPKG=github.com/fission/fission
|
||||
|
||||
ENV GO111MODULE=on
|
||||
|
||||
WORKDIR /go/src/${GOPKG}
|
||||
|
||||
# To reuse build cache, copy go.mod & go.sum and download dependencies first.
|
||||
COPY go.* ./
|
||||
|
||||
RUN go mod download
|
||||
|
||||
From godep as builder
|
||||
|
||||
ARG GOPKG
|
||||
WORKDIR /go/src/${GOPKG}
|
||||
|
||||
# Copy whole fission directory to work dir
|
||||
COPY ./ ./
|
||||
|
||||
WORKDIR /go/src/${GOPKG}/cmd/builder
|
||||
|
||||
ARG GITCOMMIT=unknown
|
||||
# E.g. GITCOMMIT=$(git rev-parse HEAD)
|
||||
|
||||
ARG BUILDVERSION=unknown
|
||||
# E.g. BUILDVERSION=$(git rev-parse HEAD)
|
||||
|
||||
ARG BUILDDATE=unknown
|
||||
# E.g. BUILDDATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
|
||||
-o /go/bin/builder \
|
||||
-gcflags=-trimpath=$GOPATH \
|
||||
-asmflags=-trimpath=$GOPATH \
|
||||
-ldflags "-X github.com/fission/fission/pkg/info.GitCommit=${GITCOMMIT} -X github.com/fission/fission/pkg/info.BuildDate=${BUILDDATE} -X github.com/fission/fission/pkg/info.Version=${BUILDVERSION}"
|
||||
|
||||
FROM alpine:3.10 as base
|
||||
FROM alpine:3.14
|
||||
RUN apk add --update ca-certificates
|
||||
COPY --from=builder /go/bin/builder /
|
||||
EXPOSE 8001
|
||||
|
||||
COPY builder /builder
|
||||
ENTRYPOINT ["/builder"]
|
||||
|
||||
+6
-6
@@ -17,22 +17,22 @@ limitations under the License.
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"go.uber.org/zap"
|
||||
|
||||
"github.com/fission/fission/cmd/builder/app"
|
||||
"github.com/fission/fission/pkg/utils/loggerfactory"
|
||||
"github.com/fission/fission/pkg/utils/profile"
|
||||
)
|
||||
|
||||
// Usage: builder <shared volume path>
|
||||
func main() {
|
||||
logger, err := zap.NewProduction()
|
||||
if err != nil {
|
||||
log.Fatalf("can't initialize zap logger: %v", err)
|
||||
}
|
||||
logger := loggerfactory.GetLogger()
|
||||
defer logger.Sync()
|
||||
|
||||
profile.ProfileIfEnabled(logger)
|
||||
|
||||
shareVolume := os.Args[1]
|
||||
if _, err := os.Stat(shareVolume); err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
@@ -43,6 +43,6 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
err = app.Run(logger, shareVolume)
|
||||
err := app.Run(logger, shareVolume)
|
||||
logger.Error("error running builder", zap.Error(err))
|
||||
}
|
||||
|
||||
@@ -1,45 +1,4 @@
|
||||
FROM golang:1.12-alpine as godep
|
||||
RUN apk add bash ca-certificates git gcc g++ libc-dev
|
||||
|
||||
ARG GOPKG=github.com/fission/fission
|
||||
|
||||
ENV GO111MODULE=on
|
||||
|
||||
WORKDIR /go/src/${GOPKG}
|
||||
|
||||
# To reuse build cache, copy go.mod & go.sum and download dependencies first.
|
||||
COPY go.* ./
|
||||
|
||||
RUN go mod download
|
||||
|
||||
From godep as builder
|
||||
|
||||
ARG GOPKG
|
||||
WORKDIR /go/src/${GOPKG}
|
||||
|
||||
# Copy whole fission directory to work dir
|
||||
COPY ./ ./
|
||||
|
||||
WORKDIR /go/src/${GOPKG}/cmd/fetcher
|
||||
|
||||
ARG GITCOMMIT=unknown
|
||||
# E.g. GITCOMMIT=$(git rev-parse HEAD)
|
||||
|
||||
ARG BUILDVERSION=unknown
|
||||
# E.g. BUILDVERSION=$(git rev-parse HEAD)
|
||||
|
||||
ARG BUILDDATE=unknown
|
||||
# E.g. BUILDDATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
|
||||
-o /go/bin/fetcher \
|
||||
-gcflags=-trimpath=$GOPATH \
|
||||
-asmflags=-trimpath=$GOPATH \
|
||||
-ldflags "-X github.com/fission/fission/pkg/info.GitCommit=${GITCOMMIT} -X github.com/fission/fission/pkg/info.BuildDate=${BUILDDATE} -X github.com/fission/fission/pkg/info.Version=${BUILDVERSION}"
|
||||
|
||||
FROM alpine:3.10 as base
|
||||
FROM alpine:3.14
|
||||
RUN apk add --update ca-certificates
|
||||
COPY --from=builder /go/bin/fetcher /
|
||||
EXPOSE 8000
|
||||
|
||||
COPY fetcher /
|
||||
ENTRYPOINT ["/fetcher"]
|
||||
|
||||
+42
-39
@@ -21,39 +21,23 @@ import (
|
||||
"encoding/json"
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"sync/atomic"
|
||||
|
||||
"contrib.go.opencensus.io/exporter/jaeger"
|
||||
"go.opencensus.io/plugin/ochttp"
|
||||
"go.opencensus.io/trace"
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.uber.org/zap"
|
||||
|
||||
"github.com/fission/fission/pkg/fetcher"
|
||||
otelUtils "github.com/fission/fission/pkg/utils/otel"
|
||||
"github.com/fission/fission/pkg/utils/tracing"
|
||||
)
|
||||
|
||||
func registerTraceExporter(collectorEndpoint string) error {
|
||||
if collectorEndpoint == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
serviceName := "Fission-Fetcher"
|
||||
exporter, err := jaeger.NewExporter(jaeger.Options{
|
||||
CollectorEndpoint: collectorEndpoint,
|
||||
Process: jaeger.Process{
|
||||
ServiceName: serviceName,
|
||||
Tags: []jaeger.Tag{
|
||||
jaeger.BoolTag("fission", true),
|
||||
},
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
trace.RegisterExporter(exporter)
|
||||
trace.ApplyConfig(trace.Config{DefaultSampler: trace.AlwaysSample()})
|
||||
return nil
|
||||
}
|
||||
var (
|
||||
readyToServe uint32
|
||||
)
|
||||
|
||||
func Run(logger *zap.Logger) {
|
||||
flag.Usage = fetcherUsage
|
||||
@@ -79,17 +63,33 @@ func Run(logger *zap.Logger) {
|
||||
}
|
||||
}
|
||||
|
||||
if err := registerTraceExporter(*collectorEndpoint); err != nil {
|
||||
logger.Fatal("could not register trace exporter", zap.Error(err), zap.String("collector_endpoint", *collectorEndpoint))
|
||||
ctx := context.Background()
|
||||
openTracingEnabled := tracing.TracingEnabled(logger)
|
||||
if openTracingEnabled {
|
||||
go func() {
|
||||
if err := tracing.RegisterTraceExporter(logger, *collectorEndpoint, "Fission-Fetcher"); err != nil {
|
||||
logger.Fatal("could not register trace exporter", zap.Error(err), zap.String("collector_endpoint", *collectorEndpoint))
|
||||
}
|
||||
}()
|
||||
} else {
|
||||
shutdown, err := otelUtils.InitProvider(ctx, logger, "Fission-Fetcher")
|
||||
if err != nil {
|
||||
logger.Fatal("error initializing provider for OTLP", zap.Error(err))
|
||||
}
|
||||
if shutdown != nil {
|
||||
defer shutdown(ctx)
|
||||
}
|
||||
}
|
||||
|
||||
tracer := otel.Tracer("fetcher")
|
||||
ctx, span := tracer.Start(ctx, "fetcher/Run")
|
||||
defer span.End()
|
||||
|
||||
f, err := fetcher.MakeFetcher(logger, dir, *secretDir, *configDir)
|
||||
if err != nil {
|
||||
logger.Fatal("error making fetcher", zap.Error(err))
|
||||
}
|
||||
|
||||
readyToServe := false
|
||||
|
||||
// do specialization in other goroutine to prevent blocking in newdeploy
|
||||
go func() {
|
||||
if *specializeOnStart {
|
||||
@@ -100,14 +100,12 @@ func Run(logger *zap.Logger) {
|
||||
logger.Fatal("error decoding specialize request", zap.Error(err))
|
||||
}
|
||||
|
||||
ctx := context.Background()
|
||||
err = f.SpecializePod(ctx, specializeReq.FetchReq, specializeReq.LoadReq)
|
||||
if err != nil {
|
||||
logger.Fatal("error specializing function pod", zap.Error(err))
|
||||
}
|
||||
|
||||
readyToServe = true
|
||||
}
|
||||
atomic.StoreUint32(&readyToServe, 1)
|
||||
}()
|
||||
|
||||
mux := http.NewServeMux()
|
||||
@@ -115,9 +113,11 @@ func Run(logger *zap.Logger) {
|
||||
mux.HandleFunc("/specialize", f.SpecializeHandler)
|
||||
mux.HandleFunc("/upload", f.UploadHandler)
|
||||
mux.HandleFunc("/version", f.VersionHandler)
|
||||
mux.HandleFunc("/wsevent/start", f.WsStartHandler)
|
||||
mux.HandleFunc("/wsevent/end", f.WsEndHandler)
|
||||
|
||||
readinessHandler := func(w http.ResponseWriter, r *http.Request) {
|
||||
if !*specializeOnStart || readyToServe {
|
||||
if atomic.LoadUint32(&readyToServe) == 1 {
|
||||
w.WriteHeader(http.StatusOK)
|
||||
} else {
|
||||
w.WriteHeader(http.StatusServiceUnavailable)
|
||||
@@ -129,14 +129,17 @@ func Run(logger *zap.Logger) {
|
||||
w.WriteHeader(http.StatusOK)
|
||||
})
|
||||
|
||||
// For backward compatibility
|
||||
// TODO: remove this path in future
|
||||
mux.HandleFunc("/readniess-healthz", readinessHandler)
|
||||
|
||||
logger.Info("fetcher ready to receive requests")
|
||||
http.ListenAndServe(":8000", &ochttp.Handler{
|
||||
Handler: mux,
|
||||
})
|
||||
|
||||
var handler http.Handler
|
||||
if openTracingEnabled {
|
||||
handler = &ochttp.Handler{Handler: mux}
|
||||
} else {
|
||||
handler = otelUtils.GetHandlerWithOTEL(mux, "fission-fetcher", otelUtils.UrlsToIgnore("/healthz", "/readiness-healthz"))
|
||||
}
|
||||
if err = http.ListenAndServe(":8000", handler); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func fetcherUsage() {
|
||||
|
||||
+5
-8
@@ -17,20 +17,17 @@ limitations under the License.
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"go.uber.org/zap"
|
||||
|
||||
"github.com/fission/fission/cmd/fetcher/app"
|
||||
"github.com/fission/fission/pkg/utils/loggerfactory"
|
||||
"github.com/fission/fission/pkg/utils/profile"
|
||||
)
|
||||
|
||||
// Usage: fetcher <shared volume path>
|
||||
func main() {
|
||||
logger, err := zap.NewProduction()
|
||||
if err != nil {
|
||||
log.Fatalf("can't initialize zap logger: %v", err)
|
||||
}
|
||||
logger := loggerfactory.GetLogger()
|
||||
defer logger.Sync()
|
||||
|
||||
profile.ProfileIfEnabled(logger)
|
||||
|
||||
app.Run(logger)
|
||||
}
|
||||
|
||||
@@ -1,44 +1,4 @@
|
||||
FROM golang:1.12-alpine as godep
|
||||
RUN apk add bash ca-certificates git gcc g++ libc-dev
|
||||
|
||||
ARG GOPKG=github.com/fission/fission
|
||||
|
||||
ENV GO111MODULE=on
|
||||
|
||||
WORKDIR /go/src/${GOPKG}
|
||||
|
||||
# To reuse build cache, copy go.mod & go.sum and download dependencies first.
|
||||
COPY go.* ./
|
||||
|
||||
RUN go mod download
|
||||
|
||||
From godep as builder
|
||||
|
||||
ARG GOPKG
|
||||
WORKDIR /go/src/${GOPKG}
|
||||
|
||||
# Copy whole fission directory to work dir
|
||||
COPY ./ ./
|
||||
|
||||
WORKDIR /go/src/${GOPKG}/cmd/fission-bundle
|
||||
|
||||
ARG GITCOMMIT=unknown
|
||||
# E.g. GITCOMMIT=$(git rev-parse HEAD)
|
||||
|
||||
ARG BUILDVERSION=unknown
|
||||
# E.g. BUILDVERSION=$(git rev-parse HEAD)
|
||||
|
||||
ARG BUILDDATE=unknown
|
||||
# E.g. BUILDDATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
|
||||
-o /go/bin/fission-bundle \
|
||||
-gcflags=-trimpath=$GOPATH \
|
||||
-asmflags=-trimpath=$GOPATH \
|
||||
-ldflags "-X github.com/fission/fission/pkg/info.GitCommit=${GITCOMMIT} -X github.com/fission/fission/pkg/info.BuildDate=${BUILDDATE} -X github.com/fission/fission/pkg/info.Version=${BUILDVERSION}"
|
||||
|
||||
FROM alpine:3.10 as base
|
||||
FROM alpine:3.14
|
||||
RUN apk add --update ca-certificates
|
||||
COPY --from=builder /go/bin/fission-bundle /
|
||||
|
||||
COPY fission-bundle /
|
||||
ENTRYPOINT ["/fission-bundle"]
|
||||
|
||||
+73
-70
@@ -17,41 +17,46 @@ limitations under the License.
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
"contrib.go.opencensus.io/exporter/jaeger"
|
||||
docopt "github.com/docopt/docopt-go"
|
||||
"go.opencensus.io/trace"
|
||||
|
||||
"go.uber.org/zap"
|
||||
|
||||
"github.com/fission/fission/cmd/fission-bundle/mqtrigger"
|
||||
"github.com/fission/fission/pkg/buildermgr"
|
||||
"github.com/fission/fission/pkg/controller"
|
||||
"github.com/fission/fission/pkg/executor"
|
||||
"github.com/fission/fission/pkg/info"
|
||||
"github.com/fission/fission/pkg/kubewatcher"
|
||||
functionLogger "github.com/fission/fission/pkg/logger"
|
||||
messagequeue "github.com/fission/fission/pkg/mqtrigger"
|
||||
mqt "github.com/fission/fission/pkg/mqtrigger"
|
||||
"github.com/fission/fission/pkg/router"
|
||||
"github.com/fission/fission/pkg/storagesvc"
|
||||
"github.com/fission/fission/pkg/timer"
|
||||
"github.com/fission/fission/pkg/utils/loggerfactory"
|
||||
"github.com/fission/fission/pkg/utils/otel"
|
||||
"github.com/fission/fission/pkg/utils/profile"
|
||||
"github.com/fission/fission/pkg/utils/tracing"
|
||||
)
|
||||
|
||||
func runController(logger *zap.Logger, port int) {
|
||||
controller.Start(logger, port, false)
|
||||
func runController(logger *zap.Logger, port int, openTracingEnabled bool) {
|
||||
controller.Start(logger, port, false, openTracingEnabled)
|
||||
logger.Fatal("controller exited")
|
||||
}
|
||||
|
||||
func runRouter(logger *zap.Logger, port int, executorUrl string) {
|
||||
router.Start(logger, port, executorUrl)
|
||||
func runRouter(logger *zap.Logger, port int, executorUrl string, openTracingEnabled bool) {
|
||||
router.Start(logger, port, executorUrl, openTracingEnabled)
|
||||
logger.Fatal("router exited")
|
||||
}
|
||||
|
||||
func runExecutor(logger *zap.Logger, port int, functionNamespace, envBuilderNamespace string) {
|
||||
err := executor.StartExecutor(logger, functionNamespace, envBuilderNamespace, port)
|
||||
func runExecutor(logger *zap.Logger, port int, functionNamespace, envBuilderNamespace string, openTracingEnabled bool) {
|
||||
err := executor.StartExecutor(logger, functionNamespace, envBuilderNamespace, port, openTracingEnabled)
|
||||
if err != nil {
|
||||
logger.Fatal("error starting executor", zap.Error(err))
|
||||
}
|
||||
@@ -72,20 +77,25 @@ func runTimer(logger *zap.Logger, routerUrl string) {
|
||||
}
|
||||
|
||||
func runMessageQueueMgr(logger *zap.Logger, routerUrl string) {
|
||||
err := messagequeue.Start(logger, routerUrl)
|
||||
err := mqtrigger.Start(logger, routerUrl)
|
||||
if err != nil {
|
||||
logger.Fatal("error starting message queue manager", zap.Error(err))
|
||||
}
|
||||
}
|
||||
|
||||
func runStorageSvc(logger *zap.Logger, port int, filePath string) {
|
||||
subdir := os.Getenv("SUBDIR")
|
||||
if len(subdir) == 0 {
|
||||
subdir = "fission-functions"
|
||||
// KEDA based MessageQueue Trigger Manager
|
||||
func runMQManager(logger *zap.Logger, routerURL string) {
|
||||
err := mqt.StartScalerManager(logger, routerURL)
|
||||
if err != nil {
|
||||
logger.Fatal("error starting mqt scaler manager", zap.Error(err))
|
||||
}
|
||||
}
|
||||
|
||||
func runStorageSvc(logger *zap.Logger, port int, storage storagesvc.Storage, openTracingEnabled bool) {
|
||||
err := storagesvc.Start(logger, storage, port, openTracingEnabled)
|
||||
if err != nil {
|
||||
logger.Fatal("error starting storage service", zap.Error(err))
|
||||
}
|
||||
enableArchivePruner := true
|
||||
storagesvc.RunStorageService(logger, storagesvc.StorageTypeLocal,
|
||||
filePath, subdir, port, enableArchivePruner)
|
||||
}
|
||||
|
||||
func runBuilderMgr(logger *zap.Logger, storageSvcUrl string, envBuilderNamespace string) {
|
||||
@@ -117,13 +127,7 @@ func getStringArgWithDefault(arg interface{}, defaultValue string) string {
|
||||
}
|
||||
}
|
||||
|
||||
func registerTraceExporter(logger *zap.Logger, arguments map[string]interface{}) error {
|
||||
collectorEndpoint := os.Getenv("TRACE_JAEGER_COLLECTOR_ENDPOINT")
|
||||
if len(collectorEndpoint) == 0 {
|
||||
logger.Info("skipping trace exporter registration")
|
||||
return nil
|
||||
}
|
||||
|
||||
func getServiceName(arguments map[string]interface{}) string {
|
||||
serviceName := "Fission-Unknown"
|
||||
|
||||
if arguments["--controllerPort"] != nil {
|
||||
@@ -142,37 +146,23 @@ func registerTraceExporter(logger *zap.Logger, arguments map[string]interface{})
|
||||
serviceName = "Fission-BuilderMgr"
|
||||
} else if arguments["--storageServicePort"] != nil {
|
||||
serviceName = "Fission-StorageSvc"
|
||||
} else if arguments["--mqt_keda"] == true {
|
||||
serviceName = "Fission-Keda-MQTrigger"
|
||||
}
|
||||
|
||||
exporter, err := jaeger.NewExporter(jaeger.Options{
|
||||
CollectorEndpoint: collectorEndpoint,
|
||||
Process: jaeger.Process{
|
||||
ServiceName: serviceName,
|
||||
Tags: []jaeger.Tag{
|
||||
jaeger.BoolTag("fission", true),
|
||||
},
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
samplingRate, err := strconv.ParseFloat(os.Getenv("TRACING_SAMPLING_RATE"), 32)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
trace.RegisterExporter(exporter)
|
||||
trace.ApplyConfig(trace.Config{DefaultSampler: trace.ProbabilitySampler(samplingRate)})
|
||||
return nil
|
||||
return serviceName
|
||||
}
|
||||
|
||||
func main() {
|
||||
var err error
|
||||
|
||||
// From https://github.com/containous/traefik/pull/1817/files
|
||||
// Tell glog to log into STDERR. Otherwise, we risk
|
||||
// certain kinds of API errors getting logged into a directory not
|
||||
// available in a `FROM scratch` Docker container, causing glog to abort
|
||||
// hard with an exit code > 0.
|
||||
flag.Set("logtostderr", "true")
|
||||
// TODO: fix the lint error. Error checking here is causing all components to crash with error "logtostderr not found"
|
||||
flag.Set("logtostderr", "true") //nolint: errcheck
|
||||
|
||||
usage := `fission-bundle: Package of all fission microservices: controller, router, executor.
|
||||
|
||||
@@ -200,10 +190,11 @@ Usage:
|
||||
fission-bundle --routerPort=<port> [--executorUrl=<url>]
|
||||
fission-bundle --executorPort=<port> [--namespace=<namespace>] [--fission-namespace=<namespace>]
|
||||
fission-bundle --kubewatcher [--routerUrl=<url>]
|
||||
fission-bundle --storageServicePort=<port> --filePath=<filePath>
|
||||
fission-bundle --storageServicePort=<port> --storageType=<storateType>
|
||||
fission-bundle --builderMgr [--storageSvcUrl=<url>] [--envbuilder-namespace=<namespace>]
|
||||
fission-bundle --timer [--routerUrl=<url>]
|
||||
fission-bundle --mqt [--routerUrl=<url>]
|
||||
fission-bundle --mqt_keda [--routerUrl=<url>]
|
||||
fission-bundle --logger
|
||||
fission-bundle --version
|
||||
Options:
|
||||
@@ -220,35 +211,36 @@ Options:
|
||||
--kubewatcher Start Kubernetes events watcher.
|
||||
--timer Start Timer.
|
||||
--mqt Start message queue trigger.
|
||||
--mqt_keda Start message queue trigger of kind KEDA
|
||||
--builderMgr Start builder manager.
|
||||
--version Print version information
|
||||
`
|
||||
|
||||
var logger *zap.Logger
|
||||
var err error
|
||||
|
||||
isDebugEnv, _ := strconv.ParseBool(os.Getenv("DEBUG_ENV"))
|
||||
if isDebugEnv {
|
||||
logger, err = zap.NewDevelopment()
|
||||
} else {
|
||||
config := zap.NewProductionConfig()
|
||||
config.DisableStacktrace = true
|
||||
logger, err = config.Build()
|
||||
}
|
||||
if err != nil {
|
||||
log.Fatalf("can't initialize zap logger: %v", err)
|
||||
}
|
||||
logger := loggerfactory.GetLogger()
|
||||
defer logger.Sync()
|
||||
|
||||
profile.ProfileIfEnabled(logger)
|
||||
|
||||
version := fmt.Sprintf("Fission Bundle Version: %v", info.BuildInfo().String())
|
||||
arguments, err := docopt.Parse(usage, nil, true, version, false)
|
||||
arguments, err := docopt.ParseArgs(usage, nil, version)
|
||||
if err != nil {
|
||||
logger.Fatal("Could not parse command line arguments", zap.Error(err))
|
||||
}
|
||||
|
||||
err = registerTraceExporter(logger, arguments)
|
||||
if err != nil {
|
||||
logger.Fatal("Could not register trace exporter", zap.Error(err), zap.Any("argument", arguments))
|
||||
ctx := context.Background()
|
||||
openTracingEnabled := tracing.TracingEnabled(logger)
|
||||
if openTracingEnabled {
|
||||
err = tracing.RegisterTraceExporter(logger, os.Getenv("TRACE_JAEGER_COLLECTOR_ENDPOINT"), getServiceName(arguments))
|
||||
if err != nil {
|
||||
logger.Fatal("Could not register trace exporter", zap.Error(err), zap.Any("argument", arguments))
|
||||
}
|
||||
} else {
|
||||
shutdown, err := otel.InitProvider(ctx, logger, getServiceName(arguments))
|
||||
if err != nil {
|
||||
logger.Fatal("error initializing provider for OTLP", zap.Error(err), zap.Any("argument", arguments))
|
||||
}
|
||||
if shutdown != nil {
|
||||
defer shutdown(ctx)
|
||||
}
|
||||
}
|
||||
|
||||
functionNs := getStringArgWithDefault(arguments["--namespace"], "fission-function")
|
||||
@@ -260,17 +252,17 @@ Options:
|
||||
|
||||
if arguments["--controllerPort"] != nil {
|
||||
port := getPort(logger, arguments["--controllerPort"])
|
||||
runController(logger, port)
|
||||
runController(logger, port, openTracingEnabled)
|
||||
}
|
||||
|
||||
if arguments["--routerPort"] != nil {
|
||||
port := getPort(logger, arguments["--routerPort"])
|
||||
runRouter(logger, port, executorUrl)
|
||||
runRouter(logger, port, executorUrl, openTracingEnabled)
|
||||
}
|
||||
|
||||
if arguments["--executorPort"] != nil {
|
||||
port := getPort(logger, arguments["--executorPort"])
|
||||
runExecutor(logger, port, functionNs, envBuilderNs)
|
||||
runExecutor(logger, port, functionNs, envBuilderNs, openTracingEnabled)
|
||||
}
|
||||
|
||||
if arguments["--kubewatcher"] == true {
|
||||
@@ -285,6 +277,10 @@ Options:
|
||||
runMessageQueueMgr(logger, routerUrl)
|
||||
}
|
||||
|
||||
if arguments["--mqt_keda"] == true {
|
||||
runMQManager(logger, routerUrl)
|
||||
}
|
||||
|
||||
if arguments["--builderMgr"] == true {
|
||||
runBuilderMgr(logger, storageSvcUrl, envBuilderNs)
|
||||
}
|
||||
@@ -295,8 +291,15 @@ Options:
|
||||
|
||||
if arguments["--storageServicePort"] != nil {
|
||||
port := getPort(logger, arguments["--storageServicePort"])
|
||||
filePath := arguments["--filePath"].(string)
|
||||
runStorageSvc(logger, port, filePath)
|
||||
|
||||
var storage storagesvc.Storage
|
||||
|
||||
if arguments["--storageType"] != nil && arguments["--storageType"] == string(storagesvc.StorageTypeS3) {
|
||||
storage = storagesvc.NewS3Storage()
|
||||
} else if arguments["--storageType"] == string(storagesvc.StorageTypeLocal) {
|
||||
storage = storagesvc.NewLocalStorage("/fission")
|
||||
}
|
||||
runStorageSvc(logger, port, storage, openTracingEnabled)
|
||||
}
|
||||
|
||||
select {}
|
||||
|
||||
@@ -26,12 +26,18 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
"go.uber.org/zap"
|
||||
|
||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
"github.com/fission/fission/pkg/crd"
|
||||
"github.com/fission/fission/pkg/mqtrigger"
|
||||
"github.com/fission/fission/pkg/mqtrigger/factory"
|
||||
"github.com/fission/fission/pkg/mqtrigger/messageQueue"
|
||||
_ "github.com/fission/fission/pkg/mqtrigger/messageQueue/azurequeuestorage"
|
||||
_ "github.com/fission/fission/pkg/mqtrigger/messageQueue/kafka"
|
||||
_ "github.com/fission/fission/pkg/mqtrigger/messageQueue/nats"
|
||||
)
|
||||
|
||||
func Start(logger *zap.Logger, routerUrl string) error {
|
||||
fissionClient, _, _, err := crd.MakeFissionClient()
|
||||
fissionClient, _, _, _, err := crd.MakeFissionClient()
|
||||
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to get fission or kubernetes client")
|
||||
@@ -42,8 +48,7 @@ func Start(logger *zap.Logger, routerUrl string) error {
|
||||
return errors.Wrap(err, "error waiting for CRDs")
|
||||
}
|
||||
|
||||
// Message queue type: nats is the only supported one for now
|
||||
mqType := os.Getenv("MESSAGE_QUEUE_TYPE")
|
||||
mqType := (fv1.MessageQueueType)(os.Getenv("MESSAGE_QUEUE_TYPE"))
|
||||
mqUrl := os.Getenv("MESSAGE_QUEUE_URL")
|
||||
|
||||
secretsPath := strings.TrimSpace(os.Getenv("MESSAGE_QUEUE_SECRETS"))
|
||||
@@ -57,17 +62,26 @@ func Start(logger *zap.Logger, routerUrl string) error {
|
||||
}
|
||||
}
|
||||
|
||||
mqCfg := messageQueue.MessageQueueConfig{
|
||||
MQType: mqType,
|
||||
Url: mqUrl,
|
||||
Secrets: secrets,
|
||||
mq, err := factory.Create(
|
||||
logger,
|
||||
mqType,
|
||||
messageQueue.Config{
|
||||
MQType: (string)(mqType),
|
||||
Url: mqUrl,
|
||||
Secrets: secrets,
|
||||
},
|
||||
routerUrl,
|
||||
)
|
||||
if err != nil {
|
||||
logger.Fatal("failed to connect to remote message queue server", zap.Error(err))
|
||||
}
|
||||
messageQueue.MakeMessageQueueTriggerManager(logger, fissionClient, routerUrl, mqCfg)
|
||||
|
||||
mqtrigger.MakeMessageQueueTriggerManager(logger, fissionClient, mqType, mq).Run()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func readSecrets(logger *zap.Logger, secretsPath string) (map[string][]byte, error) {
|
||||
|
||||
// return if no secrets exist
|
||||
if _, err := os.Stat(secretsPath); os.IsNotExist(err) {
|
||||
return nil, err
|
||||
@@ -24,6 +24,9 @@ import (
|
||||
"github.com/fission/fission/pkg/fission-cli/flag"
|
||||
flagkey "github.com/fission/fission/pkg/fission-cli/flag/key"
|
||||
"github.com/fission/fission/pkg/fission-cli/util"
|
||||
_ "github.com/fission/fission/pkg/mqtrigger/messageQueue/azurequeuestorage"
|
||||
_ "github.com/fission/fission/pkg/mqtrigger/messageQueue/kafka"
|
||||
_ "github.com/fission/fission/pkg/mqtrigger/messageQueue/nats"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -70,7 +73,7 @@ func App() *cobra.Command {
|
||||
})
|
||||
|
||||
wrapper.SetFlags(rootCmd, flag.FlagSet{
|
||||
Global: []flag.Flag{flag.GlobalServer, flag.GlobalVerbosity},
|
||||
Global: []flag.Flag{flag.GlobalServer, flag.GlobalVerbosity, flag.KubeContext},
|
||||
})
|
||||
|
||||
groups := helptemplate.CommandGroups{}
|
||||
@@ -83,7 +86,7 @@ func App() *cobra.Command {
|
||||
|
||||
flagExposer := helptemplate.ActsAsRootCommand(rootCmd, nil, groups...)
|
||||
// show global options in usage
|
||||
flagExposer.ExposeFlags(rootCmd, flagkey.Server, flagkey.Verbosity)
|
||||
flagExposer.ExposeFlags(rootCmd, flagkey.Server, flagkey.Verbosity, flagkey.KubeContext)
|
||||
|
||||
return rootCmd
|
||||
}
|
||||
|
||||
@@ -1,45 +1,4 @@
|
||||
FROM golang:1.12-alpine as godep
|
||||
RUN apk add bash ca-certificates git gcc g++ libc-dev
|
||||
|
||||
ARG GOPKG=github.com/fission/fission
|
||||
|
||||
ENV GO111MODULE=on
|
||||
|
||||
WORKDIR /go/src/${GOPKG}
|
||||
|
||||
# To reuse build cache, copy go.mod & go.sum and download dependencies first.
|
||||
COPY go.* ./
|
||||
|
||||
RUN go mod download
|
||||
|
||||
From godep as builder
|
||||
|
||||
ARG GOPKG
|
||||
WORKDIR /go/src/${GOPKG}
|
||||
|
||||
# Copy whole fission directory to work dir
|
||||
COPY ./ ./
|
||||
|
||||
WORKDIR /go/src/${GOPKG}/cmd/preupgradechecks
|
||||
|
||||
ARG GITCOMMIT=unknown
|
||||
# E.g. GITCOMMIT=$(git rev-parse HEAD)
|
||||
|
||||
ARG BUILDVERSION=unknown
|
||||
# E.g. BUILDVERSION=$(git rev-parse HEAD)
|
||||
|
||||
ARG BUILDDATE=unknown
|
||||
# E.g. BUILDDATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
|
||||
-o /go/bin/pre-upgrade-checks \
|
||||
-gcflags=-trimpath=$GOPATH \
|
||||
-asmflags=-trimpath=$GOPATH \
|
||||
-ldflags "-X github.com/fission/fission/pkg/info.GitCommit=${GITCOMMIT} -X github.com/fission/fission/pkg/info.BuildDate=${BUILDDATE} -X github.com/fission/fission/pkg/info.Version=${BUILDVERSION}"
|
||||
|
||||
FROM alpine:3.10 as base
|
||||
FROM alpine:3.14
|
||||
RUN apk add --update ca-certificates
|
||||
COPY --from=builder /go/bin/pre-upgrade-checks /
|
||||
|
||||
COPY pre-upgrade-checks /
|
||||
ENTRYPOINT ["/pre-upgrade-checks"]
|
||||
EXPOSE 8001
|
||||
|
||||
@@ -17,12 +17,11 @@ limitations under the License.
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/docopt/docopt-go"
|
||||
"go.uber.org/zap"
|
||||
|
||||
"github.com/fission/fission/pkg/info"
|
||||
"github.com/fission/fission/pkg/utils/loggerfactory"
|
||||
)
|
||||
|
||||
func getStringArgWithDefault(arg interface{}, defaultValue string) string {
|
||||
@@ -34,10 +33,7 @@ func getStringArgWithDefault(arg interface{}, defaultValue string) string {
|
||||
}
|
||||
|
||||
func main() {
|
||||
logger, err := zap.NewProduction()
|
||||
if err != nil {
|
||||
log.Fatalf("can't initialize zap logger: %v", err)
|
||||
}
|
||||
logger := loggerfactory.GetLogger()
|
||||
defer logger.Sync()
|
||||
|
||||
usage := `Package to perform operations needed prior to fission installation
|
||||
@@ -47,7 +43,7 @@ Options:
|
||||
--fn-pod-namespace=<podNamespace> Namespace where function pods get deployed.
|
||||
--envbuilder-namespace=<envBuilderNamespace> Namespace where builder env pods are deployed.`
|
||||
|
||||
arguments, err := docopt.Parse(usage, nil, true, info.BuildInfo().String(), false)
|
||||
arguments, err := docopt.ParseArgs(usage, nil, info.BuildInfo().String())
|
||||
if err != nil {
|
||||
logger.Fatal("Could not parse command line arguments", zap.Error(err))
|
||||
}
|
||||
@@ -61,12 +57,15 @@ Options:
|
||||
zap.Error(err))
|
||||
}
|
||||
|
||||
if !crdBackedClient.IsFissionReInstall() {
|
||||
crd := crdBackedClient.GetFunctionCRD()
|
||||
if crd == nil {
|
||||
logger.Info("nothing to do since CRDs are not present on the cluster")
|
||||
return
|
||||
}
|
||||
|
||||
err = crdBackedClient.LatestSchemaApplied()
|
||||
if err != nil {
|
||||
logger.Fatal("New CRDs are not applied")
|
||||
}
|
||||
crdBackedClient.VerifyFunctionSpecReferences()
|
||||
crdBackedClient.RemoveClusterAdminRolesForFissionSAs()
|
||||
crdBackedClient.SetupRoleBindings()
|
||||
}
|
||||
|
||||
@@ -17,11 +17,14 @@ limitations under the License.
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
multierror "github.com/hashicorp/go-multierror"
|
||||
"github.com/pkg/errors"
|
||||
"go.uber.org/zap"
|
||||
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
|
||||
apiextensionsclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
|
||||
k8serrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
@@ -29,7 +32,6 @@ import (
|
||||
|
||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
"github.com/fission/fission/pkg/crd"
|
||||
"github.com/fission/fission/pkg/utils"
|
||||
)
|
||||
|
||||
type (
|
||||
@@ -46,10 +48,11 @@ type (
|
||||
const (
|
||||
maxRetries = 5
|
||||
FunctionCRD = "functions.fission.io"
|
||||
MqtCRD = "messagequeuetriggers.fission.io"
|
||||
)
|
||||
|
||||
func makePreUpgradeTaskClient(logger *zap.Logger, fnPodNs, envBuilderNs string) (*PreUpgradeTaskClient, error) {
|
||||
fissionClient, k8sClient, apiExtClient, err := crd.MakeFissionClient()
|
||||
fissionClient, k8sClient, apiExtClient, _, err := crd.MakeFissionClient()
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "error making fission client")
|
||||
}
|
||||
@@ -64,20 +67,53 @@ func makePreUpgradeTaskClient(logger *zap.Logger, fnPodNs, envBuilderNs string)
|
||||
}, nil
|
||||
}
|
||||
|
||||
// IsFissionReInstall checks if there is atleast one fission CRD, i.e. function in this case, on this cluster.
|
||||
// We need this to find out if fission had been previously installed on this cluster
|
||||
func (client *PreUpgradeTaskClient) IsFissionReInstall() bool {
|
||||
// GetFunctionCRD checks if function CRD is present on the cluster and returns it. It returns nil if not found
|
||||
// We can use this to find out if fission had been previously installed on this cluster too.
|
||||
func (client *PreUpgradeTaskClient) GetFunctionCRD() *v1.CustomResourceDefinition {
|
||||
for i := 0; i < maxRetries; i++ {
|
||||
_, err := client.apiExtClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(FunctionCRD, metav1.GetOptions{})
|
||||
crd, err := client.apiExtClient.ApiextensionsV1().CustomResourceDefinitions().Get(context.TODO(), FunctionCRD, metav1.GetOptions{})
|
||||
if err != nil && k8serrors.IsNotFound(err) {
|
||||
return false
|
||||
}
|
||||
if err == nil {
|
||||
return true
|
||||
continue
|
||||
}
|
||||
return crd
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetMqtCRD checks if MQT CRD is present on the cluster and returns it. It returns nil if not found
|
||||
func (client *PreUpgradeTaskClient) GetMqtCRD() *v1.CustomResourceDefinition {
|
||||
crd, err := client.apiExtClient.ApiextensionsV1().CustomResourceDefinitions().Get(context.TODO(), MqtCRD, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
client.logger.Error("Could not find MQT CRD", zap.Error(err))
|
||||
return nil
|
||||
}
|
||||
return crd
|
||||
}
|
||||
|
||||
// LatestSchemaApplied ensures that the end user has applied the latest CRDs generated to the cluster.
|
||||
// For future reference: whenever a new field is added, we need to check for that field's existence in this function
|
||||
func (client *PreUpgradeTaskClient) LatestSchemaApplied() error {
|
||||
client.logger.Info("Checking if user has applied the latest CRDs")
|
||||
funcCRD := client.GetFunctionCRD()
|
||||
if funcCRD == nil {
|
||||
return errors.New("Could not get the Function CRD")
|
||||
}
|
||||
// Any new field added in Function spec can be checked here provided the substring matches the description in CRD Validation of the field
|
||||
if !strings.Contains(funcCRD.Spec.String(), "RequestsPerPod") || !strings.Contains(funcCRD.Spec.String(), "OnceOnly") || !strings.Contains(funcCRD.Spec.String(), "PodSpec") {
|
||||
return errors.New("Apply the newer CRDs before upgrading")
|
||||
}
|
||||
|
||||
return false
|
||||
mqtCRD := client.GetMqtCRD()
|
||||
if mqtCRD == nil {
|
||||
return errors.New("Could not get the MQT CRD")
|
||||
}
|
||||
|
||||
// Any new field added in MQT spec can be checked here provided the substring matches the description in CRD Validation of the field
|
||||
if !strings.Contains(mqtCRD.Spec.String(), "PodSpec") {
|
||||
return errors.New("Apply the newer CRDs before upgrading")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// VerifyFunctionSpecReferences verifies that a function references secrets, configmaps, pkgs in its own namespace and
|
||||
@@ -89,7 +125,7 @@ func (client *PreUpgradeTaskClient) VerifyFunctionSpecReferences() {
|
||||
var fList *fv1.FunctionList
|
||||
|
||||
for i := 0; i < maxRetries; i++ {
|
||||
fList, err = client.fissionClient.CoreV1().Functions(metav1.NamespaceAll).List(metav1.ListOptions{})
|
||||
fList, err = client.fissionClient.CoreV1().Functions(metav1.NamespaceAll).List(context.TODO(), metav1.ListOptions{})
|
||||
if err == nil {
|
||||
break
|
||||
}
|
||||
@@ -132,90 +168,3 @@ func (client *PreUpgradeTaskClient) VerifyFunctionSpecReferences() {
|
||||
|
||||
client.logger.Info("function spec references verified")
|
||||
}
|
||||
|
||||
// deleteClusterRoleBinding deletes the clusterRoleBinding passed as an argument to it.
|
||||
// If its not present, it just ignores and returns no errors
|
||||
func (client *PreUpgradeTaskClient) deleteClusterRoleBinding(clusterRoleBinding string) (err error) {
|
||||
for i := 0; i < maxRetries; i++ {
|
||||
err = client.k8sClient.RbacV1beta1().ClusterRoleBindings().Delete(clusterRoleBinding, &metav1.DeleteOptions{})
|
||||
if err != nil && k8serrors.IsNotFound(err) || err == nil {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// RemoveClusterAdminRolesForFissionSAs deletes the clusterRoleBindings previously created on this cluster
|
||||
func (client *PreUpgradeTaskClient) RemoveClusterAdminRolesForFissionSAs() {
|
||||
clusterRoleBindings := []string{"fission-builder-crd", "fission-fetcher-crd"}
|
||||
for _, clusterRoleBinding := range clusterRoleBindings {
|
||||
err := client.deleteClusterRoleBinding(clusterRoleBinding)
|
||||
if err != nil {
|
||||
client.logger.Fatal("error deleting rolebinding",
|
||||
zap.Error(err),
|
||||
zap.String("role_binding", clusterRoleBinding))
|
||||
}
|
||||
}
|
||||
|
||||
client.logger.Info("femoved cluster admin privileges for fission-builder and fission-fetcher service accounts")
|
||||
}
|
||||
|
||||
// NeedRoleBindings checks if there is atleast one package or function in default namespace.
|
||||
// It is needed to find out if package-getter-rb and secret-configmap-getter-rb needs to be created for fission-fetcher
|
||||
// and fission-builder service accounts.
|
||||
// This is because, we just deleted the ClusterRoleBindings for these service accounts in the previous function and
|
||||
// for the existing functions to work, we need to give these SAs the right privileges
|
||||
func (client *PreUpgradeTaskClient) NeedRoleBindings() bool {
|
||||
pkgList, err := client.fissionClient.CoreV1().Packages(metav1.NamespaceDefault).List(metav1.ListOptions{})
|
||||
if err == nil && len(pkgList.Items) > 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
fnList, err := client.fissionClient.CoreV1().Functions(metav1.NamespaceDefault).List(metav1.ListOptions{})
|
||||
if err == nil && len(fnList.Items) > 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// Setup appropriate role bindings for fission-fetcher and fission-builder SAs
|
||||
func (client *PreUpgradeTaskClient) SetupRoleBindings() {
|
||||
if !client.NeedRoleBindings() {
|
||||
client.logger.Info("no fission objects found, so no role-bindings to create")
|
||||
return
|
||||
}
|
||||
|
||||
// the fact that we're here implies that there had been a prior installation of fission and objects are present still
|
||||
// so, we go ahead and create the role-bindings necessary for the fission-fetcher and fission-builder Service Accounts.
|
||||
err := utils.SetupRoleBinding(client.logger, client.k8sClient, fv1.PackageGetterRB, metav1.NamespaceDefault, fv1.PackageGetterCR, fv1.ClusterRole, fv1.FissionFetcherSA, client.fnPodNs)
|
||||
if err != nil {
|
||||
client.logger.Fatal("error setting up rolebinding for service account",
|
||||
zap.Error(err),
|
||||
zap.String("role_binding", fv1.PackageGetterRB),
|
||||
zap.String("service_account", fv1.FissionFetcherSA),
|
||||
zap.String("service_account_namespace", client.fnPodNs))
|
||||
}
|
||||
|
||||
err = utils.SetupRoleBinding(client.logger, client.k8sClient, fv1.PackageGetterRB, metav1.NamespaceDefault, fv1.PackageGetterCR, fv1.ClusterRole, fv1.FissionBuilderSA, client.envBuilderNs)
|
||||
if err != nil {
|
||||
client.logger.Fatal("error setting up rolebinding for service account",
|
||||
zap.Error(err),
|
||||
zap.String("role_binding", fv1.PackageGetterRB),
|
||||
zap.String("service_account", fv1.FissionBuilderSA),
|
||||
zap.String("service_account_namespace", client.envBuilderNs))
|
||||
}
|
||||
|
||||
err = utils.SetupRoleBinding(client.logger, client.k8sClient, fv1.SecretConfigMapGetterRB, metav1.NamespaceDefault, fv1.SecretConfigMapGetterCR, fv1.ClusterRole, fv1.FissionFetcherSA, client.fnPodNs)
|
||||
if err != nil {
|
||||
client.logger.Fatal("error setting up rolebinding for service account",
|
||||
zap.Error(err),
|
||||
zap.String("role_binding", fv1.SecretConfigMapGetterRB),
|
||||
zap.String("service_account", fv1.FissionFetcherSA),
|
||||
zap.String("service_account_namespace", client.fnPodNs))
|
||||
}
|
||||
|
||||
client.logger.Info("created rolebindings in default namespace",
|
||||
zap.Strings("role_bindings", []string{fv1.PackageGetterRB, fv1.SecretConfigMapGetterRB}))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
FROM alpine:3.14
|
||||
RUN apk add --update ca-certificates
|
||||
COPY reporter /
|
||||
ENTRYPOINT ["/reporter"]
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
Copyright 2021 The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package app
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func App() *cobra.Command {
|
||||
cobra.EnableCommandSorting = false
|
||||
rootCmd := &cobra.Command{
|
||||
Use: "reporter",
|
||||
Short: "Report fission events to analytics service",
|
||||
ValidArgs: []string{"event"},
|
||||
Args: cobra.OnlyValidArgs,
|
||||
}
|
||||
rootCmd.AddCommand(EventCommand())
|
||||
return rootCmd
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
Copyright 2021 The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
package app
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/fission/fission/pkg/tracker"
|
||||
)
|
||||
|
||||
func eventCommandHandler(cmd *cobra.Command, args []string) error {
|
||||
var err error
|
||||
flags := cmd.PersistentFlags()
|
||||
|
||||
event := tracker.Event{}
|
||||
|
||||
event.Category, err = flags.GetString("category")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
event.Action, err = flags.GetString("action")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
event.Label, err = flags.GetString("label")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
event.Value, err = flags.GetString("value")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return tracker.Tracker.SendEvent(event)
|
||||
}
|
||||
|
||||
//EventCommand reports an event to analytics
|
||||
func EventCommand() *cobra.Command {
|
||||
eventCmd := &cobra.Command{
|
||||
Use: "event",
|
||||
Short: "Report event to analytics",
|
||||
RunE: eventCommandHandler,
|
||||
Args: cobra.NoArgs,
|
||||
}
|
||||
persistentFlags := eventCmd.PersistentFlags()
|
||||
persistentFlags.StringP("category", "c", "", "event category")
|
||||
persistentFlags.StringP("action", "a", "", "event action")
|
||||
persistentFlags.StringP("label", "l", "", "event label")
|
||||
persistentFlags.StringP("value", "v", "", "event value")
|
||||
err := eventCmd.MarkPersistentFlagRequired("category")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
err = eventCmd.MarkPersistentFlagRequired("action")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
return eventCmd
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
Copyright 2021 The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/fission/fission/cmd/reporter/app"
|
||||
)
|
||||
|
||||
func main() {
|
||||
err := app.App().Execute()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
# Custom Resource Definitions Reference
|
||||
|
||||
- [CanaryConfig](https://doc.crds.dev/github.com/fission/fission/fission.io/CanaryConfig/v1)
|
||||
- [Environment](https://doc.crds.dev/github.com/fission/fission/fission.io/Environment/v1)
|
||||
- [Function](https://doc.crds.dev/github.com/fission/fission/fission.io/Function/v1)
|
||||
- [HTTPTrigger](https://doc.crds.dev/github.com/fission/fission/fission.io/HTTPTrigger/v1)
|
||||
- [KubernetesWatchTrigger](https://doc.crds.dev/github.com/fission/fission/fission.io/KubernetesWatchTrigger/v1)
|
||||
- [MessageQueueTrigger](https://doc.crds.dev/github.com/fission/fission/fission.io/MessageQueueTrigger/v1)
|
||||
- [Package](https://doc.crds.dev/github.com/fission/fission/fission.io/Package/v1)
|
||||
- [TimeTrigger](https://doc.crds.dev/github.com/fission/fission/fission.io/TimeTrigger/v1)
|
||||
@@ -0,0 +1,81 @@
|
||||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.5.0
|
||||
creationTimestamp: null
|
||||
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
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,112 @@
|
||||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.5.0
|
||||
creationTimestamp: null
|
||||
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 a 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 a independent Fission resource IngressConfig for router to set up Ingress.'
|
||||
properties:
|
||||
annotations:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: Annotations will be add 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: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
||||
@@ -0,0 +1,82 @@
|
||||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.5.0
|
||||
creationTimestamp: null
|
||||
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: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,127 @@
|
||||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.5.0
|
||||
creationTimestamp: null
|
||||
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 (256KB?) 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 (256KB?) 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
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
||||
@@ -0,0 +1,74 @@
|
||||
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.5.0
|
||||
creationTimestamp: null
|
||||
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: {}
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
||||
@@ -0,0 +1,13 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
commonLabels:
|
||||
group: fission.io
|
||||
resources:
|
||||
- fission.io_canaryconfigs.yaml
|
||||
- fission.io_environments.yaml
|
||||
- fission.io_functions.yaml
|
||||
- fission.io_httptriggers.yaml
|
||||
- fission.io_kuberneteswatchtriggers.yaml
|
||||
- fission.io_messagequeuetriggers.yaml
|
||||
- fission.io_packages.yaml
|
||||
- fission.io_timetriggers.yaml
|
||||
@@ -1,12 +1,15 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// Handler is the entry point for this fission function
|
||||
|
||||
func Handler(w http.ResponseWriter, r *http.Request) {
|
||||
func Handler(w http.ResponseWriter, r *http.Request) { //nolint:golint,unused,deadcode
|
||||
msg := "Hello, CNCF Webinar!\n"
|
||||
w.Write([]byte(msg))
|
||||
_, err := w.Write([]byte(msg))
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
FROM golang:onbuild
|
||||
|
||||
WORKDIR /go
|
||||
COPY *.go /go/
|
||||
|
||||
RUN GOOS=linux GOARCH=386 go build -o server .
|
||||
|
||||
FROM alpine:3.5
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apk update
|
||||
RUN apk add coreutils binutils findutils grep
|
||||
|
||||
COPY --from=0 /go/server /app/server
|
||||
|
||||
EXPOSE 8888
|
||||
ENTRYPOINT ["./server"]
|
||||
@@ -1,59 +0,0 @@
|
||||
# Binary Environment Examples
|
||||
|
||||
The `binary` runtime is a go server that uses a subprocess to invoke executables or execute shell scripts.
|
||||
|
||||
Use Cases
|
||||
- Execute bash scripts
|
||||
- Execute arbitrary binaries (such as common sysadmin tools)
|
||||
- Get support in _any_ programming language by executing the generated executable.
|
||||
|
||||
|
||||
⚠️ **Words of Caution** ⚠️
|
||||
|
||||
The environment runs on an alpine image with some additional utility commandline tools installed, such as 'grep'.
|
||||
However, in case you want to make use of more esoteric commandline tools, you should add the relevant apk to the
|
||||
Dockerfile and build a new binary environment. See 'Compiling' for instructions.
|
||||
|
||||
When executing functions using binaries, **ensure that the executable is built for the right architecture**.
|
||||
Using the default binary environment this means that the binary should be build for Linux.
|
||||
|
||||
Looking for ready-to-run examples? See the [binary examples directory](../../examples/binary).
|
||||
|
||||
## Usage
|
||||
To get started with the latest binary environment:
|
||||
|
||||
```bash
|
||||
fission env create --name binary --image fission/binary-env --builder fission/binary-builder
|
||||
```
|
||||
|
||||
The interface to the executable used by this environment is somewhat similar to a [CGI interface](https://en.wikipedia.org/wiki/Common_Gateway_Interface).
|
||||
This means that any HTTP headers are converted to environment variables of the form "HTTP_<header-name>". For example these
|
||||
are some of frequently occurring headers:
|
||||
|
||||
```bash
|
||||
# Request Metadata
|
||||
CONTENT_LENGTH
|
||||
REQUEST_URI
|
||||
REQUEST_METHOD
|
||||
|
||||
# HTTP Headers
|
||||
HTTP_ACCEPT
|
||||
HTTP_USER-AGENT
|
||||
HTTP_CONTENT-TYPE
|
||||
# ...
|
||||
```
|
||||
|
||||
The body of HTTP piped over the STDIN to the executable.
|
||||
All output that is provided to the server over the STDOUT will be transformed into the HTTP response.
|
||||
|
||||
## Compiling
|
||||
|
||||
To build the runtime environment:
|
||||
```bash
|
||||
docker build --tag=${USER}/binary-env .
|
||||
```
|
||||
|
||||
To build the builder environment:
|
||||
```bash
|
||||
(cd builder/ && docker build --tag=${USER}/binary-builder .)
|
||||
```
|
||||
@@ -1,4 +0,0 @@
|
||||
ARG BUILDER_IMAGE=fission/builder:latest
|
||||
FROM ${BUILDER_IMAGE}
|
||||
|
||||
ADD build.sh /usr/local/bin/build
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
apk update
|
||||
|
||||
CWD=$(pwd)
|
||||
|
||||
if [ -f ${SRC_PKG}/build.sh ]; then
|
||||
cd ${SRC_PKG}
|
||||
./build.sh
|
||||
cd ${CWD}
|
||||
fi
|
||||
|
||||
cp -rf ${SRC_PKG} ${DEPLOY_PKG}
|
||||
@@ -1,45 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Utility functions for working with environment variables
|
||||
type Env struct {
|
||||
Vars []*EnvVar
|
||||
}
|
||||
|
||||
type EnvVar struct {
|
||||
Key string
|
||||
Val string
|
||||
}
|
||||
|
||||
func FromString(rawEnvVar string) *EnvVar {
|
||||
parts := strings.SplitN(rawEnvVar, "=", 2)
|
||||
return &EnvVar{parts[0], parts[1]}
|
||||
}
|
||||
|
||||
func (ev *EnvVar) ToString() string {
|
||||
return fmt.Sprintf("%s=%s", ev.Key, ev.Val)
|
||||
}
|
||||
|
||||
func (e *Env) SetEnv(envVar *EnvVar) {
|
||||
e.Vars = append(e.Vars, envVar)
|
||||
}
|
||||
|
||||
func (e *Env) ToStringEnv() []string {
|
||||
var result []string
|
||||
for _, envVar := range e.Vars {
|
||||
result = append(result, envVar.ToString())
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func NewEnv(stringEnv []string) *Env {
|
||||
env := &Env{}
|
||||
for _, rawEnvVar := range stringEnv {
|
||||
env.SetEnv(FromString(rawEnvVar))
|
||||
}
|
||||
return env
|
||||
}
|
||||
@@ -1,178 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const (
|
||||
DEFAULT_CODE_PATH = "/userfunc/user"
|
||||
DEFAULT_INTERNAL_CODE_PATH = "/bin/userfunc"
|
||||
)
|
||||
|
||||
var specialized bool
|
||||
|
||||
type (
|
||||
BinaryServer struct {
|
||||
fetchedCodePath string
|
||||
internalCodePath string
|
||||
}
|
||||
|
||||
FunctionLoadRequest struct {
|
||||
// FilePath is an absolute filesystem path to the
|
||||
// function. What exactly is stored here is
|
||||
// env-specific. Optional.
|
||||
FilePath string `json:"filepath"`
|
||||
|
||||
// FunctionName has an environment-specific meaning;
|
||||
// usually, it defines a function within a module
|
||||
// containing multiple functions. Optional; default is
|
||||
// environment-specific.
|
||||
FunctionName string `json:"functionName"`
|
||||
|
||||
// URL to expose this function at. Optional; defaults
|
||||
// to "/".
|
||||
URL string `json:"url"`
|
||||
}
|
||||
)
|
||||
|
||||
func (bs *BinaryServer) SpecializeHandler(w http.ResponseWriter, r *http.Request) {
|
||||
if specialized {
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
w.Write([]byte("Not a generic container"))
|
||||
return
|
||||
}
|
||||
|
||||
request := FunctionLoadRequest{}
|
||||
|
||||
codePath := bs.fetchedCodePath
|
||||
err := json.NewDecoder(r.Body).Decode(&request)
|
||||
switch {
|
||||
case err == io.EOF:
|
||||
case err != nil:
|
||||
panic(err)
|
||||
}
|
||||
|
||||
if request.FilePath != "" {
|
||||
fileStat, err := os.Stat(request.FilePath)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
codePath = request.FilePath
|
||||
switch mode := fileStat.Mode(); {
|
||||
case mode.IsDir():
|
||||
codePath = filepath.Join(request.FilePath, request.FunctionName)
|
||||
}
|
||||
}
|
||||
|
||||
_, err = os.Stat(codePath)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
w.Write([]byte(codePath + ": not found"))
|
||||
return
|
||||
} else {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
// Future: Check if executable is correct architecture/executable.
|
||||
|
||||
// Copy the executable to ensure that file is executable and immutable.
|
||||
userFunc, err := ioutil.ReadFile(codePath)
|
||||
if err != nil {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
w.Write([]byte("Failed to read executable."))
|
||||
return
|
||||
}
|
||||
err = ioutil.WriteFile(bs.internalCodePath, userFunc, 0555)
|
||||
if err != nil {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
w.Write([]byte("Failed to write executable to target location."))
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println("Specializing ...")
|
||||
specialized = true
|
||||
fmt.Println("Done")
|
||||
}
|
||||
|
||||
func (bs *BinaryServer) InvocationHandler(w http.ResponseWriter, r *http.Request) {
|
||||
if !specialized {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
w.Write([]byte("Generic container: no requests supported"))
|
||||
return
|
||||
}
|
||||
|
||||
// CGI-like passing of environment variables
|
||||
execEnv := NewEnv(nil)
|
||||
execEnv.SetEnv(&EnvVar{"REQUEST_METHOD", r.Method})
|
||||
execEnv.SetEnv(&EnvVar{"REQUEST_URI", r.RequestURI})
|
||||
execEnv.SetEnv(&EnvVar{"CONTENT_LENGTH", fmt.Sprintf("%d", r.ContentLength)})
|
||||
|
||||
for header, val := range r.Header {
|
||||
execEnv.SetEnv(&EnvVar{fmt.Sprintf("HTTP_%s", strings.ToUpper(header)), val[0]})
|
||||
}
|
||||
|
||||
// Future: could be improved by keeping subprocess open while environment is specialized
|
||||
cmd := exec.Command(bs.internalCodePath)
|
||||
cmd.Env = execEnv.ToStringEnv()
|
||||
|
||||
if r.ContentLength != 0 {
|
||||
fmt.Println(r.ContentLength)
|
||||
stdin, err := cmd.StdinPipe()
|
||||
if err != nil {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
w.Write([]byte(fmt.Sprintf("Failed to get STDIN pipe: %s", err)))
|
||||
panic(err)
|
||||
}
|
||||
_, err = io.Copy(stdin, r.Body)
|
||||
if err != nil {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
w.Write([]byte(fmt.Sprintf("Failed to pipe input: %s", err)))
|
||||
}
|
||||
stdin.Close()
|
||||
}
|
||||
|
||||
out, err := cmd.Output()
|
||||
if err != nil {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
w.Write([]byte(fmt.Sprintf("Function error: %s", err)))
|
||||
return
|
||||
}
|
||||
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write(out)
|
||||
}
|
||||
|
||||
func main() {
|
||||
codePath := flag.String("c", DEFAULT_CODE_PATH, "Path to expected fetched executable.")
|
||||
internalCodePath := flag.String("i", DEFAULT_INTERNAL_CODE_PATH, "Path to specialized executable.")
|
||||
flag.Parse()
|
||||
absInternalCodePath, err := filepath.Abs(*internalCodePath)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Printf("Using fetched code path: %s\n", *codePath)
|
||||
fmt.Printf("Using internal code path: %s\n", absInternalCodePath)
|
||||
|
||||
server := &BinaryServer{*codePath, absInternalCodePath}
|
||||
http.HandleFunc("/", server.InvocationHandler)
|
||||
http.HandleFunc("/specialize", server.SpecializeHandler)
|
||||
http.HandleFunc("/v2/specialize", server.SpecializeHandler)
|
||||
|
||||
fmt.Println("Listening on 8888 ...")
|
||||
err = http.ListenAndServe(":8888", nil)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
bin/*
|
||||
obj/*
|
||||
out/*
|
||||
.vscode/*
|
||||
project.lock*
|
||||
TODO_dotnet
|
||||
@@ -1,15 +0,0 @@
|
||||
FROM microsoft/dotnet:1.1-sdk AS builder
|
||||
|
||||
COPY * /proj/
|
||||
RUN cd /proj && ./project-build.sh
|
||||
|
||||
# Build env image
|
||||
FROM microsoft/dotnet:1.1.0-runtime
|
||||
|
||||
WORKDIR /fission-workdir
|
||||
COPY --from=builder /proj/out .
|
||||
EXPOSE 8888
|
||||
|
||||
ENTRYPOINT ["dotnet"]
|
||||
|
||||
CMD ["fission-dotnet.dll"]
|
||||
@@ -1,82 +0,0 @@
|
||||
using Fission.DotNetCore.Compiler;
|
||||
using Fission.DotNetCore.Api;
|
||||
using System.Collections.Generic;
|
||||
using Nancy;
|
||||
using System.IO;
|
||||
using System;
|
||||
|
||||
namespace Fission.DotNetCore
|
||||
{
|
||||
public class ExecutorModule : NancyModule
|
||||
{
|
||||
#if DEBUG
|
||||
private const string CODE_PATH = "/tmp/func.cs";
|
||||
#else
|
||||
private const string CODE_PATH = "/userfunc/user";
|
||||
#endif
|
||||
private static Function _userFunc;
|
||||
private static Logger _logger = new Logger();
|
||||
|
||||
public ExecutorModule()
|
||||
{
|
||||
Post("/specialize", args => Specialize());
|
||||
Get("/", _ => Run());
|
||||
Post("/", _ => Run());
|
||||
Put("/", _ => Run());
|
||||
Head("/", _ => Run());
|
||||
Options("/", _ => Run());
|
||||
Delete("/", _ => Run());
|
||||
}
|
||||
|
||||
private object Specialize()
|
||||
{
|
||||
var errors = new List<string>();
|
||||
if (File.Exists(CODE_PATH))
|
||||
{
|
||||
var code = File.ReadAllText(CODE_PATH);
|
||||
_userFunc = FissionCompiler.Compile(code, out errors);
|
||||
if (_userFunc == null)
|
||||
{
|
||||
var errstr = string.Join(Environment.NewLine, errors);
|
||||
_logger.WriteError(errstr);
|
||||
var response = (Response)errstr;
|
||||
response.StatusCode = HttpStatusCode.InternalServerError;
|
||||
return response;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
var errstr = $"Unable to locate code at '{CODE_PATH}'";
|
||||
_logger.WriteError(errstr);
|
||||
var response = (Response)errstr;
|
||||
response.StatusCode = HttpStatusCode.InternalServerError;
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
private object Run()
|
||||
{
|
||||
if (_userFunc == null)
|
||||
{
|
||||
var response = (Response)"Generic container: no requests supported";
|
||||
response.StatusCode = HttpStatusCode.InternalServerError;
|
||||
return response;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return _userFunc.Invoke(FissionContext.Build(Request, new Logger()));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.WriteError(e.ToString());
|
||||
var response = (Response)e.Message;
|
||||
response.StatusCode = HttpStatusCode.BadRequest;
|
||||
return response;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Loader;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.CSharp;
|
||||
using Microsoft.CodeAnalysis.Emit;
|
||||
|
||||
namespace Fission.DotNetCore.Compiler
|
||||
{
|
||||
//adapted from this article http://www.tugberkugurlu.com/archive/compiling-c-sharp-code-into-memory-and-executing-it-with-roslyn
|
||||
class FissionCompiler
|
||||
{
|
||||
public static Function Compile(string code, out List<string> errors)
|
||||
{
|
||||
errors = new List<string>();
|
||||
|
||||
SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(code);
|
||||
|
||||
string assemblyName = Path.GetRandomFileName();
|
||||
|
||||
var coreDir = Directory.GetParent(typeof(Enumerable).GetTypeInfo().Assembly.Location);
|
||||
|
||||
List<MetadataReference> references = new List<MetadataReference>
|
||||
{
|
||||
MetadataReference.CreateFromFile(coreDir.FullName + Path.DirectorySeparatorChar + "mscorlib.dll"),
|
||||
MetadataReference.CreateFromFile(typeof(object).GetTypeInfo().Assembly.Location),
|
||||
MetadataReference.CreateFromFile(Assembly.GetEntryAssembly().Location),
|
||||
MetadataReference.CreateFromFile(typeof(System.Runtime.Serialization.Json.DataContractJsonSerializer).GetTypeInfo().Assembly.Location)
|
||||
};
|
||||
|
||||
foreach (var referencedAssembly in Assembly.GetEntryAssembly().GetReferencedAssemblies())
|
||||
{
|
||||
var assembly = Assembly.Load(referencedAssembly);
|
||||
references.Add(MetadataReference.CreateFromFile(assembly.Location));
|
||||
}
|
||||
|
||||
CSharpCompilation compilation = CSharpCompilation.Create(
|
||||
assemblyName,
|
||||
syntaxTrees: new[] { syntaxTree },
|
||||
references: references,
|
||||
options: new CSharpCompilationOptions(
|
||||
OutputKind.DynamicallyLinkedLibrary,
|
||||
optimizationLevel: OptimizationLevel.Release));
|
||||
|
||||
using (var ms = new MemoryStream())
|
||||
{
|
||||
EmitResult result = compilation.Emit(ms);
|
||||
|
||||
if (!result.Success)
|
||||
{
|
||||
IEnumerable<Diagnostic> failures = result.Diagnostics.Where(diagnostic =>
|
||||
diagnostic.IsWarningAsError ||
|
||||
diagnostic.Severity == DiagnosticSeverity.Error).ToList();
|
||||
|
||||
foreach (Diagnostic diagnostic in failures)
|
||||
{
|
||||
errors.Add($"{diagnostic.Id}: {diagnostic.GetMessage()}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ms.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
Assembly assembly = AssemblyLoadContext.Default.LoadFromStream(ms);
|
||||
var type = assembly.GetType("FissionFunction");
|
||||
var info = type.GetMember("Execute").First() as MethodInfo;
|
||||
return new Function(assembly, type, info);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Text;
|
||||
using Nancy;
|
||||
|
||||
namespace Fission.DotNetCore.Api
|
||||
{
|
||||
public class FissionContext
|
||||
{
|
||||
public FissionContext(Dictionary<string, object> args, Logger logger, FissionHttpRequest request)
|
||||
{
|
||||
if (args == null) throw new ArgumentNullException(nameof(args));
|
||||
if (logger == null) throw new ArgumentNullException(nameof(logger));
|
||||
if (request == null) throw new ArgumentNullException(nameof(request));
|
||||
Arguments = args;
|
||||
Logger = logger;
|
||||
Request = request;
|
||||
}
|
||||
|
||||
public Dictionary<string, object> Arguments { get; private set; }
|
||||
|
||||
public FissionHttpRequest Request { get; private set; }
|
||||
|
||||
public Logger Logger { get; private set; }
|
||||
|
||||
public static FissionContext Build(Request request, Logger logger)
|
||||
{
|
||||
return new FissionContext(((DynamicDictionary)request.Query).ToDictionary(),
|
||||
logger,
|
||||
new FissionHttpRequest(request));
|
||||
}
|
||||
}
|
||||
|
||||
public class Logger
|
||||
{
|
||||
public void Write(Severity severity, string format, params object[] args)
|
||||
{
|
||||
Console.WriteLine($"{DateTime.Now.ToString("MM/dd/yy H:mm:ss zzz")} {severity}: " + format, args);
|
||||
}
|
||||
|
||||
public void WriteInfo(string format, params object[] args)
|
||||
{
|
||||
Write(Severity.Info, format, args);
|
||||
}
|
||||
|
||||
public void WriteWarning(string format, params object[] args)
|
||||
{
|
||||
Write(Severity.Warning, format, args);
|
||||
}
|
||||
|
||||
public void WriteError(string format, params object[] args)
|
||||
{
|
||||
Write(Severity.Error, format, args);
|
||||
}
|
||||
|
||||
public void WriteCritical(string format, params object[] args)
|
||||
{
|
||||
Write(Severity.Critical, format, args);
|
||||
}
|
||||
|
||||
public void WriteVerbose(string format, params object[] args)
|
||||
{
|
||||
Write(Severity.Verbose, format, args);
|
||||
}
|
||||
}
|
||||
|
||||
public enum Severity
|
||||
{
|
||||
Info,
|
||||
Warning,
|
||||
Error,
|
||||
Critical,
|
||||
Verbose
|
||||
}
|
||||
|
||||
public class FissionHttpRequest
|
||||
{
|
||||
private readonly Request _request;
|
||||
internal FissionHttpRequest(Request request)
|
||||
{
|
||||
if (request == null) throw new ArgumentNullException(nameof(request));
|
||||
_request = request;
|
||||
}
|
||||
|
||||
public Stream Body { get { return _request.Body; } }
|
||||
|
||||
public string BodyAsString()
|
||||
{
|
||||
int length = (int)_request.Body.Length;
|
||||
byte[] data = new byte[length];
|
||||
_request.Body.Read(data, 0, length);
|
||||
return Encoding.UTF8.GetString(data);
|
||||
}
|
||||
|
||||
public Dictionary<string, IEnumerable<string>> Headers
|
||||
{
|
||||
get
|
||||
{
|
||||
var headers = new Dictionary<string, IEnumerable<string>>();
|
||||
foreach (var kv in _request.Headers)
|
||||
{
|
||||
headers.Add(kv.Key, kv.Value);
|
||||
}
|
||||
return headers;
|
||||
}
|
||||
}
|
||||
|
||||
public X509Certificate Certificate { get { return _request.ClientCertificate; } }
|
||||
public string Url { get { return _request.Url.ToString(); } }
|
||||
public string Method { get { return _request.Method; } }
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using Fission.DotNetCore.Api;
|
||||
|
||||
namespace Fission.DotNetCore.Compiler
|
||||
{
|
||||
class Function
|
||||
{
|
||||
private readonly Assembly _assembly;
|
||||
private readonly Type _type;
|
||||
private readonly MethodInfo _info;
|
||||
|
||||
public Function(Assembly assembly, Type type, MethodInfo info)
|
||||
{
|
||||
if (info == null) throw new ArgumentNullException(nameof(info));
|
||||
if (assembly == null) throw new ArgumentNullException(nameof(assembly));
|
||||
if (type == null) throw new ArgumentNullException(nameof(type));
|
||||
_assembly = assembly;
|
||||
_type = type;
|
||||
_info = info;
|
||||
}
|
||||
|
||||
public object Invoke(FissionContext context)
|
||||
{
|
||||
return _info.Invoke(_assembly.CreateInstance(_type.FullName), new[] { context });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
using System.IO;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Nancy.Owin;
|
||||
|
||||
namespace Fission.DotNetCore
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
var host = new WebHostBuilder()
|
||||
.UseContentRoot(Directory.GetCurrentDirectory())
|
||||
.UseKestrel()
|
||||
.UseUrls("http://*:8888")
|
||||
.Configure(app => app.UseOwin(x => x.UseNancy()))
|
||||
.Build();
|
||||
host.Run();
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user