diff --git a/charts/etrip/Chart.yaml b/charts/etrip/Chart.yaml index f96ec9a..8c6d7e8 100644 --- a/charts/etrip/Chart.yaml +++ b/charts/etrip/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v1 name: etrip description: eTrip PHP Helm chart type: application -version: 0.6.1 -appVersion: 6.0.86 +version: 0.7.0 +appVersion: 6.5.35 diff --git a/charts/etrip/templates/_helpers.tpl b/charts/etrip/templates/_helpers.tpl index 4f08089..b391717 100644 --- a/charts/etrip/templates/_helpers.tpl +++ b/charts/etrip/templates/_helpers.tpl @@ -15,6 +15,15 @@ imagePullPolicy: {{ .pullPolicy }} {{- end -}} {{- end -}} +{{- define "etripngImage" }} +{{- with .Values.etripng.image -}} +image: {{ .registry -}} / + {{- .name -}} : + {{- .tag | default $.Values.version | default $.Chart.AppVersion | toString }} +imagePullPolicy: {{ .pullPolicy }} +{{- end -}} +{{- end -}} + {{- define "frontendsImage" -}} {{- with .Values.frontends.image -}} image: {{ .registry -}} / diff --git a/charts/etrip/templates/configmap-ngworker.yml b/charts/etrip/templates/configmap-ngworker.yml new file mode 100644 index 0000000..fce4ea7 --- /dev/null +++ b/charts/etrip/templates/configmap-ngworker.yml @@ -0,0 +1,11 @@ +{{- if .Values.etripng.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-worker + namespace: {{ .Release.Namespace }} + labels: + {{- include "labels" . | nindent 4 }} +data: | + config.yaml: {{ .Values.etripng.config | toYaml | nindent 4 }} +{{- end }} diff --git a/charts/etrip/templates/deploy-ngworker.yml b/charts/etrip/templates/deploy-ngworker.yml new file mode 100644 index 0000000..a54d9bf --- /dev/null +++ b/charts/etrip/templates/deploy-ngworker.yml @@ -0,0 +1,88 @@ +{{- if .Values.etripng.enabled }} +{{- $db := mergeOverwrite .Values.db ( .Values.db.operator_install | default dict ) -}} +{{- $clusterName := include "clusterName" $ -}} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-worker + namespace: {{ .Release.Namespace }} + labels: + {{- include "labels" . | nindent 4 }} + app.kubernetes.io/component: worker +spec: + replicas: {{ .Values.replicas.worker }} + selector: + matchLabels: + {{- include "selectorLabels" . | nindent 6 }} + app.kubernetes.io/component: worker + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 + type: RollingUpdate + template: + metadata: + labels: + {{- include "selectorLabels" . | nindent 8 }} + app.kubernetes.io/component: worker + annotations: + checksum/config: {{ include (print $.Template.BasePath "/configmap-ngworker.yml") . | sha256sum }} + spec: + securityContext: + fsGroup: 33 + containers: + - name: worker + command: [ php, /bin/worker.php ] + {{- include "etripngImage" . | nindent 8 }} + volumeMounts: + - mountPath: /app/config.yaml + name: config + subPath: config.yaml + - mountPath: /secrets + name: secrets + readOnly: true + env: + - name: ETRIP_DSN + value: >- + user=etrip + host={{ .Release.Name }}-db-rw + sslcert=/secrets/app-tls/postgresql.crt + sslkey=/secrets/app-tls/postgresql.key + sslrootcert=/secrets/app-tls/root.crt + - name: ETRIP_DSN_RO + value: >- + user=etrip + host={{ .Release.Name }}-db-r + sslcert=/secrets/app-tls/postgresql.crt + sslkey=/secrets/app-tls/postgresql.key + sslrootcert=/secrets/app-tls/root.crt + - name: REDIS_SECRET + valueFrom: + secretKeyRef: + name: {{ .Release.Name }}-secrets + key: session + - name: REDIS_URL + value: redis://user:$(REDIS_SECRET)@{{ .Release.Name }}-redis:6379/ + resources: + {{- toYaml .Values.resources.worker | nindent 10 }} + volumes: + - name: config + configMap: + name: {{ .Release.Name }}-worker + items: + - key: config.yaml + path: config.yaml + - name: secrets + projected: + sources: + - secret: + name: {{ .Release.Name }}-db-app-tls + items: + - key: tls.crt + path: app-tls/postgresql.crt + - key: tls.key + path: app-tls/postgresql.key + mode: 416 + - key: ca.crt + path: app-tls/root.crt +{{- end }} \ No newline at end of file diff --git a/charts/etrip/templates/deploy.yml b/charts/etrip/templates/deploy.yml index 5ac4b53..1edd91a 100644 --- a/charts/etrip/templates/deploy.yml +++ b/charts/etrip/templates/deploy.yml @@ -108,12 +108,14 @@ spec: sslcert=/secrets/app-tls/postgresql.crt sslkey=/secrets/app-tls/postgresql.key sslrootcert=/secrets/app-tls/root.crt - {{- if .Values.etrip.use_redis }} + {{- if or .Values.etrip.use_redis .Values.etripng.enabled }} - name: REDIS_SECRET valueFrom: secretKeyRef: name: {{ .Release.Name }}-secrets key: session + - name: REDIS_URL + value: redis://user:$(REDIS_SECRET)@{{ .Release.Name }}-redis:6379/ {{- end }} {{- with .Values.etrip.searchlogs -}}{{- if .enabled }} {{- if not .certificate }} diff --git a/charts/etrip/templates/redis.yml b/charts/etrip/templates/redis.yml index 3b6df29..d4f544e 100644 --- a/charts/etrip/templates/redis.yml +++ b/charts/etrip/templates/redis.yml @@ -1,4 +1,4 @@ -{{- if .Values.etrip.use_redis -}} +{{- if or .Values.etrip.use_redis .Values.etripng.enabled -}} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/charts/etrip/templates/secrets.yml b/charts/etrip/templates/secrets.yml index 64431a8..b296938 100644 --- a/charts/etrip/templates/secrets.yml +++ b/charts/etrip/templates/secrets.yml @@ -1,4 +1,4 @@ -{{- if .Values.etrip.use_redis -}} +{{- if or .Values.etrip.use_redis .Values.etripng.enabled -}} apiVersion: v1 kind: Secret metadata: diff --git a/charts/etrip/values.yaml b/charts/etrip/values.yaml index 0acfa72..ea66e51 100644 --- a/charts/etrip/values.yaml +++ b/charts/etrip/values.yaml @@ -1,6 +1,7 @@ replicas: web: 1 db: 1 + worker: 1 version: 4.0.66 @@ -1120,3 +1121,61 @@ resources: requests: cpu: 100m memory: 50Mi + worker: + limits: + cpu: "2" + memory: 500Mi + requests: + cpu: 100m + memory: 50Mi + +etripng: + enabled: false + image: + pullPolicy: IfNotPresent + registry: eu.gcr.io/tripsol + name: etrip-ng + tag: pr6 + config: + supplier: + cyberlogic: + connections: {} + # # example: + # KCGT: + # url: https://kcg-hub.cyberlogic.cloud/services/jsonwebservice/ + # mediaUrl: https://medapi.kcgservices.gr/images/hotels + # login: username + # password: password + # useTariff: true + # noCache: false + # language: en + # currency: EUR + # productType: 7 + # supplier: '2775' + sansejour: + connections: {} + # # example: + # ITS: + # baseUrl: http://mementogroup.sansejour.com/sws/ + # database: database + # username: username + # password: password + # onlyAvailable: true + # language: EN + # productType: 7 + travelgatex: + url: https://api.travelgatex.com/ + apiKey: '' + clientCode: '' + connections: {} + # # example: + # tgx-wlcb: + # context: AVRT + # accessCode: password + # language: en + # currency: EUR + # auditTransactions: true + # testMode: false + # supplier: "793" + # productType: 7 + allowedIPs: [ '127.0.0.1' ]