-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Quarkus with liquibase on Kubernetes #33097
Comments
/cc @Sgitario (kubernetes), @andrejpetras (liquibase), @geoand (kubernetes,liquibase,openshift), @gsmet (liquibase), @iocanel (kubernetes,openshift) |
To give more context, this was introduced by #29026:
Yet having |
THank you @Sgitario . I'm finding that the job also doesn't actually start on OpenShift 4.12. It errors out with a But in any case, if I don't want the migration I shouldn't need to even have that job/init container. |
Thanks! This should be definitely fixed for OpenShift.
+100 |
I also tried to change the image the init container uses by using |
The `quarkus.[flyway or liquibase or liquibase-mongodb].enabled` and `quarkus.[flyway or liquibase or liquibase-mongodb].migrate-at-start` properties are runtime properties, so I have to create the following build time properties to read these values and allow users configurating it: - `quarkus.[flyway or liquibase or liquibase-mongodb].generate-init-task` with default value `quarkus.[flyway or liquibase or liquibase-mongodb].enabled` - `quarkus.[flyway or liquibase or liquibase-mongodb].migrate-with-init-task` with default value `quarkus.[flyway or liquibase or liquibase-mongodb].migrate-at-start` Plus, I've extended the coverage of these extensions with the K8s tests. Fix quarkusio#33097
To groundnuty/k8s-wait-for:no-root-v1.7. Related to quarkusio#33097 (comment)
@edeandrea all the issues you spotted should be fixed by #33116. |
Thank you for the quick turnaround! |
The `quarkus.[flyway or liquibase or liquibase-mongodb].enabled` and `quarkus.[flyway or liquibase or liquibase-mongodb].migrate-at-start` properties are runtime properties, so I have to create the following build time properties to read these values and allow users configurating it: - `quarkus.[flyway or liquibase or liquibase-mongodb].generate-init-task` with default value `quarkus.[flyway or liquibase or liquibase-mongodb].enabled` - `quarkus.[flyway or liquibase or liquibase-mongodb].migrate-with-init-task` with default value `quarkus.[flyway or liquibase or liquibase-mongodb].migrate-at-start` Plus, I've extended the coverage of these extensions with the K8s tests. Fix quarkusio#33097
To groundnuty/k8s-wait-for:no-root-v1.7. Related to quarkusio#33097 (comment)
FWIW, |
Hmmm. Maybe we need a build time property? I still think the requirement is valid. |
Absolutely. There requirement is perfectly valid we do need a feature flag for this. |
I do think that having a build-time property will make this feature mostly unused. But taking into account the comments, I'm closing #33116 in favor of a new build-time property. @iocanel I'm delegating this issue to you, so you can fix it with what you have in mind. Thanks all for your comments! |
I don't think that you should close your pull request. You have put time to create it and I have put time to review it, we better work out the points were we disaagree and move forward. I also don't understand the point about the build time property thing. Your pull request introduces a new build time property as a feature flag |
I really appreciate your time, but I think it would be better to start over with a new pull request as the solution of adding only a new property would be much simpler. Also, it's the thing about the new decorators I added, which I agree with you that it over-complicates the solution, tho I don't see any other easier solution, so the user config takes precedence over the auto-generated configuration :/ |
About adding only one build-time property About:
Perhaps, the easiest solution is not to do this for now. So, the generated init-container would not be configurable yet. Wdyt? @iocanel |
There were 2 things that I was hoping for
In the interim I've put in a hack which strips this out: https://github.com/quarkusio/quarkus-super-heroes/blob/main/scripts/generate-k8s-resources.sh#L97_L99 |
I think that this is the pefect sized solution! I am not 100% sure if the default value for |
Just to extend my reasoning about why it should be
I guess you mean to fix the image to be used, so it works in OpenShift, right? If so, this should be also addressed by a536cb9.
@edeandrea I think adding the new build time property would cover the second point. |
I understand the reasoning. However, at build time the value of Also note that beyond liquibase, liquibase-mongo and flyway, this feature is currently being opened up to users, allowing them to bring their own initialization code. This means that if we disable by default it will require way too much configuration to enable everyting. I'd rather have everything by default and let users decide what to disable, than having everything disabled practically the feature. |
@edeandrea: Until we get this sorted out, there are the following options you can already use to globally disable creating Jobs: The fact that I had to look multiple times to find it (even though I added that myself) is a strong indication, that the name is not good enough. |
I was not aware of it. Thanks @iocanel ! |
@iocanel those properties seem to do the trick! |
Although these flags seem to not be specific to Liquibase/mongo/etc. They seem to be global for all extensions that may generate k8s resources? |
Yes, though I don't think there are many extensions using this. I'm working in a pull request to provide a new property so we can exclude only one init task. |
To groundnuty/k8s-wait-for:no-root-v1.7. Related to quarkusio#33097 (comment)
@iocanel @edeandrea I've provided a new pull request without adding the controversial changes (won't add any new property in the flyway, liquibase and liquibase-mongodb extensions). The pull request includes the changes described in the description: #33409 (comment) Let me know if you feel better with the changes on it! |
To groundnuty/k8s-wait-for:no-root-v1.7. Related to quarkusio#33097 (comment)
To groundnuty/k8s-wait-for:no-root-v1.7. Related to quarkusio#33097 (comment)
To groundnuty/k8s-wait-for:no-root-v1.7. Related to quarkusio#33097 (comment)
Describe the bug
Hi - I've noticed when using the Quarkus Kubernetes/OpenShift extension when an app uses MongoDB that there is this new
liquibase-mongodb-init
kubernetesJob
added.Why is that, especially if my app has
quarkus.liquibase-mongodb.migrate-at-start=false
set?when i run
./mvnw clean package -Dquarkus.kubernetes.deployment-target=openshift -Dquarkus.liquibase-mongodb.migrate-at-start=false
I still see this in the resultingtarget/openshift.yml
(note I've removed some things to make it shorter & more readable).Why do I need that init container if my app doesn't need it? Furthermore, on Openshift 4.12, that
liquibase-mongodb-init
container never actually starts up and causes my entire app not to work.The image
groundnuty/k8s-wait-for:1.3
seems that the version ofkubctl
is too old.But in any case, if my app specifies
quarkus.liquibase-mongodb.migrate-at-start=false
why do I even need all this init container stuff?Expected behavior
No response
Actual behavior
No response
How to Reproduce?
cd
intorest-fights
./mvnw clean package -DskipTests -Dmaven.compiler.release=17 \ -Dquarkus.container-image.tag=java17-latest \ -Dquarkus.liquibase-mongodb.migrate-at-start=false \ -Dquarkus.kubernetes.deployment-target=openshift \ -Dquarkus.kubernetes.version=java17-latest \ -Dquarkus.kubernetes.ingress.expose=true \ -Dquarkus.kubernetes.resources.limits.memory=768Mi \ -Dquarkus.kubernetes.resources.requests.memory=256Mi \ -Dquarkus.openshift.version=java17-latest \ -Dquarkus.openshift.route.expose=true \ -Dquarkus.openshift.resources.limits.memory=768Mi \ -Dquarkus.openshift.resources.requests.memory=256Mi \ -Dquarkus.kubernetes.deploy=true \ -Dquarkus.container-image.group=$(oc project -q) \ -Dquarkus.container-image.registry= \ -Dquarkus.profile=openshift-17
Notice in
target/kubernetes/openshift.yml
that init container is still there and actually never starts up when deployed.Output of
uname -a
orver
No response
Output of
java -version
No response
GraalVM version (if different from Java)
No response
Quarkus version or git rev
No response
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: