Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openfaas-faas
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Team Jaz CS 598 CCC Final Project
openfaas-faas
Commits
907a55f6
Commit
907a55f6
authored
7 years ago
by
Alex Ellis
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Create deployment_k8s.md
parent
b6002e1c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
guide/deployment_k8s.md
+72
-0
72 additions, 0 deletions
guide/deployment_k8s.md
with
72 additions
and
0 deletions
guide/deployment_k8s.md
0 → 100644
+
72
−
0
View file @
907a55f6
# Deployment guide for Kubernetes
> Note: The best place to start is the README file in the faas or faas-netes repo.
## Kubernetes
### Build a cluster
You can start evaluating FaaS and building functions on your laptop or on a VM (cloud or on-prem).
*
[
10 minute guides for minikube / kubeadm
](
https://blog.alexellis.io/tag/k8s/
)
### Deploy OpenFaaS
*
Clone the code
```
$ git clone https://github.com/alexellis/faas-netes
```
*
Deploy the services
```
$ cd faas-netes
$ kubectl apply -f ./faas.yml,monitoring.yml,rbac.yml
```
That's it. You now have OpenFaaS deployed.
For simplicity the default configuration uses NodePorts rather than an IngressController (which is more complicated to setup).
| Service | TCP port |
--------------------|----------|
| API Gateway / UI | 31112 |
| Prometheus | 31119 |
> If you're an advanced Kubernetes user, you can add an IngressController to your stack and remove the NodePort assignments.
*
Deploy a sample function
There are currently no sample functions built into this stack, but we can deploy them quickly via the UI or FaaS-CLI.
**Use the CLI**
Follow the tutorial below, but change your gateway URL from localhost:8080 to kubernetes-node-ip:31112
i.e.
```
provider:
name: faas
gateway: http://192.168.4.95:31112
```
[
Your first serverless Python function with OpenFaaS
](
https://blog.alexellis.io/first-faas-python-function/
)
You can also deploy the samples from the
[
FaaS-cli
](
https://github.com/alexellis/faas-cli
)
, but change the gateway address as above.
**Use the UI**
Click "New Function" and fill it out with the following:
| Field | Value |
-------------|------------------------------|
| Service | nodeinfo |
| Image | functions/nodeinfo:latest |
| fProcess | node main.js |
| Network | default |
*
Test the function
Your function will appear after a few seconds and you can click "Invoke"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment