mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Merge pull request #204 from fnproject/private-lb
kubernetes: add instructions for private services
This commit is contained in:
@@ -43,9 +43,20 @@ Note `a23122e39900111e681ba0e29b70bb46-630391493.us-east-1.elb.amazonaws.com` in
|
||||
|
||||
3. Test the cluster:
|
||||
|
||||
If you are using a Kubernetes setup that can expose a public loadbalancer run:
|
||||
```ShellSession
|
||||
$ export FUNCTIONS=$(kubectl get -o json svc functions | jq -r '.status.loadBalancer.ingress[0].hostname'):8080
|
||||
```
|
||||
|
||||
If you are using a Kubernetes setup like minikube run
|
||||
```ShellSession
|
||||
$ export ns=default ; export label='app=functions'; kubectl -n $ns get pod -l $label -o jsonpath='{.items[0].metadata.name}' | xargs -I{} kubectl -n $ns port-forward {} 8080:8080
|
||||
$ export FUNCTIONS=localhost:8080
|
||||
```
|
||||
|
||||
Now setup the functions:
|
||||
|
||||
```ShellSession
|
||||
$ curl -H "Content-Type: application/json" -X POST -d '{ "app": { "name":"myapp" } }' http://$FUNCTIONS/v1/apps
|
||||
{"message":"App successfully created","app":{"name":"myapp","config":null}}
|
||||
|
||||
@@ -107,4 +118,4 @@ $ curl -H "Content-Type: application/json" -X POST -d '{ "route": { "type": "syn
|
||||
|
||||
$ curl -H "Content-Type: application/json" -X POST -d '{ "name":"Johnny" }' http://$FUNCTIONS/r/myapp/hello-sync
|
||||
Hello Johnny!
|
||||
```
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user