Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the openshift templates #178

Merged
merged 2 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openshift/templates/rails-postgresql-persistent.json
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@
"annotations": {
"description": "Defines how to deploy the database",
"template.alpha.openshift.io/wait-for-ready": "true",
"image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:${POSTGRESQL_VERSION}\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]"
"image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:${POSTGRESQL_VERSION}\", \"namespace\": \"${NAMESPACE}\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]"
}
},
"spec": {
Expand Down
104 changes: 90 additions & 14 deletions openshift/templates/rails-postgresql.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,23 +147,12 @@
"annotations": {
"description": "Defines how to deploy the application server",
"template.alpha.openshift.io/wait-for-ready": "true",
"image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${NAME}:latest\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]"
"image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${NAME}:latest\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"},{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${NAME}:latest\"},\"fieldPath\": \"spec.template.spec.initContainers[0].image\"}]"
}
},
"spec": {
"strategy": {
"type": "Recreate",
"recreateParams": {
"pre": {
"failurePolicy": "Abort",
"execNewPod": {
"command": [
"./migrate-database.sh"
],
"containerName": "${NAME}"
}
}
}
"type": "Recreate"
},
"replicas": 1,
"selector": {
Expand All @@ -179,6 +168,86 @@
}
},
"spec": {
"initContainers": [
{
"name": "ruby-init-container",
"image": " ",
"command": [
"./migrate-database.sh"
],
"env": [
{
"name": "DATABASE_SERVICE_NAME",
"value": "${DATABASE_SERVICE_NAME}"
},
{
"name": "POSTGRESQL_USER",
"valueFrom": {
"secretKeyRef": {
"name": "${NAME}",
"key": "database-user"
}
}
},
{
"name": "POSTGRESQL_PASSWORD",
"valueFrom": {
"secretKeyRef": {
"name": "${NAME}",
"key": "database-password"
}
}
},
{
"name": "SECRET_KEY_BASE",
"valueFrom": {
"secretKeyRef": {
"name": "${NAME}",
"key": "keybase"
}
}
},
{
"name": "POSTGRESQL_DATABASE",
"value": "${DATABASE_NAME}"
},
{
"name": "POSTGRESQL_MAX_CONNECTIONS",
"value": "${POSTGRESQL_MAX_CONNECTIONS}"
},
{
"name": "POSTGRESQL_SHARED_BUFFERS",
"value": "${POSTGRESQL_SHARED_BUFFERS}"
},
{
"name": "APPLICATION_DOMAIN",
"value": "${APPLICATION_DOMAIN}"
},
{
"name": "APPLICATION_USER",
"valueFrom": {
"secretKeyRef": {
"name": "${NAME}",
"key": "application-user"
}
}
},
{
"name": "APPLICATION_PASSWORD",
"valueFrom": {
"secretKeyRef": {
"name": "${NAME}",
"key": "application-password"
}
}
},
{
"name": "RAILS_ENV",
"value": "${RAILS_ENV}"
}
]
}
],
"containers": [
{
"name": "${NAME}",
Expand Down Expand Up @@ -316,7 +385,7 @@
"annotations": {
"description": "Defines how to deploy the database",
"template.alpha.openshift.io/wait-for-ready": "true",
"image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:12-el8\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]"
"image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:${POSTGRESQL_VERSION}\", \"namespace\": \"${NAMESPACE}\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]"
}
},
"spec": {
Expand Down Expand Up @@ -438,6 +507,13 @@
"required": true,
"value": "3.1-ubi8"
},
{
"name": "POSTGRESQL_VERSION",
"displayName": "Postgresql Version",
"description": "Version of Postgresql image to be used (12-el8 by default).",
"required": true,
"value": "12-el8"
},
{
"name": "MEMORY_LIMIT",
"displayName": "Memory Limit",
Expand Down