So now I am trying to follow along with next step Create API sample from Create an API
Under Open-Source tab, this the first step:
Step 1: Make sure you know your API secret
Your Tyk Gateway API secret is stored in your tyk.conf file, the property is called secret, you will need to use this as a header called x-tyk-authorization to make calls to the Gateway API.
Now I have no idea where this tyk.conf is located for this installation? How do I get this “secret” so I can interact with Gateway API. I feel like documentation/samples have so much assumed knowledge.
Glad to hear that you found your way to solution !!! Just want to let you know that after the installation of Tyk CE, you will find a secret resource created named as “secrets-tyk-ce-tyk-headless” under your namespace which contains your APISecret key in a base64 encoded form. To decode its value you can use below command
kubectl get secrets/secrets-tyk-ce-tyk-headless --template={{.data.APISecret}} | base64 -d
Hey @crnastena , to change the value of the APISecret after the installation, you can either make the change for the APISecret at the values.yaml file and upgrade your helm release to a newer version or you can pass the updated value of the APISecret using --set flags during helm upgrade command. I would recommend you to use the latter one as it set the values at runtime. Below are the steps to do this
Now, check again the APISecret value from the secret as we did earlier
kubectl get secrets/secrets-tyk-ce-tyk-headless -n tyk --template={{.data.APISecret}} | base64 -d
It will be changed to the value which we have passed using the --set flag above. Now, to make the gateway use this new APISecret value, simply delete your gateway pod and it will be recreated automatically referencing new APISecret as it is a Daemon Set.
kubectl delete pod gateway-tyk-ce-tyk-headless-xxxxx -n tyk
Once the pod comes up, you can test the newly changed values by creating an API or try reloading the gateway.