From 3abe8e10b52a041ff8d96e897d0bf7ed52b6103a Mon Sep 17 00:00:00 2001 From: caroltyk <97617859+caroltyk@users.noreply.github.com> Date: Mon, 6 May 2024 19:29:34 +0800 Subject: [PATCH] TT-11522 Update NOTES.txt (#270) * 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 --------- Co-authored-by: Komal Sukhani Co-authored-by: Pranshu <104971506+singhpr@users.noreply.github.com> --- tyk-control-plane/templates/NOTES.txt | 40 +++++++++++++++++++++------ 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/tyk-control-plane/templates/NOTES.txt b/tyk-control-plane/templates/NOTES.txt index 4e0d58af..9ff7c78f 100644 --- a/tyk-control-plane/templates/NOTES.txt +++ b/tyk-control-plane/templates/NOTES.txt @@ -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" }} @@ -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