atlassian / data-center-helm-charts

Helm charts for Atlassian's Data Center products
https://atlassian.github.io/data-center-helm-charts/
Apache License 2.0
153 stars 132 forks source link

[Suggestion] - [jira] Use special variable to right separate mount for logs and home #844

Open w1ndblow opened 1 month ago

w1ndblow commented 1 month ago

Suggestion

problem happen with config

localHome:
    persistentVolumeClaim:
      create: true

Into the pod mounts other volume

$ df
/dev/sdg   <> <> <>   1% /opt/atlassian/jira/logs

when pvc is creating it binds to first local-home mount (/opt/atlassian/jira/logs) and logs get space whereas local-home directory /var/atlassian/application-data/jira is not, it can see df command

if my decision https://github.com/atlassian/data-center-helm-charts/pull/842 is not satisfied with our plan, i suggest create other variable and pvc for that

logs:
    persistentVolumeClaim:
      create: true

Product

jira

Code of Conduct

bianchi2 commented 1 month ago

@w1ndblow

I am sorry but I have hard time understanding what the issue is. Can you please rephrase:

when pvc is creating it binds to first local-home mount (/opt/atlassian/jira/logs) and logs get space whereas local-home directory /opt/atlassian/jira/ is not

Btw, /opt/atlassian/jira should not be persisted at all, it's an installation directory.

Our existing configuration uses subPath which makes it possible to use 2 volumeMounts in 1 volume.

Again, can you please paraphrase your problem statement, e.g. "Logs in directory xxx not persisted" or "Can't create a pod because of...".

w1ndblow commented 1 month ago

Our existing configuration uses subPath which makes it possible to use 2 volumeMounts in 1 volume.

What does it mean? There is configuration https://github.com/atlassian/data-center-helm-charts/blob/main/src/main/charts/jira/templates/_helpers.tpl#L153 path with values .Values.jira.accessLog.mountPath gets pv with pvc whereas path with value .Values.volumes.localHome.mountPath (/var/atlassian/application-data/jira) is not

bianchi2 commented 1 month ago

Yes, that's expected. The two volume mounts use one PVC, one volumeMount (tomcat logs) is using subpath. This way data is persisted in both locations and there's no need to declare an additional PVC just to persist Tomcat logs.

w1ndblow commented 1 month ago

I think you are mistaken in interpreting this feature, as you can see in the official documentation the example is given with several containers and not with one. To confirm my words, try to run this configuration on your cluster and go into the container and see the information about system mounts (df for example)

bianchi2 commented 1 month ago

@w1ndblow it does not matter if it's one or several containers. Both directories are persisted:

root@jira-0:/var/atlassian/application-data/jira# mount | grep jira
/dev/vda1 on /var/atlassian/application-data/jira type ext4 (rw,relatime,discard)
/dev/vda1 on /opt/atlassian/jira/logs type ext4 (rw,relatime,discard)

Just to confirm, what you say is that your Jira home is not persisted? Can you write a file to /var/atlassian/application-data/jira, kill the pod and then check if the file is still there?

Also, can you share more information about your k8s version, vendor/cloud and storage class?

w1ndblow commented 1 month ago

the provisioner of class is csi.vsphere.vmware.com, server version v1.26.5 there is private instances of k8s. i don't achieve behavior like in your cluster, but it is not so important, i suggest more clearly configuration If user need to persist logs of specific instance he may create different pvc

bianchi2 commented 1 month ago

@w1ndblow can you please answer the question I asked a few times already?

Just to confirm, what you say is that your Jira home is not persisted? Can you write a file to /var/atlassian/application-data/jira, kill the pod and then check if the file is still there?

If you see different behavior with subPath, you may want to investigate it for your particular k8s provider and StorageClass. Like I said before this is the first report of subPath not working and Jira home not being persisted. Can you share output from mount command in your jira container?