Skip to content

Instantly share code, notes, and snippets.

@heisendumb
Last active May 11, 2020 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heisendumb/5895bc73c78265f37aa3ea429bd570d8 to your computer and use it in GitHub Desktop.
Save heisendumb/5895bc73c78265f37aa3ea429bd570d8 to your computer and use it in GitHub Desktop.
postgres-9-keycloak
---
kind: Service
apiVersion: v1
metadata:
name: postgres
labels:
name: postgres
spec:
ports:
- name: postgres
protocol: TCP
port: 5432
targetPort: 5432
selector:
deploymentconfig: postgres
type: ClusterIP
---
kind: DeploymentConfig
apiVersion: v1
metadata:
name: postgres
labels:
application: postgres
spec:
strategy:
activeDeadlineSeconds: 21600
resources: {}
rollingParams:
intervalSeconds: 1
maxSurge: 1
maxUnavailable: 1
timeoutSeconds: 360
updatePeriodSeconds: 1
type: Rolling
triggers:
- type: ConfigChange
replicas: 1
selector:
deploymentConfig: postgres
template:
metadata:
name: postgres
labels:
deploymentConfig: postgres
application: postgres
spec:
containers:
- name: postgres
image: registry.centos.org/sclo/postgresql-95-centos7:latest
livenessProbe:
failureThreshold: 3
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: 5432
timeoutSeconds: 1
ports:
- containerPort: 5432
protocol: TCP
readinessProbe:
exec:
command:
- /bin/sh
- "-i"
- "-c"
- >-
psql -h 127.0.0.1 -U $POSTGRESQL_USER -q -d template1 -c
'SELECT 1'
failureThreshold: 3
initialDelaySeconds: 5
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
ports:
- containerPort: 5432
protocol: TCP
- name: https
containerPort: 8443
protocol: TCP
resources:
limits:
cpu: "1"
memory: 512Mi
requests:
cpu: 100m
memory: 100Mi
env:
- name: POSTGRESQL_USER
valueFrom:
secretKeyRef:
key: username
name: postgresql-username-secret
- name: POSTGRESQL_PASSWORD
valueFrom:
secretKeyRef:
key: password
name: postgresql-password-secret
- name: POSTGRESQL_DATABASE
value: KEYCLOAK
- name: POSTGRESQL_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
key: password
name: postgresql-root-password-secret
volumeMounts:
- mountPath: "/var/lib/pgsql/data"
name: pgdata
readOnly: false
volumes:
- name: pgdata
---
apiVersion: v1
kind: Secret
metadata:
name: postgresql-password-secret
namespace: sso
labels:
application: keycloak
data:
password: ""
---
apiVersion: v1
kind: Secret
metadata:
name: postgresql-root-password-secret
namespace: sso
labels:
application: postgres
data:
password: ""
---
apiVersion: v1
kind: Secret
metadata:
name: postgresql-username-secret
namespace: sso
labels:
application: keycloak
data:
username: ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment