Skip to content

Commit

Permalink
Use the same container in OpenShift and in minikube
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Schwartz <aschwart@redhat.com>
  • Loading branch information
ahus1 committed Mar 21, 2024
1 parent d9fe645 commit 2f809b5
Showing 1 changed file with 7 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,6 @@ spec:
spec:
containers:
- imagePullPolicy: Always
{{ if eq .Values.environment "openshift" }}
# Running a different container on OpenShift that doesn't need root support.
# As this is pulled from the Red Hat registry, this is not available on minikube
env:
- name: POSTGRESQL_PASSWORD
value: secret99
- name: POSTGRESQL_USER
value: keycloak
- name: POSTGRESQL_DATABASE
value: keycloak
- name: POSTGRESQL_MAX_PREPARED_TRANSACTIONS
value: '100'
image: registry.redhat.io/rhel9/postgresql-15
{{ else }}
env:
- name: POSTGRES_PASSWORD
value: secret99
Expand All @@ -45,12 +31,10 @@ spec:
- name: POSTGRES_DB
value: keycloak
image: postgres:15
args:
# default of max_prepared_transactions is 0, and this setting should match the number of active connections
# so that running Quarkus with JTA and more than one data store can prepare transactions.
- -c
- max_prepared_transactions=100
{{ end }}
volumeMounts:
# Using volume mount for PostgreSQL's data folder as it is otherwise not writable
- mountPath: /var/lib/postgresql
name: cache-volume
resources:
requests:
cpu: "{{ .Values.cpuRequests }}"
Expand All @@ -74,6 +58,9 @@ spec:
ports:
- containerPort: 5432
protocol: TCP
volumes:
- name: cache-volume
emptyDir: { }
restartPolicy: Always
# The rhel9/postgresql-13 is known to take ~30 seconds to shut down
# As this is a deployment with ephemeral storage, there is no need to wait as the data will be gone anyway
Expand Down

0 comments on commit 2f809b5

Please sign in to comment.