An operator for Typesense written in Python. Provides a way to manage Typesense in various deployment configurations. It is currently being worked on to be made production ready.
Please report an issue for improvement suggestions/feedback. This operator is being written with the help of KOPF framework.
The general idea is to make deployment of Typesense on kubernetes easy by automating the entire process involved in creation of Typesense cluster
kubectl create -f operator-config.yaml
- Use minikube or any other tool to create your own kubernets cluster.
-
Deploy the Custom Resource Definition
cd deploy
kubectl create -f crd.yaml
- Deploy rbac
kubectl create -f rbac.yaml
- Deploy the latest operator
kubectl create -f operator.yaml
- Check if operator is up and running
kubectl get pods
- Once the operator is up and running, define the operator configurations by referring to the section below
- Wait for the cluster to be created
# Get Typesense pod status kubectl get pods -n <namespace>
- Sample configuration can be found in
operator-config.yaml
- All the configuration must be specified under
spec
orconfig
- Supported configurations under
spec
replicas
: Number of replicas of typesense. default is3
NOTE: When the number of replicas are increased the operator automatically handles the peering connection between the replicas.namespace
: Namespace to be used for deployment. default namespace istypesense
image
: Typesense production ready docker image. List can be found here. By defaultlatest
tag will be pulledresources
: Resources for cpu and memory.
defaults to below configuration:resources: requests: memory: 100Mi cpu: "64m" limits: memory: 256Mi cpu: "512m"
nodeSelector
: Node to which pod has to be scheduled. if not specified, it picks up the node with available resourcesstorageClass
: Provides a way to administor the storage. Create a storage class with the provider of your choice and add it to the operator config.
Options available arename
andsize
name
: Name of the storageClass that the operator should consider for volume mount.size
: Size of the volume to be allocated to each typesense replica.
NOTE: Supports all k8s Storageclass.
startupProbe
: Protect slow starting containers with startup probes
Options available arefailureThreshold
andperiodSeconds
NOTE: k8s startupProbe.livenessProbe
: Kubernetes provides liveness probes to detect and remedy such situations.
Options available arefailureThreshold
andperiodSeconds
NOTE: k8s livenessProbe.
- Supported configurations under
config
password
: Typesense authentication is done using a password. defaults to297beb01dd21c
kubectl create -f operator-config.yaml
- To apply any changes made to the config
kubectl apply -f operator-config.yaml
- Before performing this upgrade process, it is recommended to:
- Test it out in a dev environment
- Backup the Typesense data
- The process of updating TKO is simple:
- Watch for changes in the CRD file and apply those changes
- Watch for changes in the RBAC file and apply those changes
- Apply the new
operator.yaml
file - Once the new operator pod is up and running, re-apply the configuration of the your operator so that the changes (if any) are reflected.
kubectl apply -f <your operator config file yaml>
- When you want to fully remove the cluster operator and associated definitions, you can run:
kubectl delete -f operator-config.yaml kubectl delete -f deploy/crd.yaml kubectl delete -f deploy/operator.yaml kubectl delete -f deploy/rbac.yaml
If you encounter any issues while using the operator, you can get help by:
- Raise a Github issue
You can contribute by:
- Raising an issue
- Opening Pull Requests
- Improving documentation
Typesense operator is licensed under the Apache License