124 lines
3.1 KiB
YAML
124 lines
3.1 KiB
YAML
#
|
|
# Copyright (c) 2012-2018 Red Hat, Inc.
|
|
# This program and the accompanying materials are made
|
|
# available under the terms of the Eclipse Public License 2.0
|
|
# which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
#
|
|
# SPDX-License-Identifier: EPL-2.0
|
|
#
|
|
|
|
---
|
|
kind: Template
|
|
apiVersion: v1
|
|
metadata:
|
|
name: postgres
|
|
annotations:
|
|
description: Che
|
|
objects:
|
|
- apiVersion: v1
|
|
kind: DeploymentConfig
|
|
metadata:
|
|
name: postgres
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
app: postgres
|
|
strategy:
|
|
resources: {}
|
|
type: Recreate
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: postgres
|
|
spec:
|
|
containers:
|
|
- env:
|
|
- name: POSTGRESQL_USER
|
|
value: keycloak
|
|
- name: POSTGRESQL_PASSWORD
|
|
value: keycloak
|
|
- name: POSTGRESQL_DATABASE
|
|
value: keycloak
|
|
- name: "CHE_POSTGRES_USERNAME"
|
|
value: "pgche"
|
|
- name: "CHE_POSTGRES_PASSWORD"
|
|
value: "pgchepassword"
|
|
- name: "CHE_POSTGRES_DATABASE"
|
|
value: "dbche"
|
|
- name: "POSTGRESQL_LOG_DEBUG"
|
|
value: "${POSTGRESQL_LOG_DEBUG}"
|
|
image: '${IMAGE_POSTGRES}:${CHE_VERSION}'
|
|
imagePullPolicy: Always
|
|
name: postgres
|
|
livenessProbe:
|
|
failureThreshold: 3
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 10
|
|
successThreshold: 1
|
|
tcpSocket:
|
|
port: 5432
|
|
timeoutSeconds: 1
|
|
readinessProbe:
|
|
exec:
|
|
command:
|
|
- /bin/sh
|
|
- '-i'
|
|
- '-c'
|
|
- >-
|
|
psql -h 127.0.0.1 -U $POSTGRESQL_USER -q -d
|
|
$POSTGRESQL_DATABASE -c 'SELECT 1'
|
|
failureThreshold: 10
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 5
|
|
successThreshold: 1
|
|
timeoutSeconds: 1
|
|
ports:
|
|
- containerPort: 5432
|
|
resources: {}
|
|
volumeMounts:
|
|
- mountPath: /var/lib/pgsql/data
|
|
name: postgres-data
|
|
restartPolicy: Always
|
|
volumes:
|
|
- name: postgres-data
|
|
persistentVolumeClaim:
|
|
claimName: postgres-data
|
|
test: false
|
|
- apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: postgres
|
|
spec:
|
|
ports:
|
|
- name: "5432"
|
|
port: 5432
|
|
targetPort: 5432
|
|
selector:
|
|
app: postgres
|
|
- apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: postgres-data
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
resources:
|
|
requests:
|
|
storage: 1Gi
|
|
parameters:
|
|
- name: CHE_VERSION
|
|
displayName: Eclipse Che version
|
|
description: Eclipse Che version which defaults to nightly
|
|
value: nightly
|
|
- name: IMAGE_POSTGRES
|
|
displayName: Postgres DB Image
|
|
description: Postgres DB Image. Defaults to docker.io/eclipse/che-postgres
|
|
value: docker.io/eclipse/che-postgres
|
|
- name: POSTGRESQL_LOG_DEBUG
|
|
displayName: Postgres DB debug
|
|
description: Enable Postgres DB debug log mode
|
|
value: "false"
|
|
labels:
|
|
app: postgres
|
|
template: postgres
|