tyk-operator icon indicating copy to clipboard operation
tyk-operator copied to clipboard

CONCEPT: CLI to pull APIs from an existing Tyk installation and convert to K8s YAML format

Open asoorm opened this issue 2 years ago • 1 comments

Concept

asoorm avatar Jul 14 '22 20:07 asoorm

Is there a reason thepkg/snapshot/README.md is not inside the docs directory? It would also be great to reference this file from within the homepage so that it is easy to discover and navigate to.

asoorm avatar Sep 08 '22 07:09 asoorm

@buraksekili Looks good to me. You will also need to update screenshot because it is still referring to k8sNs field of configData

komalsukhani avatar Sep 12 '22 10:09 komalsukhani

Updated @komalsukhani 👍

buraksekili avatar Sep 12 '22 10:09 buraksekili

Hi @buraksekili

Thanks for the updates.

About the k8s metadata names - rather than output files with invalid metadata names in it, how about we make it mandatory to have "k8sName" configured in config data? Reasons for doing this:

  1. It make the export process 'repeatable' without further manual changes required by user on output file.
  2. The security policies exported will also be usable with the correct reference of API names in access rights array.

Propose logic:

  • When exporting API, check if the API have required config data (k8sName). If not, output a WARNING message and not include that API in output.
  • When exporting policy, check If a policy reference to an API without k8sName config, output a WARNING message and not include that policy in output.

cc @asoorm @komalsukhani

caroltyk avatar Sep 12 '22 12:09 caroltyk

how about we make it mandatory to have "k8sName" configured in config data?

I love this - it's much cleaner and simpler - and makes it explicit which apis to export. It also is better than faffing round with arrays and incrementing Ids

  • When exporting API, check if the API have required config data (k8sName). If not, output a WARNING message and not include that API in output.
  • When exporting policy, check If a policy reference to an API without k8sName config, output a WARNING message and not include that policy in output.

Need some clearer picture here why / how to warn the user - e.g. if k8sName doesn't exist how can we issue a warning when the output is a yaml? Perhaps it should just fail with non 0 exit code if they try to export an API without a k8sName?

asoorm avatar Sep 12 '22 13:09 asoorm

Need some clearer picture here why / how to warn the user - e.g. if k8sName doesn't exist how can we issue a warning when the output is a yaml? Perhaps it should just fail with non 0 exit code if they try to export an API without a k8sName?

@asoorm, what I had in mind is that if no valid config data is provided, let's not generate the output file and instead print a message to the console to inform users about invalid APIs. What do you think?

buraksekili avatar Sep 15 '22 08:09 buraksekili