/c8s

Codius-less: web-monetized serverless Kubernetes add-on

Primary LanguageTypeScriptApache License 2.0Apache-2.0

Codiusless (c8s) Host

c8s is the hosting component of serverless Codius

CircleCI JavaScript Style Guide Known Vulnerabilities Gitter chat

Codius is an open-source decentralized hosting platform using Interledger (ILP). It allows anyone to run software on servers all over the world and pay using any currency. Users package their software inside of containers.

c8s (this software) is the serverless hosting component. You can run c8s in your Kubernetes (k8s) cluster and users will pay you via Web Monetization to run their serverless, request-triggered software. c8s uses Kata Containers to provide hardware-level isolation between different containers. Network isolation can be achieved with Kubernetes network policies using a plugin like Calico.

Prerequisites

Installation

c8s is designed to run within your Kubernetes cluster. It can run as a Knative service, however you will need to configure the cluster routing to send subdomain requests to c8s.

c8s must run with a service account bound to the following role and cluster role:

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: c8s
  namespace: c8s-untrusted # see CODIUS_K8S_NAMESPACE below
rules:
- apiGroups: ["serving.knative.dev"]
  resources: ["services"]
  verbs: ["create", "watch"]
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: c8s
rules:
- apiGroups: ["apiextensions.k8s.io"]
  resources: ["customresourcedefinitions"]
  verbs: ["get"]

You can use the c8s installer to run a local Kubernetes cluster with c8s.

Environment Variables

CODIUS_PORT

  • Type: Number
  • Description: The port that c8s will listen on.
  • Default: 3000

CODIUS_PUBLIC_URI

  • Type: String
  • Description: The public URI resolving to this instance of c8s.
  • Default: http://local.codius.org:CODIUS_PORT

CODIUS_BIND_IP

  • Type: String
  • Description: The IP address the server will listen on.
  • Default: 127.0.0.1

CODIUS_PAYMENT_POINTER

  • Type: String
  • Description: Interledger payment pointer at which to receive payments.

CODIUS_K8S_NAMESPACE

  • Type: String
  • Description: Kubernetes namespace in which to deploy user containers
  • Default: 'default'

CODIUS_K8S_SERVICE_ACCOUNT

  • Type: String
  • Description: Kubernetes service account used for deployed user containers
  • Default: 'default'

License

Apache-2.0