Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
w1ndblow opened this issue Jul 30, 2024 · 8 comments
Open
1 task done

Comments

@w1ndblow
Copy link

w1ndblow commented Jul 30, 2024

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 #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

  • I agree to follow this project's Code of Conduct
@bianchi2
Copy link
Collaborator

@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
Copy link
Author

w1ndblow commented Jul 31, 2024

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
Copy link
Collaborator

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
Copy link
Author

w1ndblow commented Aug 1, 2024

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
Copy link
Collaborator

bianchi2 commented Aug 1, 2024

@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
Copy link
Author

w1ndblow commented Aug 1, 2024

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
Copy link
Collaborator

bianchi2 commented Aug 1, 2024

@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?

@w1ndblow
Copy link
Author

w1ndblow commented Oct 29, 2024

I figured out the problem, command df и web ui in jira displays only one of mount's

df -h 
Filesystem                Size  Used Avail Use% Mounted on
overlay                    98G   54G   40G  58% /
tmpfs                      64M     0   64M   0% /dev
/dev/mapper/deb--vg-root   19G  5.2G   13G  30% /etc/hosts
/dev/mapper/vg0-lv0        98G   54G   40G  58% /etc/hostname
shm                        64M     0   64M   0% /dev/shm
/dev/rbd2                 9.8G   33M  9.7G   1% /var/atlassian/application-data/jira
tmpfs                      63G   12K   63G   1% <>
tmpfs                      32G     0   32G   0% /proc/acpi
tmpfs                      32G     0   32G   0% /sys/firmware

but there are two in fact

mount | grep "/var/atlassian/application-data/jira"
/dev/rbd2 on /var/atlassian/application-data/jira type ext4 (rw,relatime,discard,stripe=16)
mount | grep "/opt/atlassian/jira/logs"
/dev/rbd2 on /opt/atlassian/jira/logs type ext4 (rw,relatime,discard,stripe=16)

it is still possible to separate the log sections from the home one, this will be more explicit and simplify the configuration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants