YugabyteDB Cluster CRD

YugabyteDB clusters can be created/configured by creating/updating the custom resource object ybclusters.yugabytedb.rook.io. Please follow instructions in the YugabyteDB Operator Quikstart to create a YugabyteDB cluster.

The configuration options provided by the custom resource are explained here.

Sample

  1. apiVersion: yugabytedb.rook.io/v1alpha1
  2. kind: YBCluster
  3. metadata:
  4. name: rook-yugabytedb
  5. namespace: rook-yugabytedb
  6. spec:
  7. master:
  8. # Replica count for Master.
  9. replicas: 3
  10. # Mentioning network ports is optional. If some or all ports are not specified, then they will be defaulted to below-mentioned values, except for tserver-ui.
  11. network:
  12. ports:
  13. - name: yb-master-ui
  14. port: 7000 # default value
  15. - name: yb-master-rpc
  16. port: 7100 # default value
  17. # Volume claim template for Master
  18. volumeClaimTemplate:
  19. metadata:
  20. name: datadir
  21. spec:
  22. accessModes: [ "ReadWriteOnce" ]
  23. resources:
  24. requests:
  25. storage: 1Gi
  26. storageClassName: standard # Modify this field with required storage class name.
  27. tserver:
  28. # Replica count for TServer
  29. replicas: 3
  30. # Mentioning network ports is optional. If some or all ports are not specified, then they will be defaulted to below-mentioned values, except for tserver-ui.
  31. # For tserver-ui a cluster ip service will be created if the yb-tserver-ui port is explicitly mentioned. If it is not specified, only StatefulSet & headless service will be created for TServer. TServer ClusterIP service creation will be skipped. Whereas for Master, all 3 kubernetes objects will always be created.
  32. network:
  33. ports:
  34. - name: yb-tserver-ui
  35. port: 9000
  36. - name: yb-tserver-rpc
  37. port: 9100 # default value
  38. - name: ycql
  39. port: 9042 # default value
  40. - name: yedis
  41. port: 6379 # default value
  42. - name: ysql
  43. port: 5433 # default value
  44. # Volume claim template for TServer
  45. volumeClaimTemplate:
  46. metadata:
  47. name: datadir
  48. spec:
  49. accessModes: [ "ReadWriteOnce" ]
  50. resources:
  51. requests:
  52. storage: 1Gi
  53. storageClassName: standard # Modify this field with required storage class name.

Configuration options

Master/TServer

Master & TServer are two essential components of a YugabyteDB cluster. Master is responsible for recording and maintaining system metadata & for admin activities. TServers are mainly responsible for data I/O. Specify Master/TServer specific attributes under master/tserver. The valid attributes are replicas, network & volumeClaimTemplate.

Replica Count

Specify replica count for master & tserver pods under replicas field. This is a required field.

Network

network field accepts NetworkSpec to be specified which describes YugabyteDB network settings. This is an optional field. Default network settings will be used, if any or all of the acceptable values are absent.

A ClusterIP service will be created when yb-tserver-ui port is explicitly specified. If it is not specified, only StatefulSet & headless service will be created for TServer. ClusterIP service creation will be skipped. Whereas for Master, all 3 kubernetes objects will always be created.

The acceptable port names & their default values are as follows:

NameDefault Value
yb-master-ui7000
yb-master-rpc7100
yb-tserver-rpc9100
ycql9042
yedis6379
ysql5433

Volume Claim Templates

Specify a PersistentVolumeClaim template under the volumeClaimTemplate field for master & tserver each. This is a required field.