jkube icon indicating copy to clipboard operation
jkube copied to clipboard

DeploymentConfig Resource dropping yml elements for spec.strategy

Open pmbsa opened this issue 3 years ago • 5 comments

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

  1. Have a rollingUpdate strategy define in the deployment template as per the above
  2. 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

pmbsa avatar Jun 10 '22 07:06 pmbsa

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

manusa avatar Jun 10 '22 07:06 manusa

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?

pmbsa avatar Jun 10 '22 08:06 pmbsa

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

manusa avatar Jun 10 '22 08:06 manusa

awsome, thanks for that

pmbsa avatar Jun 10 '22 08:06 pmbsa

@pmbsa Is this working for you? Can we close this issue? Thanks

sunix avatar Jun 27 '22 09:06 sunix

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: @.***>

pmbsa avatar Oct 11 '22 07:10 pmbsa