Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jwendell/fnkube
Runs a docker image in a kubernetes cluster and prints its output
https://github.com/jwendell/fnkube
functions-as-a-service golang kubernetes openshift
Last synced: about 1 month ago
JSON representation
Runs a docker image in a kubernetes cluster and prints its output
- Host: GitHub
- URL: https://github.com/jwendell/fnkube
- Owner: jwendell
- License: mit
- Created: 2017-03-28T18:31:08.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-03-28T19:31:46.000Z (over 7 years ago)
- Last Synced: 2024-08-01T22:53:27.840Z (3 months ago)
- Topics: functions-as-a-service, golang, kubernetes, openshift
- Language: Go
- Size: 12.9 MB
- Stars: 9
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Function as a service - kubernetes
### Runs a docker image in a kubernetes cluster and prints its output```sh
$ go get github.com/jwendell/fnkube# Runs the perl image and prints π with 100 places
$ fnkube -image perl -- perl "-Mbignum=bpi" -wle "print bpi(100)"
3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117068
```
Run `fnkube -help` for more options and examples.### Concepts behind it
What `fnkube` does it really simple: It just spawns a [Kubernetes Job](https://kubernetes.io/docs/concepts/jobs/run-to-completion-finite-workloads/) that runs the specified image in a container and grabs its output. After that it deletes the `Job` and `pods` created for this task, unless it's told to not do this (`-cleanup=false` option).
All you need is a kubernetes (or openshift) instance available and permissions to access it.### As a library
You can incorporate `fnkube` into a bigger application just by importing `"github.com/jwendell/fnkube/pkg/fnkube"` and calling the function `fnkube.Run(options)` whereas `options` is the struct `fnkube.Options`. Take a look at how [main.go](https://github.com/jwendell/fnkube/blob/master/main.go) uses it.