Sign inSign up

alexchesser/tyk-operator-wrapper

By alexchesser

•Updated over 3 years ago

Creates a usable "developer environment" for running tyk-operator within.

Image
0

362

alexchesser/tyk-operator-wrapper repository overview

⁠TYK Operator Wrapper

The following container is intended to be used as a developer environment for taking "snapshots" of tyk configurations.

The current release version of the tyk operator (v0.13) does not have the capability to snapshot built in and as such the tool must be compiled from source.

⁠Required Environment Variables

All of these values should be set appropriately for your conditions and saved in the root of your repository with a file named .tyk.operator.env

K8S_CLUSTER_NAME=cluster-name-for-EKS-connection
# YOUR API EXPORT CATEGORY IS THE NAME OF THE TAG YOU ADD TO APIs YOUR TEAM OWNS
# EXPECT THIS TO BE UNIQUE TO YOUR GIT REPOSITORY AND TEAM
API_EXPORT_CATEGORY=category-of-apis-to-export
# THE FOLLOWING VALUES ARE REQUIRED FOR TYK CONNECTIVITY
TYK_MODE=pro
TYK_URL=https://your-tyk-gateway-url.cloud-ara.tyk.io/
## THESE VALUES CAN BE FOUND IN THE TYK GATEWAY
##  - TOP RIGHT CORNER (USERNAME)
##  - CHOOSE "EDIT PROFILE"
##  - SELECT A SPECIFIC USER FROM THE LIST
##  - TYK_AUTH CAN BE POPULATED WITH THE VALUE FOUND UNDER "Tyk Dashboard API Access Credentials"
##  - TYK_ORG CAN BE POPULATED WITH THE VALUE FOUND UNDER "Organisation ID"
TYK_AUTH=XXXXXXXXXXXXXXXXXXXXXXXX
TYK_ORG=XXXXXXXXXXXXXXXXXXXXXXXX
# YOU MUST HAVE ACCESS TO AWS TILE IN JUSTWORKS OKTA WITH THE "justworkshr-infra-sandbox" TILE VISIBLE WHEN YOU CONNECT
##  THESE VALUES ARE FOUND UNDER THE "Command line or programmatic access" LINK
##  WARNING - IF YOU ARE COPYING AND PASTING FROM OPTION 1, BE SURE TO DELETE THE WORD "export"
##  AS WELL AS THE DOUBLE QUOTES EXCLOSING THE STRINGS
AWS_ACCESS_KEY_ID=XXXXXXXXXXXXXXXXXXXX
AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
AWS_SESSION_TOKEN=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...XXXXXXXXXXXXXXXXXXXXX

⁠Running a snapshot

Assuming correct environment variable settings, the following command will:

  1. create a local docker container and enter it
  2. automatically connect to your configured EKS cluster
  3. export all policies and api definitions to a local folder on your host operating system named ./api-endpoint-configuration (one file named policies.yaml, one name apidef.waml)
  4. leave you in the shell inside the container (type exit when you're done)
  5. clean up the container on exit
docker run -it --rm \
  -v ${PWD}/api-endpoint-configuration:/output \
  --env-file .tyk.operator.env \
  alexchesser/tyk-operator-wrapper \
  /workspace/connect-and-export.sh

⁠Contact

https://github.com/AlexChesser/tyk-operator-wrapper⁠

Tag summary

Content type

Image

Digest

sha256:3e99b94cc…

Size

231.2 MB

Last updated

over 3 years ago

docker pull alexchesser/tyk-operator-wrapper