Default values for FISSION_* env vars (#518)

This makes set up easier for new users.  Users can still set
FISSION_NAMESPACE but it will default to "fission".  Users can also
still set KUBECONFIG, but it will default to $HOME/.kube/config.

Also, update the post-install chart notes.txt and the install guide to
use "fission function test" as the first step after install.  This
means that if there's anything wrong with the setup, the user will see
useful errors instead of "internal server error".  Also, they can test
their setup without worrying about nodeports or ingresses or whatever.

All existing functionality of FISSION_URL and FISSION_ROUTER continues
to work.
This commit is contained in:
Soam Vasani
2018-02-28 18:14:57 -08:00
committed by GitHub
parent b895f98e88
commit 7ddbea59a2
10 changed files with 90 additions and 166 deletions
+6 -36
View File
@@ -9,47 +9,17 @@ Linux:
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/0.5.0/fission-cli-windows.exe
2. Set the FISSION environment variables.
{{- if contains "NodePort" .Values.serviceType }}
$ export FISSION_URL=http://$(minikube ip):{{ .Values.controllerPort }}
{{- else if contains "LoadBalancer" .Values.serviceType }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl --namespace fission get -w svc' and 'kubectl --namespace fission get svc -w controller'
$ export FISSION_URL=http://$(kubectl --namespace fission get svc controller -o=jsonpath='{..ip}')
{{- else if contains "ClusterIP" .Values.serviceType }}
$ export FISSION_NAMESPACE={{ .Release.Namespace }}
$ export KUBECONFIG=${HOME}/.kube/config
{{- end }}
{{- if contains "NodePort" .Values.routerServiceType }}
$ export FISSION_ROUTER=$(minikube ip):{{ .Values.routerPort }}
{{- else if contains "LoadBalancer" .Values.routerServiceType }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status by running 'kubectl --namespace fission get -w svc' and 'kubectl --namespace fission get svc -w router'
$ export FISSION_ROUTER=$(kubectl --namespace fission get svc router -o=jsonpath='{..ip}')
{{- else if contains "ClusterIP" .Values.routerServiceType }}
$ export KUBECONFIG=${HOME}/.kube/config
$ curl -Lo port-forward-router.sh https://github.com/fission/fission/port-forward-router.sh && chmod +x port-forward-router.sh && ./port-forward-router.sh {{ .Release.Namespace }} router 9999
$ export FISSION_ROUTER=127.0.0.1:9999
{{- end }}
3. Finally, you're ready to use Fission!
2. You're ready to use Fission!
# Create an environment
$ 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
# Register this function with Fission
$ fission function create --name hello --env nodejs --code hello.js
$ fission route create --method GET --url /hello --function hello
$ curl http://$FISSION_ROUTER/hello
# Run this function
$ fission function test --name hello
Hello, world!
@@ -168,6 +168,7 @@ spec:
template:
metadata:
labels:
application: fission-router
svc: router
spec:
containers:
+2
View File
@@ -4,6 +4,7 @@ metadata:
name: router
labels:
svc: router
application: fission-router
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
spec:
type: {{ .Values.routerServiceType }}
@@ -23,6 +24,7 @@ metadata:
name: controller
labels:
svc: controller
application: fission-api
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
spec:
type: {{ .Values.serviceType }}
+6 -36
View File
@@ -9,47 +9,17 @@ Linux:
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/0.5.0/fission-cli-windows.exe
2. Set the FISSION_URL and FISSION_ROUTER environment variables.
{{- if contains "NodePort" .Values.serviceType }}
$ export FISSION_URL=http://$(minikube ip):{{ .Values.controllerPort }}
{{- else if contains "LoadBalancer" .Values.serviceType }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl --namespace fission get -w svc' and 'kubectl --namespace fission get svc -w controller'
$ export FISSION_URL=http://$(kubectl --namespace fission get svc controller -o=jsonpath='{..ip}')
{{- else if contains "ClusterIP" .Values.serviceType }}
$ export FISSION_NAMESPACE={{ .Release.Namespace }}
$ export KUBECONFIG=${HOME}/.kube/config
{{- end }}
{{- if contains "NodePort" .Values.routerServiceType }}
$ export FISSION_ROUTER=$(minikube ip):{{ .Values.routerPort }}
{{- else if contains "LoadBalancer" .Values.routerServiceType }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status by running 'kubectl --namespace fission get -w svc' and 'kubectl --namespace fission get svc -w router'
$ export FISSION_ROUTER=$(kubectl --namespace fission get svc router -o=jsonpath='{..ip}')
{{- else if contains "ClusterIP" .Values.routerServiceType }}
$ export KUBECONFIG=${HOME}/.kube/config
$ curl -Lo port-forward-router.sh https://github.com/fission/fission/port-forward-router.sh && chmod +x port-forward-router.sh && ./port-forward-router.sh {{ .Release.Namespace }} router 9999
$ export FISSION_ROUTER=127.0.0.1:9999
{{- end }}
3. Finally, you're ready to use Fission!
2. You're ready to use Fission!
# Create an environment
$ 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
# Register this function with Fission
$ fission function create --name hello --env nodejs --code hello.js
$ fission route create --method GET --url /hello --function hello
$ curl http://$FISSION_ROUTER/hello
# Run this function
$ fission function test --name hello
Hello, world!
@@ -168,6 +168,7 @@ spec:
template:
metadata:
labels:
application: fission-router
svc: router
spec:
containers:
+2
View File
@@ -4,6 +4,7 @@ metadata:
name: router
labels:
svc: router
application: fission-router
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
spec:
type: {{ .Values.routerServiceType }}
@@ -23,6 +24,7 @@ metadata:
name: controller
labels:
svc: controller
application: fission-api
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
spec:
type: {{ .Values.serviceType }}