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

[Need help] - EBS Mount #1930

Open
hikouki-gumo opened this issue Oct 16, 2024 · 6 comments
Open

[Need help] - EBS Mount #1930

hikouki-gumo opened this issue Oct 16, 2024 · 6 comments

Comments

@hikouki-gumo
Copy link

I want to deploy Artifactory on EC2 and use EBS as storage. EC2 is launch automatically with a block storage (named /dev/xvdc).

To use this EBS as storage, I will need to mount /var/opt/jfrog/artifactory to EBS. I check the values.yaml but quite confuse, I guess there is something to do with customVolumes/customVolumeMounts or persistent.

Could you pls show me what is the correct way to do?

@Alexhha
Copy link

Alexhha commented Oct 16, 2024

What do you mean on EC2 ? Are you using EC2 as EKS node ? You can't install helm chart on plain EC2

@hikouki-gumo
Copy link
Author

Hi @Alexhha , yes, it's an EC2 node in my EKS cluster.

@Alexhha
Copy link

Alexhha commented Oct 16, 2024

EC2 is launch automatically with a block storage (named /dev/xvdc).

/dev/xvdc is that a root block storage ? If so EKS will use it by default no additional steps are required

@hikouki-gumo
Copy link
Author

hikouki-gumo commented Oct 17, 2024

No, /dev/xvdc is not root device volume, it is additional EBS volumes (block device mapping).

Please see config below.
I don't want to use root storage (dev/xvda) to store artifactory, I want to store all data of artifactory on block device mapping (/dev/xvdc) instead.

Reference: Block device mapping concepts.

blockDeviceMappings:
            - deviceName: /dev/xvda
              ebs:
                volumeSize: 25
            - deviceName: /dev/xvdc
              ebs:
                volumeSize: 1000

@oumkale
Copy link
Member

oumkale commented Oct 17, 2024

Hi @hikouki-gumo,

Thank you for creating the issue. We are happy to help you!

You can follow these steps:

  1. Check the storage reference.
  2. Examples with k8s manifests: aws ebs examples
  3. Create the required resources by yourself and use customVolumes and customVolumeMounts. See this reference for guidance.

Or you may explore this if it suits for your use case: customPersistentVolumeClaim

How to custom volume and volume mounts in values.yaml

Sample:

 artifactory:
    customVolumes: |
      # - name: custom-script
      #   configMap:
      #     name: custom-script
    ## Add custom volumesMounts
    customVolumeMounts: |
      # - name: custom-script
      #   mountPath: "/scripts/script.sh"
      #   subPath: script.sh
      # - name: posthook-start
      #   mountPath: "/scripts/posthoook-start.sh"
      #   subPath: posthoook-start.sh
      # - name: prehook-start
      #   mountPath: "/scripts/prehook-start.sh"
      #   subPath: prehook-start.sh

Note: This solution is specific to the questions raised in the issue.

@Alexhha
Copy link

Alexhha commented Oct 18, 2024

I don't want to use root storage (dev/xvda) to store artifactory, I want to store all data of artifactory on block device mapping (/dev/xvdc) instead.

you have to prepare pv/pvc

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: custom-artifactory-data
spec:
  volumeName: custom-artifactory-data
  storageClassName: gp2
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1000Gi
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: custom-artifactory-data
spec:
  capacity:
    storage: 1000Gi
  storageClassName: gp2
  accessModes:
    - ReadWriteOnce
  csi:
    driver: ebs.csi.aws.com
    fsType: ext4
    volumeHandle: vol-123456789

and then specify pvc in the .artifactory.persistence.existingClaim

artifactory:
  persistence:
    enabled: true
    existingClaim: custom-artifactory-data

Note: bear in mind, EC2 must be in the same AZ as your EBS volume.

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

3 participants