Giter Club home page Giter Club logo

lise's Introduction

Getting started

A running Kubernetes cluster is required.

Serverful

Istio should be installed in your cluster.

  • kubectl apply -R -f ./k8s/serverful
  • export NAMESPACE="lise-serverful" RELEASE_NAME="mercury" NODE_IP="192.168.1.221" GATEWAY_NODE_PORT=31380
  • helm init --service-account tiller --history-max 200 --tiller-namespace $NAMESPACE
  • kubectl label namespace $NAMESPACE istio-injection=enabled
  • helm charts/lise-serverful --tiller-namespace $NAMESPACE --namespace $NAMESPACE --name $RELEASE_NAME --dep-up

Then you can test the release by running the following command:

curl -v -d '{"name":"usb key", "quantity":3, "unitPrice": 5}' \
  -H "Content-Type: application/json" \
  -X POST "http://$NODE_IP:$GATEWAY_NODE_PORT/orders"

Serverless

OpenFaas should be installed in your cluster.

  • kubectl apply -R -f ./k8s/serverless
  • export NODE_IP="192.168.1.221" GATEWAY_NODE_PORT=31112 OF_NAMESPACE=openfaas RELEASE=mercury
  • helm init --tiller-namespace $OF_NAMESPACE --service-account tiller
  • helm install ./charts/lise-serverless --dep-up --name $RELEASE --namespace $OF_NAMESPACE --tiller-namespace $OF_NAMESPACE
  • faas-cli up -f ./src/serverless/stack.yaml

You can test the release by running the following command:

helm test $RELEASE --tiller-namespace $OF_NAMESPACE --cleanup --parallel

You can also test the functions:

curl -v -d '{"name":"usb key", "quantity":3, "unitPrice": 5}' \
  -H "Content-Type: application/json" \
  -X POST "http://$NODE_IP:$GATEWAY_NODE_PORT/function/order"

You can see the two functions been triggered on the gateway ui: http://$NODE_IP:$GATEWAY_NODE_PORT/ui

The payment function has been triggered by a message sended at the kafka topic orders by the order function.

Todo

  • Setup Helm authentication context
  • Setup TLS

Serverful

  • Circuit Breaking
  • Fault Injection
  • Security Policies (rate limit...)
  • Autoscaling
  • Metrics, logs, tracing visualization

Serverless

  • Monitoring: set up Prometheus and Grafana
  • Logging: set up Loki with OpenFaas
  • CRUD example

Commands reminder

  • Enable automatic sidecar injections: kubectl label namespace $NAMESPACE istio-injection=enabled
  • Deploy without a sidecar: ... spec.template.metadata.annotations."sidecar\.istio\.io/inject"="false"
  • Read Kafka messages: /opt/bitnami/kafka/bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic $TOPIC --from-beginning in the kafka pod

lise's People

Watchers

James Cloos avatar Guillaume Soufflet avatar Florian Bobin avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.