nats-io / nack

NATS Controllers for Kubernetes (NACK)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Consumer delete and create is not create new consumer.

jaekook opened this issue · comments

nats-0.9.2
nack-0.9.2

  1. Create consumer with CRD.
    master [~/k8s/helm/nats/consumer]$ kubectl apply -f consumer-billing.yaml
    consumer.jetstream.nats.io/csl-billing-txn-billing-prepare created
    consumer.jetstream.nats.io/csl-billing-txn-billing-cancel created
    consumer.jetstream.nats.io/csl-billing-txn-billing-complete created
    master [~/k8s/helm/nats/consumer]$ kubectl get consumer
    NAME STATE STREAM CONSUMER ACK POLICY
    csl-billing-txn-billing-cancel Created crp-billing-stream csl-billing-txn-billing-cancel all
    csl-billing-txn-billing-complete Created crp-billing-stream csl-billing-txn-billing-complete all
    csl-billing-txn-billing-prepare Created crp-billing-stream csl-billing-txn-billing-prepare all

  2. Delete above for change consumer option.
    master [~/k8s/helm/nats/consumer]$ kubectl delete -f consumer-billing.yaml
    consumer.jetstream.nats.io "csl-billing-txn-billing-prepare" deleted
    consumer.jetstream.nats.io "csl-billing-txn-billing-cancel" deleted
    consumer.jetstream.nats.io "csl-billing-txn-billing-complete" deleted

  3. Modify some consumer option, Recreate with CRD.
    master [~/k8s/helm/nats/consumer]$ kubectl apply -f consumer-billing.yaml
    consumer.jetstream.nats.io/csl-billing-txn-billing-prepare created
    consumer.jetstream.nats.io/csl-billing-txn-billing-cancel created
    consumer.jetstream.nats.io/csl-billing-txn-billing-complete created

  4. But, this time consumer didn't created.
    master [~/k8s/helm/nats/consumer]$ kubectl get consumer
    NAME STATE STREAM CONSUMER ACK POLICY
    csl-billing-txn-billing-cancel crp-billing-stream csl-billing-txn-billing-cancel all
    csl-billing-txn-billing-complete crp-billing-stream csl-billing-txn-billing-complete all
    csl-billing-txn-billing-prepare crp-billing-stream csl-billing-txn-billing-prepare all

  5. Nack error message
    Event(v1.ObjectReference{Kind:"Consumer", Namespace:"default", Name:"csl-odr-txn-complete-order", UID:"b1b60a3a-5b95-4c54-a39e-573082a56143", APIVersion:"jetstream.nats.io/v1beta2", ResourceVersion:"315784971", FieldPath:""}): type: 'Warning' reason: 'Updating' Consumer updates ("csl-odr-txn-complete-order" on "crp-order-stream") are not allowed, recreate to update

How can I delete the old consumer and create it again for the update option?
Same problem from StackOverflow : https://stackoverflow.com/questions/69403789/nack-jetstream-controller-failed-to-update-consumer

Fixed via #78