jfrog / charts

JFrog official Helm Charts
https://jfrog.com/integration/helm-repository/
Apache License 2.0
259 stars 448 forks source link

[Need help] - EBS Mount #1930

Open hikouki-gumo opened 1 month ago

hikouki-gumo commented 1 month ago

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 commented 1 month ago

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

hikouki-gumo commented 1 month ago

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

Alexhha commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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.