travelaudience / kubernetes-nexus

Run Sonatype Nexus Repository Manager OSS on top of Kubernetes (GKE). Includes instructions for automated backups (GCS) and day-to-day usage.
Apache License 2.0
130 stars 61 forks source link

Nexus data directory already in use: /nexus-data #43

Open alexandrst88 opened 5 years ago

alexandrst88 commented 5 years ago

When upgrade chart via helm, the new pod is stuck, with RollingUpdate strategy due to

Nexus data directory already in use: /nexus-data
pires commented 5 years ago

@jeff-knurek @TAvardit as the Helm experts in the house, can you please help?

varditn commented 5 years ago

@alexandrst88 - The problem is caused by having a rollingUpdate strategy with default settings (MaxSurge 25% maxUnavailable 25%) , one replica and PV. An ability to change these settings was added to chart version 1.10.0 (https://github.com/helm/charts/tree/master/stable/sonatype-nexus), so you can either upgrade your chart and edit the values or update you live deployment manifest to be set to :

maxSurge: 0
maxUnavailable: 1
mwy-bi-web commented 5 years ago

The chart has no option to set MaxSurge/maxUnavailable. So this is still an issue.

mwy-bi-web commented 5 years ago

Update: My fault, is is possible to set it. But the documentation is very missleading. Is says the default is "rollingUpdate" which is wrong, the default is "{}" - so we can pass an object here, not a string.

The correct value is:

deploymentStrategy:
  type: RollingUpdate
  rollingUpdate:
    maxSurge: 0
    maxUnavailable: 1

Edit: maybe this should be the default to make the chart work?

varditn commented 5 years ago

Actually, if no strategy was specified the default strategy is rollingUpdate. Did you experience issue deploying the chart without changing the empty object of deploymentStrategy ?

mwy-bi-web commented 5 years ago

Yes. The default is maxSurge: 25%, maxUnavailable: 25%. So with 1 replicas, nexus is first started and then stopped leading to this issue.

varditn commented 5 years ago

Yes, I didn't want to change the default deploymentStrategy but to allow users to change it based on their need.