Tyk Operator reconciliation pod restarts

If I try to restart the gateway pod, I have to restart the operator in order for the reconciliation to be triggered and apis and policies to be created. Did I miss some configuration or is this expected behavior?

Thanks in advance

Hi @hannahlindblad,

Welcome to the community :tada: :partying_face:.

The operator’s functioning is independent of Gateway start/stop. The operator will only reconcile when it’s (re)started, as you’ve noticed, or there is a change to the CRDs or the cache has expired.

Looks like you may be having trouble with API/Policy persistence. Can you confirm?
Using persistent volumes might be the solution you need.

1 Like

Hi @Ubong,

Thank you and thanks for your reply.

You’ve understood my problem precisely. Does the pro subscription include functionality to cover this use case? Or I would need to make use of persistence volumes there as well?

Yes, the pro version does… sort of. You wouldn’t need to make use of persistence volumes.

In the pro version, you have the Tyk Dashboard which uses MongoDB/PostgreSQL for the storage of APIs & policies.

In this case, Tyk Operator is configured in ‘pro’ mode and the provided Tyk URL for connection is the Dashboard url. When a CRD is published by Operator, the Dashboard creates and saves the corresponding object to the Database.

The Gateway(s) are configured to get APIs/Policies from the Dashboard, and are not aware of Tyk Operator.
The Dashboard is responsible for communicating the absence/presence and changes to APIs/Policies to the connected gateways and that’s natively handled well within the Tyk ecosystem.

1 Like

Thanks a lot @Ubong, that explains it :slight_smile:

Is there a way to handle this scenario within the community edition of the gateway? I’m hoping so, since I otherwise like this operator, but it’s not super useful if it can’t persist through pod restarts.

@Ubong, you mentioned persistent volumes, does tyk have a recommended way to apply that strategy?

Hi @jkemsley,

Welcome to the community :tada:

Yes, you can/should modify the values.yaml file. extraVolumes and extraVolumeMounts specifically.
This should help… Persistent Volumes | Component Helm Chart | Documentation

Hello @jkemsley ,

Our colleague created a demo on how to use persistent volume and tyk operator to achieve persistence on community edition (Bonus: you can scale the gateway horizontally too because they are sharing API configurations through persistent volume)

Check this out!

Thanks @carol , that example is what I needed. I think that would be a helpful thing to put in the docs for the helm chart.

Thanks @jkemsley . Glad that it helps. We’ll publish this example to docs soon.