Skip to content

Commit

Permalink
TT-12202: remove dev portal command
Browse files Browse the repository at this point in the history
  • Loading branch information
olamilekan000 committed Jun 20, 2024
1 parent 014dbac commit c25d212
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,6 @@ spec:
value: {{ .Values.bootstrap.dashboard | quote }}
- name: TYK_K8SBOOTSTRAP_OPERATORKUBERNETESSECRETNAME
value: {{ .Values.bootstrap.operatorSecret }}
{{- if .Values.bootstrap.devPortal }}
- name: TYK_K8SBOOTSTRAP_DEVPORTALKUBERNETESSECRETNAME
value: {{ .Values.global.secrets.devPortal}}
{{- end }}
- name: TYK_K8SBOOTSTRAP_BOOTSTRAPPORTAL
value: {{ .Values.bootstrap.portal | quote }}
{{- if .Values.bootstrap.org.hybrid.enabled }}
Expand Down
2 changes: 0 additions & 2 deletions components/tyk-bootstrap/templates/bootstrap-pre-delete.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ spec:
env:
- name: TYK_K8SBOOTSTRAP_OPERATORKUBERNETESSECRETNAME
value: {{ .Values.bootstrap.operatorSecret }}
- name: TYK_K8SBOOTSTRAP_DEVPORTALKUBERNETESSECRETNAME
value: {{ .Values.global.secrets.devPortal }}
- name: TYK_K8SBOOTSTRAP_K8S_RELEASENAMESPACE
valueFrom:
fieldRef:
Expand Down
22 changes: 15 additions & 7 deletions components/tyk-dev-portal/templates/job-portal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,27 @@ spec:
- -c
- |
echo "Waiting for dev-portal to be ready..."
start_time=$(date +%s)
timeout_duration=$((10 * 60)) # 10 minutes in seconds
while ! nc -z $SERVICE_NAME $PORT; do
current_time=$(date +%s)
elapsed_time=$((current_time - start_time))
if [ $elapsed_time -ge $timeout_duration ]; then
echo "Timeout reached. Exiting."
exit 1
fi
echo "dev-portal is not ready yet. Waiting..."
sleep 1
done
echo "dev-portal is ready. Making the API call..."
curl --silent --show-error --fail --location --request POST "http://$SERVICE_NAME:$PORT/portal-api/bootstrap" \
--header "Content-Type: application/json" \
--data-raw '{
"username": "'$ADMIN_EMAIL'",
"password": "'$ADMIN_PASSWORD'",
"first_name": "'$FIRSTNAME'",
"last_name": "'$LASTNAME'"
}'
--header "Content-Type: application/json" \
--data-raw '{
"username": "'$ADMIN_EMAIL'",
"password": "'$ADMIN_PASSWORD'",
"first_name": "'$FIRSTNAME'",
"last_name": "'$LASTNAME'"
}'
echo "API call completed."
exit 0;
restartPolicy: Never
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,18 +159,6 @@ spec:
value: "tyk"
- name: TYK_URL
value: {{ include "tyk-dev-portal.dashboardUrl" . | quote }}
{{- if (.Values.global.secrets).devPortal }}
- name: TYK_AUTH
valueFrom:
secretKeyRef:
name: {{ .Values.global.secrets.devPortal}}
key: TYK_AUTH
- name: TYK_ORG
valueFrom:
secretKeyRef:
name: {{ .Values.global.secrets.devPortal}}
key: TYK_ORG
{{- end }}
{{- if .Values.extraEnvs }}
{{- range $env := .Values.extraEnvs }}
- name: {{ $env.name }}
Expand All @@ -179,10 +167,6 @@ spec:
{{- end }}
resources:
{{ toYaml .Values.resources | indent 12 }}
command: ["/opt/portal/dev-portal"]
{{- if and .Values.global.components.bootstrap (.Values.global.secrets).devPortal}}
args: ["--bootstrap", "--provider-data={\"URL\":\"$(TYK_URL)\",\"Secret\":\"$(TYK_AUTH)\",\"OrgID\":\"$(TYK_ORG)\"}", "-user=$(ADMIN_EMAIL)", "-pass=$(ADMIN_PASSWORD)"]
{{- end }}
workingDir: /opt/portal
ports:
- containerPort: {{ .Values.containerPort }}
Expand Down
8 changes: 0 additions & 8 deletions components/tyk-dev-portal/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,6 @@ global:
# In the context of the tyk-developer-portal only, this just runs the bootstrapping jobs only for the portal
bootstrap: true

secrets:
# devPortal secret is used to bootstrap the Portal which should include Tyk Dashboard credentials.
# You can set to empty to skip portal bootstrapping.
# It should include the followings:
# - TYK_ORG: Tyk Dashboard Organisation ID
# - TYK_AUTH: Tyk Dashboard API Access Credentials
devPortal: tyk-dev-portal-conf

# Sensitive configuration of Portal could be set using k8s secret
# You can set following fields:
# - DevPortalLicense - Sets LicenseKey for Developer Portal
Expand Down
6 changes: 0 additions & 6 deletions tyk-control-plane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,6 @@ global:
# AdminSecret - Admin user secret key
# DashLicense - Tyk Dashboard license key
useSecretName: ""
# devPortal secret is used to bootstrap the Portal which should include Tyk Dashboard credentials.
# You can set to empty to skip portal bootstrapping.
# It should include the followings:
# - TYK_ORG: Tyk Dashboard Organisation ID
# - TYK_AUTH: Tyk Dashboard API Access Credentials
devPortal: ""

redis:
# The addrs value will allow you to set your Redis addresses.
Expand Down
6 changes: 0 additions & 6 deletions tyk-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,6 @@ global:
# AdminSecret - Admin user secret key
# DashLicense - Tyk Dashboard license key
useSecretName: ""
# devPortal secret is used to bootstrap the Portal which should include Tyk Dashboard credentials.
# You can set to empty to skip portal bootstrapping.
# It should include the followings:
# - TYK_ORG: Tyk Dashboard Organisation ID
# - TYK_AUTH: Tyk Dashboard API Access Credentials
devPortal: ""

redis:
# The addrs value will allow you to set your Redis addresses.
Expand Down

0 comments on commit c25d212

Please sign in to comment.