All Projects → side8 → k8s-operator

side8 / k8s-operator

Licence: Apache-2.0 license
Write simple Kubernetes operators in a few lines of bash (or your favourite language)

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to k8s-operator

astarte-kubernetes-operator
Astarte Kubernetes Operator
Stars: ✭ 18 (-37.93%)
Mutual labels:  kubernetes-operator
KubeContext
Mac MenuBar App for Switching your K8s Context
Stars: ✭ 15 (-48.28%)
Mutual labels:  kubernetes-operator
kubereplay
Seamless integration of goReplay and Kubernetes
Stars: ✭ 30 (+3.45%)
Mutual labels:  kubernetes-operator
secret-backup-operator
Kubernetes operator for backing up secrets
Stars: ✭ 13 (-55.17%)
Mutual labels:  kubernetes-operator
mysql-operator
Asynchronous MySQL Replication on Kubernetes using Percona Server and Openark's Orchestrator.
Stars: ✭ 810 (+2693.1%)
Mutual labels:  kubernetes-operator
oracle-database-operator
The Oracle Database Operator for Kubernetes (a.k.a. OraOperator) helps developers, DBAs, DevOps and GitOps teams reduce the time and complexity of deploying and managing Oracle Databases. It eliminates the dependency on a human operator or administrator for the majority of database operations.
Stars: ✭ 74 (+155.17%)
Mutual labels:  kubernetes-operator
abstract-operator
Library/SDK for creating the operators for Kubernetes and Openshift.
Stars: ✭ 60 (+106.9%)
Mutual labels:  kubernetes-operator
secureCodeBox-v2
This Repository contains the stable beta preview of the next major secureCodeBox (SCB) release v2.0.0.
Stars: ✭ 23 (-20.69%)
Mutual labels:  kubernetes-operator
custom-pod-autoscaler-operator
Operator for managing Kubernetes Custom Pod Autoscalers (CPA).
Stars: ✭ 29 (+0%)
Mutual labels:  kubernetes-operator
cloudformation-operator
A Kubernetes operator for managing CloudFormation stacks via a CustomResource
Stars: ✭ 98 (+237.93%)
Mutual labels:  kubernetes-operator
varnish-operator
Run and manage Varnish clusters on Kubernetes
Stars: ✭ 47 (+62.07%)
Mutual labels:  kubernetes-operator
td-redis-operator
一款强大的云原生redis-operator,经过大规模生产级运行考验,支持分布式集群、支持主备切换等缓存集群解决方案…The powerful cloud-native redis-operator, which has passed the test of large-scale production-level operation, supports distributed clusters and active/standby switching ...
Stars: ✭ 327 (+1027.59%)
Mutual labels:  kubernetes-operator
mloperator
Machine Learning Operator & Controller for Kubernetes
Stars: ✭ 85 (+193.1%)
Mutual labels:  kubernetes-operator
kubeflare
A Kubernetes Operator to manage Cloudflare settings via a declarative Kubernetes API
Stars: ✭ 50 (+72.41%)
Mutual labels:  kubernetes-operator
k6-operator
An operator for running distributed k6 tests.
Stars: ✭ 170 (+486.21%)
Mutual labels:  kubernetes-operator
kubectlsafe
Safe operations in kubectl with plugin kubectlsafe
Stars: ✭ 36 (+24.14%)
Mutual labels:  kubernetes-operator
nifikop
The NiFiKop NiFi Kubernetes operator makes it easy to run Apache NiFi on Kubernetes. Apache NiFI is a free, open-source solution that support powerful and scalable directed graphs of data routing, transformation, and system mediation logic.
Stars: ✭ 122 (+320.69%)
Mutual labels:  kubernetes-operator
spark-operator
Operator for managing the Spark clusters on Kubernetes and OpenShift.
Stars: ✭ 129 (+344.83%)
Mutual labels:  kubernetes-operator
cdap-operator
CDAP Kubernetes Operator
Stars: ✭ 17 (-41.38%)
Mutual labels:  kubernetes-operator
grafana-operator
An operator for Grafana that installs and manages Grafana instances, Dashboards and Datasources through Kubernetes/OpenShift CRs
Stars: ✭ 449 (+1448.28%)
Mutual labels:  kubernetes-operator

k8s-operator

Write simple Kubernetes operators in a few lines of bash (or your favourite language).

Currently you should only run one copy per controller as there is no locking and the behaviour of 2 is undefined.

Getting started

Create your CRD

$ cat es-crd.yaml
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: elasticsearchs.db.side8.io
Description: ElasticSearch
spec:
  group: db.side8.io
  version: v1
  scope: Namespaced
  names:
    kind: ElasticSearch
    singular: elasticsearch
    plural: elasticsearchs
    shortNames:
      - es
$ kubectl apply -f es-crd.yaml

create your apply and delete scripts:

echo "env | grep K8S >&2" > apply ; chmod +x apply
echo "env | grep K8S >&2" > delete ; chmod +x delete

run your operator in a dedicated terminal:

side8-k8s-operator --fqdn=db.side8.io --version=v1 --resource=elasticsearchs

create a custom resource and see the environment variables made available to your script:

$ cat es-test-cluster.yaml
apiVersion: "db.side8.io/v1"
kind: ElasticSearch
metadata:
  name: es-test-cluster
spec:
  master:
    replicas: 1
  data:
    replicas: 2
$ kubectl apply -f es-test-cluster.yaml

apply

apply receives the configuration for custom resources in the form of environment variables. the above Elasticsearch resource will result in K8S_METADATA_NAME=es-test-cluster, K8S_SPEC_MASTER_REPLICAS=1, etc being available in the environment variables.

apply must only write valid yaml to stdout.

Any yaml written to stdout is captured and saved on the status field of the custom resource. This means on the next iteration it can be accessed in the environment prefixed with K8S_STATUS_ like any other field in the custom resoruce.

This pattern allows very simple scripts to take deterministic single steps towards their ideal state.

delete

delete receives the configuration environment variables in the same way as apply.

delete must only write either valid yaml or nothing (techincally yaml null) to stdout.

If it writes yaml this will be written to the status field of the custom resource without deleting the resource and delete will be called again. This is to allow convergant deletes without requiring complex logic in the delete command.

If it writes nothing the object is permanantly deleted from Kubernetes.

Examples

https://github.com/side8/k8s-elasticsearch-operator is an Elasticsearch operator that safely manages Elasticsearch lifecycle events.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].