Skip to content

Commit

Permalink
Merge branch 'main' into fix/TT-9524/remove_duplicate_fields
Browse files Browse the repository at this point in the history
  • Loading branch information
komalsukhani authored Oct 18, 2023
2 parents 066e1e7 + 5906033 commit 28ef32a
Show file tree
Hide file tree
Showing 20 changed files with 141 additions and 135 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ spec:
{{- else }}
value: "dashboard-svc-tyk-dashboard"
{{- end }}
- name: TYK_DASHBOARD_INSECURE_SKIP_VERIFY
value: {{ default "false" .Values.bootstrap.dashboard.sslInsecureSkipVerify | quote }}
- name: TYK_DB_LISTENPORT
value: "{{ .Values.global.servicePorts.dashboard }}"
- name: TYK_DB_LICENSEKEY
Expand Down
2 changes: 2 additions & 0 deletions components/tyk-bootstrap/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ bootstrap:
enabled: true
# Name of the deployment that we want to bootstrap
deploymentName: dashboard-tyk-dashboard
# Skip validating the SSL certificates. Usually needed when using self-signed certs.
sslInsecureSkipVerify: false
# Specify if dashboard has custom service name.
serviceName: ""
portal:
Expand Down
18 changes: 0 additions & 18 deletions components/tyk-dashboard/certs/cert.pem

This file was deleted.

46 changes: 0 additions & 46 deletions components/tyk-dashboard/certs/combo.pem

This file was deleted.

28 changes: 0 additions & 28 deletions components/tyk-dashboard/certs/key.pem

This file was deleted.

21 changes: 18 additions & 3 deletions components/tyk-dashboard/templates/deployment-dashboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ spec:
value: "{{ .Values.dashboard.homeDir }}"
- name: "TYK_DB_USESHARDEDANALYTICS"
value: "{{ .Values.dashboard.useShardedAnalytics }}"
- name: "TYK_DB_ENABLEAGGREGATELOOKUPS"
value: "{{ .Values.dashboard.enableAggregateLookups }}"
- name: "TYK_DB_ENABLEANALYTICSCACHE"
value: "{{ .Values.dashboard.enableAnalyticsCache }}"
- name: "TYK_DB_ALLOWEXPLICITPOLICYID"
Expand Down Expand Up @@ -154,6 +152,12 @@ spec:

- name: TYK_DB_HTTPSERVEROPTIONS_USESSL
value: "{{ .Values.global.tls.dashboard }}"
- name: TYK_DB_HTTPSERVEROPTIONS_MINVERSION
value: "771"
- name: TYK_DB_HTTPSERVEROPTIONS_CERTIFICATES
value: '{{ .Values.dashboard.tls.certificates | toJson }}'
- name: TYK_DB_HTTPSERVEROPTIONS_SSLINSECURESKIPVERIFY
value: {{ default "false" .Values.dashboard.tls.insecureSkipVerify | quote }}

- name: TYK_DB_HOSTCONFIG_HOSTNAME
value: "{{ .Values.dashboard.hostName }}"
Expand Down Expand Up @@ -194,16 +198,22 @@ spec:
key: {{ include "tyk-dashboard.mongo_url_secret_key" . }}
- name: TYK_DB_MONGOUSESSL
value: "{{ default "false" .Values.global.mongo.useSSL }}"
- name: "TYK_DB_ENABLEAGGREGATELOOKUPS"
value: "{{ .Values.dashboard.enableAggregateLookups }}"
{{ end }}
{{- if .Values.dashboard.extraEnvs }}
{{- include "tyk-dashboard.tplvalues.render" ( dict "value" .Values.dashboard.extraEnvs "context" $ ) | nindent 10 }}
{{- include "tyk-dashboard.tplvalues.render" (dict "value" .Values.dashboard.extraEnvs "context" $) | nindent 10 }}
{{- end }}
resources:
{{ toYaml .Values.dashboard.resources | indent 12 }}
command: ["/opt/tyk-dashboard/tyk-analytics"]
ports:
- containerPort: {{ .Values.global.servicePorts.dashboard }}
volumeMounts:
{{ if .Values.global.tls.dashboard }}
- name: {{ .Values.dashboard.tls.secretName }}
mountPath: {{ .Values.dashboard.tls.certificatesMountPath }}
{{ end }}
{{- if .Values.dashboard.extraVolumeMounts }}
{{- include "tyk-dashboard.tplvalues.render" (dict "value" .Values.dashboard.extraVolumeMounts "context" $) | nindent 10 }}
{{- end }}
Expand All @@ -230,6 +240,11 @@ spec:
{{- toYaml .Values.dashboard.securityContext | nindent 10 }}
{{- end }}
volumes:
{{ if .Values.global.tls.dashboard }}
- name: {{ .Values.dashboard.tls.secretName }}
secret:
secretName: {{ .Values.dashboard.tls.secretName }}
{{ end }}
{{- if .Values.dashboard.extraVolumes }}
{{- include "tyk-dashboard.tplvalues.render" (dict "value" .Values.dashboard.extraVolumes "context" $) | nindent 8 }}
{{- end }}
15 changes: 0 additions & 15 deletions components/tyk-dashboard/templates/secret-certs.yaml

This file was deleted.

16 changes: 16 additions & 0 deletions components/tyk-dashboard/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ global:
# variables in extraEnvs object array to define your SSL cert and key files.
dashboard: false

# When true, it will install the certificate present in the templates folder, set to false when using
# a custom TLS certificate to avoid overwriting yours
useDefaultTykCertificate: true

# Choose the storageType for Tyk. [ "mongo", "postgres" ]
storageType: mongo

Expand Down Expand Up @@ -229,3 +233,15 @@ dashboard:

# The hostname to bind the Dashboard to.
hostName: tyk-dashboard.local

tls:
# The name of the secret which should contain the TLS certificate you want to use with the dashboard deployment
secretName: tyk-default-tls-secret
# This options allows you to skip verifying the TLS certificate. This is typically enabled when using self-signed certs.
insecureSkipVerify: false

certificatesMountPath: "/etc/certs/tyk-dashboard"
certificates:
- domain_name: "*"
cert_file: "/etc/certs/tyk-dashboard/tls.crt"
key_file: "/etc/certs/tyk-dashboard/tls.key"
8 changes: 8 additions & 0 deletions components/tyk-enterprise-portal/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,11 @@ Selector labels
app.kubernetes.io/name: {{ include "tyk-enterprise-portal.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{- define "tyk-enterprise-portal.tplvalues.render" -}}
{{- if typeIs "string" .value }}
{{- tpl .value .context }}
{{- else }}
{{- tpl (.value | toYaml) .context }}
{{- end }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ spec:
mountPath: /opt/portal/db
subPath: db
{{- end }}
{{- if .Values.extraVolumeMounts }}
{{- include "tyk-enterprise-portal.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 10 }}
{{- end }}
livenessProbe:
httpGet:
scheme: "HTTP{{ if .Values.global.tls.enterprisePortal }}S{{ end }}"
Expand All @@ -228,12 +231,15 @@ spec:
timeoutSeconds: 3
failureThreshold: 3

{{- if and (eq .Values.kind "Deployment") .Values.storage.persistence.mountExistingPVC }}
volumes:
{{- if and (eq .Values.kind "Deployment") .Values.storage.persistence.mountExistingPVC }}
- name: enterprise-portal-pvc-{{ include "tyk-enterprise-portal.fullname" . }}
persistentVolumeClaim:
claimName: {{ .Values.storage.persistence.mountExistingPVC }}
{{- end }}
{{- if .Values.extraVolumes }}
{{- include "tyk-enterprise-portal.tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | nindent 6 }}
{{- end }}

{{- if .Values.securityContext }}
securityContext:
Expand Down
2 changes: 1 addition & 1 deletion components/tyk-gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@ automatically enable TLS using the certificate provided under tyk-gateway/certs/
If you want to use your own key/cert pair, you must follow the following steps:
1. Create a tls secret using your cert and key pair.
2. Set `global.tls.gateway` to true.
3. Set `gateway.tls.useDefaultTykCertificate` to false.
3. Set `global.tls.useDefaultTykCertificate` to false.
4. Set `gateway.tls.secretName` to the name of the newly created secret.
6 changes: 4 additions & 2 deletions components/tyk-gateway/templates/deployment-gw-repset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ spec:
- name: TYK_GW_HTTPSERVEROPTIONS_MINVERSION
value: "771"
- name: TYK_GW_HTTPSERVEROPTIONS_CERTIFICATES
value: '[{"domain_name": "*", "cert_file": "/etc/certs/tls.crt", "key_file": "/etc/certs/tls.key"}]'
value: '{{ .Values.gateway.tls.certificates | toJson }}'
- name: TYK_GW_HTTPSERVEROPTIONS_SSLINSECURESKIPVERIFY
value: {{ default "false" .Values.gateway.tls.insecureSkipVerify | quote }}
- name: TYK_GW_ALLOWINSECURECONFIGS
value: "true"
- name: TYK_GW_COPROCESSOPTIONS_ENABLECOPROCESS
Expand Down Expand Up @@ -264,7 +266,7 @@ spec:
volumeMounts:
{{ if .Values.global.tls.gateway }}
- name: {{ .Values.gateway.tls.secretName }}
mountPath: /etc/certs
mountPath: {{ .Values.gateway.tls.certificatesMountPath }}
{{ end }}
- name: tyk-scratch
mountPath: /mnt/tyk-gateway
Expand Down
4 changes: 2 additions & 2 deletions components/tyk-gateway/templates/secret-certs.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ if and .Values.gateway.tls.useDefaultTykCertificate .Values.global.tls.gateway }}
{{ if and .Values.global.tls.useDefaultTykCertificate .Values.global.tls.gateway }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -9,4 +9,4 @@ data:
{{ .Files.Get "certs/tlsCert.pem" | b64enc }}
tls.key: |-
{{ .Files.Get "certs/tlsKey.pem" | b64enc }}
{{ end }}
{{ end }}
15 changes: 12 additions & 3 deletions components/tyk-gateway/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ global:
# - TYK_DB_SERVEROPTIONS_CERTIFICATE_KEYFILE
# variables in extraEnvs object array to define your SSL cert and key files.
dashboard: false

# When true, it will install the certificate present in the templates folder, set to false when using
# a custom TLS certificate to avoid overwriting yours
useDefaultTykCertificate: true
components:
dashboard: false
secrets:
Expand Down Expand Up @@ -119,11 +123,16 @@ gateway:
hostName: tyk-gw.local

tls:
# When true, it will install the certificate present in the templates folder, set to false when using
# a custom TLS certificate to avoid overwriting yours
useDefaultTykCertificate: true
# The name of the secret which should contain the TLS certificate you want to use with the gateway deployment
secretName: tyk-default-tls-secret
# This options allows you to skip verifying the TLS certificate. This is typically enabled when using self-signed certs.
insecureSkipVerify: false

certificatesMountPath: "/etc/certs/tyk-gateway"
certificates:
- domain_name: "*"
cert_file: "/etc/certs/tyk-gateway/tls.crt"
key_file: "/etc/certs/tyk-gateway/tls.key"

# kind is type of k8s object to be created for gateway.
kind: Deployment
Expand Down
13 changes: 7 additions & 6 deletions tyk-mdcb-data-plane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,14 @@ automatically enable TLS using the certificate provided under tyk-gateway/certs/

*Configure TLS secret*

If you want to use your own key/cert pair, please follow the following steps:
1. Create a TLS secret using your cert and key pair.
2. Set `global.tls.gateway` to true.
3. Set `tyk-gateway.gateway.tls.useDefaultTykCertificate` to false.
4. Set `tyk-gateway.gateway.tls.secretName` to the name of the newly created secret.

*Add Custom Certificates*
If you want to use your own key/cert pair, you must follow the following steps:
1. Create a tls secret using your cert and key pair.
2. Set `global.tls.gateway` to true.
3. Set `global.tls.useDefaultTykCertificate` to false.
4. Set `gateway.tls.secretName` to the name of the newly created secret.

5. *Add Custom Certificates*

To add your custom Certificate Authority(CA) to your containers, you can mount your CA certificate directly into /etc/ssl/certs folder.

Expand Down
15 changes: 12 additions & 3 deletions tyk-mdcb-data-plane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ global:
# When true, sets the gateway protocol to HTTPS.
gateway: false

# When true, it will install the certificate present in the templates folder, set to false when using
# a custom TLS certificate to avoid overwriting yours
useDefaultTykCertificate: true

secrets:
# APISecret sets node_secret and secret in tyk.conf
APISecret: CHANGEME
Expand Down Expand Up @@ -131,11 +135,16 @@ tyk-gateway:
hostName: tyk-gw.local

tls:
# When true, it will install the certificate present in the templates folder, set to false when using
# a custom TLS certificate to avoid overwriting yours
useDefaultTykCertificate: true
# The name of the secret which should contain the TLS certificate you want to use with the gateway deployment
secretName: tyk-default-tls-secret
# This options allows you to skip verifying the TLS certificate. This is typically enabled when using self-signed certs.
insecureSkipVerify: false

certificatesMountPath: "/etc/certs/tyk-gateway"
certificates:
- domain_name: "*"
cert_file: "/etc/certs/tyk-gateway/tls.crt"
key_file: "/etc/certs/tyk-gateway/tls.key"

# kind is type of k8s object to be created for gateway.
kind: Deployment
Expand Down
6 changes: 6 additions & 0 deletions tyk-oss/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ To add your custom Certificate Authority(CA) to your containers, you can mount y
Default service port of gateway is 8080. You can change this at `global.servicePorts.gateway`.

If you want to use your own key/cert pair, you must follow the following steps:
1. Create a tls secret using your cert and key pair.
2. Set `.Values.global.tls.gateway` to true.
3. Set `.Values.global.tls.useDefaultTykCertificate` to false.
4. Set `.Values.tyk-gateway.tls.secretName` to the name of the newly created secret.

*Ingress*

An Ingress resource is created if `tyk-gateway.gateway.ingress.enabled` is set to true.
Expand Down
Loading

0 comments on commit 28ef32a

Please sign in to comment.