helm / charts

⚠️(OBSOLETE) Curated applications for Kubernetes
Apache License 2.0
15.49k stars 16.81k forks source link

[stable/gocd] gocd-server won't start if persistentVolume is not enabled #8579

Closed ghost closed 5 years ago

ghost commented 6 years ago

Is this a request for help?: No


Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT

Version of Helm and Kubernetes:

Kubernetes:

Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.3", GitCommit:"2bba0127d85d5a46ab4b778548be28623b32d0b0", GitTreeState:"clean", BuildDate:"2018-07-26T20:40:11Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"10+", GitVersion:"v1.10.3-eks", GitCommit:"58c199a59046dbf0a13a387d3491a39213be53df", GitTreeState:"clean", BuildDate:"2018-09-21T21:00:04Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}

Helm:

Client: &version.Version{SemVer:"v2.11.0", GitCommit:"2e55dbe1fdb5fdb96b75ff144a339489417b146b", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.11.0", GitCommit:"2e55dbe1fdb5fdb96b75ff144a339489417b146b", GitTreeState:"clean"}

Which chart: stable/gocd

What happened:

When trying to install the chart, the server went into a crashloop failing to find a expected file:

Exec lifecycle hook ([/bin/bash /preconfigure_server.sh]) for Container "gocd-server" in Pod "joking-panda-gocd-server-56b4d757f9-nr49w_default(c2108aad-d2ed-11e8-80b9-022c3ec41a3a)" failed - error: command '/bin/bash /preconfigure_server.sh' exited with 127: /bin/bash: /preconfigure_server.sh: No such file or directory
, message: "/bin/bash: /preconfigure_server.sh: No such file or directory\n"

What you expected to happen: Should have started up as normal, even w/o persistent volume in place

How to reproduce it (as minimally and precisely as possible):

helm install stable/gocd -f values.yaml

values.yml

rbac:
  create: true
  apiVersion: v1beta1
  roleRef:

serviceAccount:
  create: true
  name:

server:
  enabled: true
  shouldPreconfigure: true
  image:
    repository: "gocd/gocd-server"
    tag:
    pullPolicy: "IfNotPresent"

  resources:
    requests:
      memory: 512Mi
      cpu: 0.25
    limits:
      cpu: 0.75
      memory: 1024Mi

  nodeSelector: {}

  healthCheck:
    initialDelaySeconds: 90
    periodSeconds: 15
    failureThreshold: 10
  env:
    goServerSystemProperties:
    extraEnvVars:
      - name: GOCD_PLUGIN_INSTALL_kubernetes-elastic-agents
        value: https://github.com/gocd/kubernetes-elastic-agents/releases/download/v1.0.2/kubernetes-elastic-agent-1.0.2-108.jar
      - name: GOCD_PLUGIN_INSTALL_docker-registry-artifact-plugin
        value: https://github.com/gocd/docker-registry-artifact-plugin/releases/download/1.0.0/docker-registry-artifact-plugin-1.0.0-3.jar
  service:
    type: "ClusterIP"
    httpPort: 8153
    httpsPort: 8154
    nodeHttpPort:
    nodeHttpsPort:
    annotations: {}
  ingress:
    enabled: true
    hosts:
      - ci.example.com
    annotations:
      kubernetes.io/ingress.class: nginx-default
    tls:

  persistence:
    enabled: false
    accessMode: "ReadWriteOnce"
    size: 2Gi
    existingClaim:
    pvSelector:
    name:
      dockerEntryPoint: goserver-vol
    subpath:
      godata: godata
      homego: homego
      dockerEntryPoint: scripts
    extraVolumes: []
    extraVolumeMounts: []

  hostAliases:

  security:
    ssh:
      enabled: false
      secretName: gocd-server-ssh

agent:
  replicaCount: 0
  image:
    repository: "gocd/gocd-agent-alpine-3.6"
    tag:
    pullPolicy: "IfNotPresent"
  env:
    goServerUrl:
    agentAutoRegisterKey:
    agentAutoRegisterResources:
    agentAutoRegisterEnvironemnts:
    agentAutoRegisterHostname:
    goAgentSystemProperties:
    goAgentBootstrapperArgs:
    goAgentBootstrapperJvmArgs:
    extraEnvVars:
  persistence:
    enabled: false
    accessMode: "ReadWriteOnce"
    size: 2Gi
    existingClaim:
    pvSelector:
    name:
      dockerEntryPoint: goagent-vol
    subpath:
      homego: homego
      dockerEntryPoint: scripts
    extraVolumes: []
    extraVolumeMounts: []
  privileged: false

  healthCheck:
    enabled: false
    initialDelaySeconds: 60
    periodSeconds: 60
    failureThreshold: 60

  security:
    ssh:
      enabled: false
      secretName: gocd-agent-ssh

  resources:
    limits:
      cpu: 0.25
      memory: 256Mi

  hostAliases:
  nodeSelector: {}

Anything else we need to know: I believe that the volumes shouldn't be in this if statement at all .. https://github.com/helm/charts/blob/master/stable/gocd/templates/gocd-server-deployment.yaml#L84-L100

varshavaradarajan commented 5 years ago

@alex-leonhardt-els - thank you for bringing this up. I have sent a PR https://github.com/helm/charts/pull/8772 to fix the issue.

ghost commented 5 years ago

thanks! i'll try this asap :)