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

templates: use pg_isready as liveness probe #206

Merged
merged 6 commits into from
Dec 7, 2017

Conversation

pkubatrh
Copy link
Member

Resolves: #195

@pkubatrh
Copy link
Member Author

@praiskup Can you take a quick look at this?

@pvalena @bparees Is there anything more we need to do to get the change into the Openshift templates?

@pvalena
Copy link
Member

pvalena commented Nov 21, 2017

AFAIK you primarily need to add the new version 9.6

  • as a default for deployment; and
  • in all texts, such as 9.2, 9.4, 9.5 or latest

Thanks!

@pkubatrh
Copy link
Member Author

Makes sense, thanks.

@@ -245,8 +245,8 @@
{
"name": "POSTGRESQL_VERSION",
"displayName": "Version of PostgreSQL Image",
"description": "Version of PostgreSQL image to be used (9.2, 9.4, 9.5 or latest).",
"value": "9.5",
"description": "Version of PostgreSQL image to be used (9.4, 9.5, 9.6 or latest).",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is 9.2 not relevant anymore?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has been deprecated for a long while already.

Copy link
Member

@pvalena pvalena Nov 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. We'll need to keep an eye on that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pg_isready is not available for 9.2 anyway

@@ -5,7 +5,7 @@
"name": "postgresql-ephemeral",
"annotations": {
"openshift.io/display-name": "PostgreSQL (Ephemeral)",
"description": "PostgreSQL database service, without persistent storage. For more information about using this template, including OpenShift considerations, see https://github.com/sclorg/postgresql-container/blob/master/9.5.\n\nWARNING: Any data stored will be lost upon pod destruction. Only use this template for testing",
"description": "PostgreSQL database service, without persistent storage. For more information about using this template, including OpenShift considerations, see https://github.com/sclorg/postgresql-container/.\n\nWARNING: Any data stored will be lost upon pod destruction. Only use this template for testing",
Copy link
Member

@pvalena pvalena Nov 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK this was meant to give container-specific instructions (really simple, basic usage).
Therefore pointing to README.md - for OpenShift; regardless of version (IMHO most ppl just use latest).
IOW: I'd rather keep the 9.6.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have modified this in preparation for the last stages of image content generation (see #203 ) - eventually there will not be a 9.6 to directly link to and so the current link would result in a 404.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally, it is currently impossible to link to the 9.6 README anyway, without going through latest/ which might change into a different version in the future. So it makes sense to me to just point users to the root.

@pvalena
Copy link
Member

pvalena commented Nov 21, 2017

-- I hope it's not a problem for OpenShift, as they might link to it somewhere AFAIK.

@bparees, is it fine if 9.6 folder is just a symlink? Can we link root, or possibly latest directory?

@pvalena
Copy link
Member

pvalena commented Nov 21, 2017

FTR: Subsequently I'll create image-streams and PR for openshift/origin.

@pvalena
Copy link
Member

pvalena commented Nov 21, 2017

Also: before this PR gets merged I'd like to have the original template tested it by CI in OpenShift, so the changes can be actually validated.

See #204.

@@ -127,11 +127,11 @@
}
},
"livenessProbe": {
"exec": {
"command": [ "/bin/sh", "-i", "-c", "pg_isready -h 127.0.0.1 -p 5432" ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the /bin/sh is necessary, but I would rather avoid using the -i option, if possible.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have left it in only because it was present in other /bin/sh invocations inside the template

@praiskup
Copy link
Contributor

@bparees, is it fine if 9.6 folder is just a symlink? Can we link root, or possibly latest directory?

This is long time discussed thing; IMO linking directly to gitrepo - to concrete paths - is a bad practice. There's a card on trello where we could discuss/implement a better place for documentation.

Regarding the link, it is a temporary issue ... since we could move the "latest" to PostgreSQL 10 soon, at least for testing purposes.

@praiskup
Copy link
Contributor

This looks good to me, but having this tested is a must :-)

@@ -71,7 +71,7 @@
"name": "IMAGESTREAMTAG",
"displayName": "ImageStreamTag",
"description": "The OpenShift ImageStreamTag to use for PostgreSQL.",
"value": "postgresql:9.5"
"value": "postgresql:9.6"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's no postgres 9.6 imagestream tag in openshift yet:
https://github.com/openshift/origin/blob/master/examples/image-streams/image-streams-centos7.json#L724-L795

so you need to deliver that before you start making templates default to looking for it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll update at once - in our repos. The template will be actually tested with freshly build and tagged image into custom namespace.

@bparees
Copy link
Collaborator

bparees commented Nov 21, 2017

@praiskup can you lay out the plan/order of operations here? is it to:

  1. deliver this here
  2. deliver the 9.6 imagestream to origin/image-streams
  3. deliver this template to origin/db-templates

?

@praiskup
Copy link
Contributor

According to the discussion here, I think so :-), per @pvalena comment:

FTR: Subsequently I'll create image-streams and PR for openshift/origin.

@pvalena
Copy link
Member

pvalena commented Nov 21, 2017

@bparees, the order is a bit parallelized, but basically:

  1. openshift tests
  2. updated template (container folder already done)
  3. generated image-streams, although currently using manual comparison
  4. Pull Requests to openshift/origin

Where (1+2) and 3 are being worked on in parallel (I'm working on the image-streams; and together with @hhorak will provide help with the steps above).

@pkubatrh
Copy link
Member Author

I will look into getting the tests up and running so we can test this out properly.

@pkubatrh
Copy link
Member Author

pkubatrh commented Dec 1, 2017

[test-openshift]

@pkubatrh
Copy link
Member Author

pkubatrh commented Dec 4, 2017

[test-openshift]

@pkubatrh
Copy link
Member Author

pkubatrh commented Dec 4, 2017

[test-openshift]

@pkubatrh
Copy link
Member Author

pkubatrh commented Dec 4, 2017

@praiskup Seems like resalloc does not want to cooperate again.

@praiskup
Copy link
Contributor

praiskup commented Dec 5, 2017

[test-openshift]

@pkubatrh
Copy link
Member Author

pkubatrh commented Dec 5, 2017

Thanks! Tests are green now

@pkubatrh
Copy link
Member Author

pkubatrh commented Dec 5, 2017

Fixed one more issue with pure image tests [test-openshift]

@pkubatrh
Copy link
Member Author

pkubatrh commented Dec 5, 2017

[test-openshift]

@praiskup
Copy link
Contributor

praiskup commented Dec 7, 2017

lgtm

@pkubatrh
Copy link
Member Author

pkubatrh commented Dec 7, 2017

Thanks for review! I will make one more rebase against container common scripts to pick up sclorg/container-common-scripts#45

It is not needed for postgresql's openshift tests right now but I would like to have it fixed for eventual s2i (or other cases accessing the internet) before the problem is forgotten again.

@pkubatrh
Copy link
Member Author

pkubatrh commented Dec 7, 2017

[test-openshift]

@pkubatrh
Copy link
Member Author

pkubatrh commented Dec 7, 2017

Tests are green. Merging this in. Thanks everyone!

@pkubatrh pkubatrh merged commit 8230ed1 into sclorg:master Dec 7, 2017
@pkubatrh pkubatrh deleted the liveness branch December 12, 2017 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants