Skip to content

Commit

Permalink
Merge pull request #57 from sclorg/postgresql_migrate_deployment
Browse files Browse the repository at this point in the history
Postgresql migrate deployment
  • Loading branch information
phracek authored Dec 11, 2023
2 parents c15de15 + 0d17a5c commit b337664
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 26 deletions.
4 changes: 2 additions & 2 deletions charts/redhat/httpd-template/src/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ description: This content is experimental, do not use it in production. An examp
name: httpd-template
tags: quickstart,httpd
kubeVersion: '>=1.20.0'
version: 0.0.5
version: 0.0.6
annotations:
charts.openshift.io/name: Red Hat Apache HTTP Server (httpd) application (experimental).
apiVersion: v2
appVersion: 0.0.5
appVersion: 0.0.6
sources:
- https://github.com/sclorg/helm-charts
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
template.alpha.openshift.io/wait-for-ready: "true"
image.openshift.io/triggers: |-
[
{
"from": {
"kind": "ImageStreamTag",
"name": "postgresql:{{ .Values.image.tag }}"
},
"fieldPath": "spec.template.spec.containers[0].image"
}
]
labels:
template: postgresql-persistent-template
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
name: {{ .Release.Namespace }}
name: {{ .Release.Name }}
spec:
replicas: 1
selector:
name: {{ .Values.database_service_name }}
matchLabels:
name: {{ .Values.database_service_name }}
strategy:
type: Recreate
template:
Expand Down Expand Up @@ -45,7 +56,7 @@ spec:
- --live
initialDelaySeconds: 120
timeoutSeconds: 10
name: "postgresql-testing"
name: "postgresql-persistent"
ports:
- containerPort: {{ .Values.config.port }}
protocol: TCP
Expand All @@ -71,16 +82,4 @@ spec:
- name: {{ .Values.database_service_name }}-data
persistentVolumeClaim:
claimName: {{ .Values.database_service_name }}
triggers:
- imageChangeParams:
automatic: true
containerNames:
- "postgresql-testing"
from:
kind: ImageStreamTag
name: "postgresql:{{ .Values.image.tag }}"
namespace: {{ .Release.Namespace }}
lastTriggeredImage: ""
type: ImageChange
- type: ConfigChange
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ spec:
value: "{{ .Values.config.port }}"
command:
- /bin/bash
- -ec
- -exc
- "PGPASSWORD=$PGPASSWORD /usr/bin/pg_isready -d $POSTGRESQL_DATABASE -h {{ .Values.database_service_name }} -p $POSTGRESQL_PORT -U $POSTGRESQL_USER"
lookupPolicy:
local: true
restartPolicy: Never
4 changes: 2 additions & 2 deletions charts/redhat/postgresql-persistent/src/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
database_service_name: postgresql-testing
database_service_name: postgresql-persistent
memory_limit: 512Mi
namespace: postgresql-persistent-testing
volume_capacity: 1Gi
Expand All @@ -8,4 +8,4 @@ config:
postgresql_user: testu
port: 5432
image:
tag: "latest"
tag: "13-el8"
2 changes: 0 additions & 2 deletions tests/test_postgresql_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ def teardown_method(self):
self.hc_api.delete_project()

def test_package_persistent(self):
self.hc_api.set_version("0.0.1")
self.hc_api.package_name = "postgresql-imagestreams"
self.hc_api.helm_package()
assert self.hc_api.helm_installation()
self.hc_api.set_version("0.0.3")
self.hc_api.package_name = "postgresql-persistent"
self.hc_api.helm_package()
assert self.hc_api.helm_installation(values={".image.tag": "13-el8", ".namespace": self.hc_api.namespace})
Expand Down

0 comments on commit b337664

Please sign in to comment.