-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TT-5906] Add a pre-hook to validate Dashboard license (#112)
* add pre-install hook that verifies dashboard licenses Signed-off-by: Burak Sekili <[email protected]> * Add hook annotations to serviceaccounts and update command of job pod Signed-off-by: Burak Sekili <[email protected]> * Add temporary image registeries for bootstrap Signed-off-by: Burak Sekili <[email protected]> * change image repositories to official one Signed-off-by: Burak Sekili <[email protected]> --------- Signed-off-by: Burak Sekili <[email protected]> Co-authored-by: andrei-tyk <[email protected]> Co-authored-by: Pranshu <[email protected]>
- Loading branch information
1 parent
b90aa15
commit 6dc091f
Showing
6 changed files
with
54 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
components/tyk-bootstrap/templates/bootstrap-pre-install.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{{- if .Values.bootstrap.dashboard.enabled -}} | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: {{ .Values.bootstrap.jobs.bootstrapPreInstallJobName }} | ||
labels: | ||
app.kubernetes.io/managed-by: {{ .Release.Service | quote }} | ||
app.kubernetes.io/instance: {{ .Release.Name | quote }} | ||
|
||
# Removed the use of appVersion since it's not accurate. We'll put it back in v1.0 | ||
# when every app will have its own a chart | ||
# app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
annotations: | ||
# This is what defines this resource as a hook. Without this line, the | ||
# job is considered part of the release. | ||
"helm.sh/hook": pre-install | ||
"helm.sh/hook-weight": "-5" | ||
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded | ||
spec: | ||
backoffLimit: 1 | ||
template: | ||
metadata: | ||
annotations: | ||
{{- if .Values.bootstrap.podAnnotations.preInstallPodAnnotations }} | ||
{{ toYaml .Values.bootstrap.podAnnotations.preInstallPodAnnotations | nindent 8 }} | ||
{{- end }} | ||
spec: | ||
serviceAccountName: k8s-bootstrap-role | ||
containers: | ||
- name: bootstrap-tyk-pre-install | ||
image: tykio/tyk-k8s-bootstrap-pre-install:latest | ||
command: ['/app/bin/bootstrap-app-pre-install'] | ||
imagePullPolicy: IfNotPresent | ||
env: | ||
- name: TYK_DB_LICENSEKEY | ||
value: {{ .Values.global.license.dashboard | quote }} | ||
restartPolicy: Never | ||
terminationGracePeriodSeconds: 0 | ||
{{- end }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters