/kuberest

A kubernetes RESTfull api controller

Primary LanguageRustApache License 2.0Apache-2.0

Configure applications and their relationship from kubernetes

logo Rust Kubernetes

Apache licensed ci docker image

This repository contains a custom Kubernetes controller that can create/update/delete REST object on RESTfull api-endpoint. The main goal is to not write a post-install Job filled with curl commands ever again for my applications deployments on Kubernetes. Inspirations come from the excellent restapi terraform provider and Tekton.

Use cases

  • Configure OpenID applications in most ID-provider to provide seamless integration between applications
  • Configure your own forge projects
  • Configure any application that provide REST endpoints (that's a lot of them)

Installation

(TL;DR: kubectl apply -k github.com/sebt3/kuberest//deploy)

Since this is a kubernetes operator, the installations steps are:

  • first the CustomResourceDefinition
  • then the operator controlling the ressources

Feel free to pick any of the installtions options for both.

CRD

kubectl

kubectl apply -f deploy/crd/crd.yaml

kustomize

kubectl apply -k github.com/sebt3/kuberest//deploy/crd

Operator

kubectl

helm template charts/kuberest | kubectl apply -f -
kubectl wait --for=condition=available deploy/kuberest --timeout=30s

kustomize

kubectl create ns kuberest
kubectl apply -k github.com/sebt3/kuberest//deploy/operator
kubectl wait -n kuberest --for=condition=available deploy/kuberest --timeout=30s

helm

helm repo add kuberest https://sebt3.github.io/kuberest/
kubectl create ns kuberest
helm install kuberest/kuberest kuberest --namespace kuberest
kubectl wait -n kuberest --for=condition=available deploy/kuberest --timeout=30s

Tenant aware

The controller can either function per-tenant (refuse to read secrets from namespace that doesnt share the same label mostly) or behave globally. The default behaviour is to limit to current tenant, to activate, set the environement variable MULTI_TENANT to false (or tenants.enabled=false for the chart). You can also select the common label value using the variable TENANT_LABEL (or tenants.label for the chart).

Usage

Please see the documentation