Skip to content

Commit

Permalink
etrip chart 0.7.0 - etripng workers
Browse files Browse the repository at this point in the history
  • Loading branch information
georgebarbarosie committed Jan 13, 2025
1 parent 841e00c commit a5fcb64
Show file tree
Hide file tree
Showing 8 changed files with 174 additions and 5 deletions.
4 changes: 2 additions & 2 deletions charts/etrip/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions charts/etrip/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}} /
Expand Down
11 changes: 11 additions & 0 deletions charts/etrip/templates/configmap-ngworker.yml
Original file line number Diff line number Diff line change
@@ -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 }}
88 changes: 88 additions & 0 deletions charts/etrip/templates/deploy-ngworker.yml
Original file line number Diff line number Diff line change
@@ -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 }}
4 changes: 3 additions & 1 deletion charts/etrip/templates/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/etrip/templates/redis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.etrip.use_redis -}}
{{- if or .Values.etrip.use_redis .Values.etripng.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down
2 changes: 1 addition & 1 deletion charts/etrip/templates/secrets.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.etrip.use_redis -}}
{{- if or .Values.etrip.use_redis .Values.etripng.enabled -}}
apiVersion: v1
kind: Secret
metadata:
Expand Down
59 changes: 59 additions & 0 deletions charts/etrip/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
replicas:
web: 1
db: 1
worker: 1

version: 4.0.66

Expand Down Expand Up @@ -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' ]

0 comments on commit a5fcb64

Please sign in to comment.