Hey Folks,
In trying to build out a workflow which can be used by multiple teams with multiple repositories. Tyk hybrid is deployed across K8S with a tyk hosted dashboard.
Please help with vetting & fine tuning my instructions to teams here. I’m leaning towards tyk sync over tyk operator because the documentation and tooling seems a little friendlier. (there’s no way I can get away with line one of a doc for 100+ developers that says “step one- compile tyk operator in go”)
(proposed) Developer Workflow
- Log in to Tyk Cloud
- Click “Deployments → [Environment Name]”
- Select Manage APIs
- Reload the gateway dashboard page 5 or 6 times until the NGNIX bad gateway & service unavailable errors stop happening (*ideally we fix this at some point as well, super annoying)
- Configure your API within the gateway GUI
- On the Advanced Options → Segment Tags section add the appropriate keys to deploy to the correct environment (eg:
sandbox-external
,staging-external
,production-external
) - save your api
- copy and paste the ID of the API configuration you’ve created into your local repository
./gateway-config/tyk-api-ids.txt
file. This is a comma separated list of the IDs your team owns. - run the command
TYK_API_IDS=$(cat ./gateway-config/tyk-api-ids.txt); docker run -v ${PWD}/gateway-config:/home -it --rm tykio/tyk-sync:v1.2.3 dump -d https://<DASHBOARD-NAME>.cloud-ara.tyk.io/ --secret $TYKGIT_DB_SECRET --target /home --apis $TYK_API_IDS
- check the resulting configuration files into your local repo
(proposed) CICD job
- add the following code snippet to your
./circleci/config.yaml
workflows jobs
deploy_tyk:
docker:
- image: 'tykio/tyk-sync:v1.2.3'
steps:
- checkout
- run:
# this part of the command is a bit troubling since the tyk-sync container is a little arcane. I could really use a expert help here
command: publish --dashboard $TYK_SYNC_DASHBOARD --secret $TYK_SYNC_DB_SECRET --path ./gateway-config
name: Send tyk configurations to deployed environment
- add the following to your
./circleci/config.yaml
workflows
update_api_definitions:
when:
equal:
- main
- << pipeline.git.branch >>
# TODO: update to include a FOLDER limit to the place where tyk configs exist
# only deploy on change - not blocking
jobs:
- deploy_tyk
I’m not married to the tyk-sync
requirement, especially because we ARE operating in an environment with K8s and I know that the operator is said to be the preferred way of moving forward on that, but if I’m honest, the operator docs feel a little overwhelming and I’m trying to boil this down to a turnkey solution for dozens to hundreds of developers.
Unfortunately it seems it’s a bit hard to synthesize the correct way to do all this stuff from the various docs that are listed on the topic.