jkube
jkube copied to clipboard
DeploymentConfig Resource dropping yml elements for spec.strategy
Describe the bug
I have a deployment template that has a strategy as follows
spec:
strategy:
rollingUpdate:
maxSurge: 100%
maxUnavailable: 25%
type: RollingUpdate
after running oc:resource, the result appears to just loose the rollingUpdate: section entirely so the result is
spec:
strategy:
type: RollingUpdate
I assume I am missing something in my config, has anybody else had this issue at all?
Eclipse JKube version
1.8.0
Component
OpenShift Maven Plugin
Apache Maven version
3.8.3
Gradle version
No response
Steps to reproduce
- Have a rollingUpdate strategy define in the deployment template as per the above
- run mvn oc.resource
Expected behavior
I expected the resulting DeploymentConfig to have a spec.strategy section like this
strategy:
rollingUpdate:
maxSurge: 100%
maxUnavailable: 25%
type: RollingUpdate
Runtime
OpenShift
Kubernetes API Server version
other (please specify in additional context)
Environment
Linux
Eclipse JKube Logs
No response
Sample Reproducer Project
No response
Additional context
Kubernetes Version: v1.22.8+c02bd9d
Your YAML template doesn't seem to adapt to the structure of a DeploymentConfig:
https://docs.openshift.com/container-platform/4.10/rest_api/workloads_apis/deploymentconfig-apps-openshift-io-v1.html#spec-strategy
https://docs.openshift.com/container-platform/4.10/rest_api/workloads_apis/deploymentconfig-apps-openshift-io-v1.html#spec-strategy-rollingparams
I'm not sure, but this seems more like the input you need:
spec:
strategy:
rollingParams:
maxSurge: 100%
maxUnavailable: 25%
type: Rolling
Thanks Manusa.... apologies, this is the first time we are generating openshift manifests... it just dawned on me that fragment is named deployment.yml and the oc plugin is generating DeploymentConfig.... how do I get it to just generate a deployment for openshift?
how do I get it to just generate a deployment for openshift?
There are several options available. The easiest is to use the jkube.build.switchToDeployment property:
<properties>
<jkube.build.switchToDeployment>true</jkube.build.switchToDeployment>
</properties>
https://www.eclipse.org/jkube/docs/openshift-maven-plugin#jkube-openshift-deploymentconfig
awsome, thanks for that
@pmbsa Is this working for you? Can we close this issue? Thanks
Yes, absolutly, please close it On 27 Jun 2022, 11:21 +0200, "Sun S. D. Tan" @.***>, wrote:
@pmbsa Is this working for you? Can we close this issue? Thanks — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>