Skip to content

andyxning/nsq-operator

Repository files navigation

nsq-operator

nsq-operator targets to run NSQ-As-A-Service, i.e., NAAS, based on Kubernetes.

Status

nsq-operator is currently in Alpha stage. Until GA status is clearly stated, it is not recommended to run nsq-operator in production.

But, we encourage end users to give nsq-operator a try, i.e., testing and benching nsq-operator, and give us some feedback.

Feature

  • High availability. NSQ-Operator supports HA by utilizing Kubernetes leaderelection package and coordination.k8s.io/lease resource.
  • Create/Delete a nsq cluster
  • Scale nsqd/nsqlookupd/nsqadmin components separately
  • Update nsqd/nsqlookupd/nsqadmin image separately
  • Adjust nsqd command line arguments
  • Adjust nsqd pods memory resource according to average message size, memory queue size, memory overbooking percent and channel count
  • Log Management.
    • Rotate log by logrotate hourly
    • Mount log directory to a dedicated host machine directory in nsqd/nsqlookupd/nsqadmin spec
  • QPS based horizontal pod autoscale. No memory/cpu/network/disk resources based autoscale support. QPS autoscale does not rely on any other systems. It is implemented in Kubernetes way. More details

Runtime Requirement

  • Kubernetes >= 1.14.0
  • Golang >= 1.12.0

SDK

There is a sdk which can be used to CRUD nsq related resource. Files under examples show sdk use examples.

File Description
create_cluster.go Create a NSQ cluster
delete_cluster.go Delete a NSQ cluster
update_nsqadmin_replica.go Update nsqadmin resource object replica
update_nsqlookupd_replica.go Update nsqlookupd resource object replica
update_nsqd_replica.go Update nsqd resource object replica
adjust_nsqd_config.go Adjust nsqd command line arguments
adjust_nsqd_memory_resource.go Adjust nsqd resource object's memory resource limits/requests
adjust_nsqdscale.go Adjust nsqdscale resource object
bump_nsqadmin_image.go Update a NSQ cluster's nsqadmin image
bump_nsqlookupd_image.go Update a NSQ cluster's nsqlookupd image
bump_nsqd_image.go Update a NSQ cluster's nsqd image

FAQ

See FAQ

Users

See Users