diff --git a/components/tyk-gateway/templates/deployment-gw-repset.yaml b/components/tyk-gateway/templates/deployment-gw-repset.yaml index 1cdea685..b85520c9 100644 --- a/components/tyk-gateway/templates/deployment-gw-repset.yaml +++ b/components/tyk-gateway/templates/deployment-gw-repset.yaml @@ -56,6 +56,7 @@ spec: {{- with .Values.gateway.imagePullSecrets }} imagePullSecrets: {{ toYaml . | nindent 8 }} {{- end }} + {{- if not .Values.gateway.disableInitContainer }} initContainers: - name: "setup-directories" image: busybox:1.32 @@ -64,6 +65,7 @@ spec: volumeMounts: - name: tyk-scratch mountPath: /mnt/tyk-gateway + {{- end }} containers: - name: gateway-{{ .Chart.Name }} image: "{{ .Values.gateway.image.repository }}:{{ .Values.gateway.image.tag }}" @@ -135,12 +137,19 @@ spec: value: "/opt/tyk-gateway/templates" - name: TYK_GW_TYKJSPATH value: "/opt/tyk-gateway/js/tyk.js" + {{- if not .Values.gateway.disableInitContainer }} - name: TYK_GW_MIDDLEWAREPATH value: "/mnt/tyk-gateway/middleware" - name: TYK_GW_APPPATH value: "/mnt/tyk-gateway/apps" - name: TYK_GW_POLICIES_POLICYPATH value: "/mnt/tyk-gateway/policies" + {{- else}} + - name: TYK_GW_MIDDLEWAREPATH + value: "/opt/tyk-gateway/middleware" + - name: TYK_GW_APPPATH + value: "/opt/tyk-gateway/apps" + {{- end}} - name: TYK_GW_STORAGE_MAXIDLE value: "1000" - name: TYK_GW_OPTIMISATIONSUSEASYNCSESSIONWRITE @@ -202,7 +211,11 @@ spec: {{- if .Values.global.remoteControlPlane.enabled }} value: "tyk_policies" {{- else}} + {{- if not .Values.gateway.disableInitContainer }} value: "/mnt/tyk-gateway/policies/policies.json" + {{- else}} + value: "/opt/tyk-gateway/policies/policies.json" + {{- end}} {{- end}} - name: TYK_GW_HASHKEYS value: "true" @@ -226,7 +239,6 @@ spec: value: "true" - name: TYK_GW_PIDFILELOCATION value: "/mnt/tyk-gateway/tyk.pid" - - name: TYK_GW_DBAPPCONFOPTIONS_CONNECTIONSTRING value: "{{ include "tyk-gateway.dash_proto" . }}://dashboard-svc-{{ .Release.Name }}-tyk-dashboard.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.global.servicePorts.dashboard}}" - name: TYK_GW_POLICIES_POLICYCONNECTIONSTRING diff --git a/components/tyk-gateway/values.yaml b/components/tyk-gateway/values.yaml index 4adbeb06..8c0fe552 100644 --- a/components/tyk-gateway/values.yaml +++ b/components/tyk-gateway/values.yaml @@ -156,6 +156,11 @@ gateway: # The port which will be exposed on the container for tyk-gateway containerPort: 8080 + # By default, APIs, policies, and middleware are stored on a volume mount, + # enable to instead store them in the container's filesystem + # (policies will be stored in a single json file) + disableInitContainer: false + service: # type of service type: NodePort diff --git a/tyk-mdcb-data-plane/values.yaml b/tyk-mdcb-data-plane/values.yaml index 524d7a66..3f996b4c 100644 --- a/tyk-mdcb-data-plane/values.yaml +++ b/tyk-mdcb-data-plane/values.yaml @@ -168,6 +168,11 @@ tyk-gateway: # The port which will be exposed on the container for tyk-gateway containerPort: 8080 + # By default, APIs, policies, and middleware are stored on a volume mount, + # set to true to instead store them in the container's filesystem + # (policies will be stored in a single json file) + disableInitContainer: false + service: # type of service type: NodePort diff --git a/tyk-oss/values.yaml b/tyk-oss/values.yaml index 6d5b11fa..1dd17195 100644 --- a/tyk-oss/values.yaml +++ b/tyk-oss/values.yaml @@ -140,6 +140,11 @@ tyk-gateway: # The port which will be exposed on the container for tyk-gateway containerPort: 8080 + # By default, APIs, policies, and middleware are stored on a volume mount, + # set to true to instead store them in the container's filesystem + # (policies will be stored in a single json file) + disableInitContainer: false + service: # type of service type: NodePort diff --git a/tyk-single-dc/values.yaml b/tyk-single-dc/values.yaml index 0f15d0b1..2f71aebf 100644 --- a/tyk-single-dc/values.yaml +++ b/tyk-single-dc/values.yaml @@ -241,6 +241,11 @@ tyk-gateway: # The port which will be exposed on the container for tyk-gateway containerPort: 8080 + # By default, APIs, policies, and middleware are stored on a volume mount, + # set to true to instead store them in the container's filesystem + # (policies will be stored in a single json file) + disableInitContainer: false + service: # type of service type: NodePort