Skip to content

Commit

Permalink
TT-11522 Update NOTES.txt (#270)
Browse files Browse the repository at this point in the history
* Update NOTES.txt

* Update NOTES.txt

* Update NOTES.txt

* Update NOTES.txt

* Update NOTES.txt

* Apply suggestions from code review

Co-authored-by: Komal Sukhani <[email protected]>

---------

Co-authored-by: Komal Sukhani <[email protected]>
Co-authored-by: Pranshu <[email protected]>
  • Loading branch information
3 people authored May 6, 2024
1 parent 778f83c commit 3abe8e1
Showing 1 changed file with 32 additions and 8 deletions.
40 changes: 32 additions & 8 deletions tyk-control-plane/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ If the worker gateway will be deployed via Helm, tyk-data-plane chart helps to f

1- First obtain required connection details from Tyk MDCB:

{{- $tykMDCBSvc := printf "mdcb-svc-%s" (include "tyk-mdcb.fullname" (index .Subcharts "tyk-mdcb")) -}}
{{- $tykMDCBSvcPort := (include "mdcb.svcPort" (index .Subcharts "tyk-mdcb")) }}
export MDCB_CONNECTIONSTRING="{{ $tykMDCBSvc }}.{{ .Release.Namespace }}.svc:{{ $tykMDCBSvcPort }}"
export GROUP_ID=your_group_id # You can use any name for your group.

{{- $operatorSecret := index .Values "tyk-bootstrap" "bootstrap" "operatorSecret" }}
Expand All @@ -60,14 +57,41 @@ If the worker gateway will be deployed via Helm, tyk-data-plane chart helps to f

NOTE: You can find your organisation id and user api key through Tyk Dashboard, under your user account details.
{{ end }}
2- Create a Kubernetes Secret based on credentials.
kubectl create secret --namespace {{ .Release.Namespace }} generic tyk-data-plane-details \
2- Create a Kubernetes Secret based on credentials in data plane's namespace, e.g. `tyk-dp`.

kubectl create namespace tyk-dp

kubectl create secret generic tyk-data-plane-details \
--from-literal "orgId=$ORG_ID" \
--from-literal "userApiKey=$USER_API_KEY" \
--from-literal "groupID=$GROUP_ID"
--from-literal "groupID=$GROUP_ID" \
--namespace tyk-dp

3- Refer this Kubernetes secret (tyk-data-plane-details) while installing worker gateways through `global.remoteControlPlane.useSecretName` in tyk-data-plane chart.

4- Set `global.remoteControlPlane.connectionString`, `global.remoteControlPlane.useSSL` and `global.remoteControlPlane.sslInsecureSkipVerify` in tyk-data-plane chart to access MDCB service.

3- Refer this Kubernetes secret (tyk-data-plane-details) while installing worker gateways through `global.remoteControlPlane.useSecretName`
in tyk-data-plane chart.
If data plane is deployed in the same cluster, MDCB can be accessed via this connection string:

{{- $tykMDCBFullName := (include "tyk-mdcb.fullname" (index .Subcharts "tyk-mdcb")) -}}
{{- $tykMDCBSvc := printf "mdcb-svc-%s" (include "tyk-mdcb.fullname" (index .Subcharts "tyk-mdcb")) -}}
{{- $tykMDCBSvcPort := (include "mdcb.svcPort" (index .Subcharts "tyk-mdcb")) }}
export MDCB_CONNECTIONSTRING="{{ $tykMDCBSvc }}.{{ .Release.Namespace }}.svc:{{ $tykMDCBSvcPort }}"

If data plane is not deployed in the same cluster as control plane, get the connection string according to how MDCB service is exposed.

{{- if contains "NodePort" (index .Values "tyk-mdcb" "mdcb" "service" "type") }}
Node Port:
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ $tykMDCBSvc }})
export NODE_IP=$(kubectl get nodes -o jsonpath="{.items[0].status.addresses[0].address}")
export MDCB_CONNECTIONSTRING="$NODE_IP:$NODE_PORT"
{{- else if contains "LoadBalancer" (index .Values "tyk-mdcb" "mdcb" "service" "type") }}
TCP LoadBalancer:
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of service by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ $tykMDCBSvc}}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ $tykMDCBSvc }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
export MDCB_CONNECTIONSTRING=$SERVICE_IP:{{ $tykMDCBSvcPort }}
{{- end }}

For more detail about tyk-data-plane chart, please refer to the https://github.com/TykTechnologies/tyk-charts/tree/main/tyk-data-plane

Expand Down

0 comments on commit 3abe8e1

Please sign in to comment.