Skip to content

glasskube/operator

Repository files navigation

GitHub Repo stars Docker Pulls


Glasskube Logo

Kubernetes Operator

Open Source Tools on autopilot

Explore our website Β»

GitHub . Docker Hub . LinkedIn


Getting started

Requirements

Local Kubernetes setup

Minikube is the recommended way on starting a cluster for local development.

minikube profile glasskube # (optional)
minikube start

Tasks

Applying Custom Resource Definitions

This task uses your current kubectl context.

./gradlew installCrd

Running the Operator

The operator is started locally and connects to your current kubectl context. As Glasskube might get installed in different namespaces, we need to fetch the current namespace form the Kubernetes API. For local development we can manually overwrite this with by setting the environment variable NAMESPACE=glasskube-system.

./gradlew run

Pushing an image to local minikube

When using Minikube for development, you can push a snapshot of the operator to the cluster:

./gradlew loadImage

Deployment

To deploy the operator and related RBAC resources, you can use the resources in deploy/. The easiest method of installation is the deploy.sh script. It will automatically install dependencies, CRDs and the Glasskube operator. You can choose to let the operator manage custom resources in the entire cluster or just a single namespace.

Note Installing CRDs still requires cluster-wide permissions.

Run the script like this:

# Cluster-wide deployment of version X.Y.Z of the Glasskube operator 
deploy/deploy.sh -v X.Y.Z
# Deployment restricted to the namespace glasskube-apps 
deploy/deploy.sh -v X.Y.Z -n glasskube-apps

You can find the latest version on GitHub or Docker Hub.

Custom Resources

The operator currently supports following custom resources:

HttpEcho Kubernetes Operator

HttpEcho.yaml

apiVersion: "glasskube.eu/v1alpha1"
kind: HttpEcho
metadata:
  name: echo
  namespace: default
spec:
  text: MTL Demo 🧊

http-echo is a simple go web server that returns preconfigured text. The Glasskube operator will create a deployment, service and ingress based on the applied custom resource. The Webserver is reachable via http://echo.minikube.

Matomo Kubernetes Operator

Matomo logo

Matomo.yaml

apiVersion: "glasskube.eu/v1alpha1"
kind: Matomo
metadata:
  name: matomo
  namespace: matomo
spec:
  host: matomo.minikube

Matomo is an Open-Source Web Analytics Tool written in PHP and stores data in MySQL database. The Glasskube Operator will automatically perform Upgrades and manages the database. Make sure you also have the mariadb-operator installed. After applying the custom resource Matomo will be reachable via an ingress at the configured host.

Odoo Kubernetes Operator

Odoo logo

Odoo.yaml

apiVersion: "glasskube.eu/v1alpha1"
kind: Odoo
metadata:
  name: odoo
  namespace: odoo
spec:
  host: odoo.minikube

Odoo is an Open-Source suite of web based business apps written in Python and stores data in a PostgreSQL database. The Glasskube Operator will automatically perform Upgrades and manages the database. Make sure you also have the cnpg-operator installed. After applying the custom resource Odoo will be reachable via an ingress at the configured host. Daily database backups are stored in an integrated S3 compatible MinIO bucket inside the glasskube-system namespace.

Related projects

How to Contribute

See the contributing guide for detailed instructions.

Also join our architecture discussion on GitHub.

Supported by