useless

module
v0.0.0-...-c188902 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2019 License: MIT

README

Useless

A simple useless 'FaaS' framework build on top of Kubernetes, since it is useless, hard coded things were everywhere.

Just for learning, play with it:

# If you want to run ./hack/update-codegen.sh, you must:
#  - go get -u k8s.io/code-generator/cmd/...
#  - put the current project under /path/to/github.com/damnever/, that is a known issue for code-generator
git clone git@github.com:damnever/useless.git && cd useless

# NOTE: minikube may fail to set up the cluster if --memory too small(e.g. 1024)..
kubectl create namespace useless
kubectl config set-context --current --namespace=useless
# Create CRD
kubectl create -f ./artifacts/function-definition.yaml
# Create controller to deal with CRD
kubectl create -f ./artifacts/controller-deployment.yaml


make build-cli
# ./bin/useless-cli -build ./artifacts/what_the_commits.go::WhatTheCommits  # build and push function image
./bin/useless-cli -create ./artifacts/what_the_commits.go::WhatTheCommits

# Ingress maybe a good choice, anyway..
kubectl get services
kubectl port-forward service/whatthecommits 8080:80
curl -H "Content-Type: application/json" -X POST -d '{"input":"{\"count\":3}"}' http://localhost:8080


# Clean up
# Or you can make the process slower..
# - ./bin/useless-cli -delete whatthecommits
# - kubectl delete -f ./artifacts/controller-deployment.yaml
# - kubectl delete -f ./artifacts/function-definition.yaml
kubectl delete namespace useless

Directories

Path Synopsis
cmd
cli
pkg
generated/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
generated/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
generated/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
generated/clientset/versioned/typed/useless/v1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
generated/clientset/versioned/typed/useless/v1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL