Git Product home page Git Product logo

Comments (6)

praveenkumar avatar praveenkumar commented on August 27, 2024

So using below scripts I am able to create 50 pv and also tested odo which works.

$ cat create_files.sh 
#/bin/bash

set -xe
function setup_pv_dir() {
  local dir="${1}"
  if [[ ! -d "${dir}" ]]; then
    sudo mkdir -p "${dir}"
  fi
  if ! sudo chcon -t svirt_sandbox_file_t "${dir}" &> /dev/null; then
    echo "Not setting SELinux content for ${dir}"
  fi
  sudo chmod 770 "${dir}"
}

basedir=/var/data
setup_pv_dir "${basedir}"

for i in $(seq 1 50); do
  setup_pv_dir "${basedir}/pv${i}"
done

$ ssh [email protected] 'bash -s' < create_files.sh

$ cat create_files.sh 
#/bin/bash

set -xe
function setup_pv_dir() {
  local dir="${1}"
  if [[ ! -d "${dir}" ]]; then
    sudo mkdir -p "${dir}"
  fi
  if ! sudo chcon -t svirt_sandbox_file_t "${dir}" &> /dev/null; then
    echo "Not setting SELinux content for ${dir}"
  fi
  sudo chmod 770 "${dir}"
}

basedir=/var/data
setup_pv_dir "${basedir}"

for i in $(seq 1 50); do
  setup_pv_dir "${basedir}/pv${i}"
done
[prkumar@prkumar-test ~]$ cat create_pv.sh 
#/bin/bash -xe
function generate_pv() {
  local basedir="${1}"
  local name="${2}"
cat <<EOF
apiVersion: v1
kind: PersistentVolume
metadata:
  name: ${name}
  labels:
    volume: ${name}
spec:
  capacity:
    storage: 100Gi
  accessModes:
    - ReadWriteOnce
    - ReadWriteMany
    - ReadOnlyMany
  hostPath:
    path: ${basedir}/${name}
  persistentVolumeReclaimPolicy: Recycle
EOF
}

function create_pv() {
  local basedir="${1}"
  local name="${2}"
  if ! oc get pv "${name}" &> /dev/null; then
    generate_pv "${basedir}" "${name}" | oc create -f -
  else
    echo "persistentvolume ${name} already exists"
  fi
}
basedir="/var/data"
for i in $(seq 1 50); do
  create_pv "${basedir}" "pv${i}"
done

$ export KUBECONFIG=/home/prkumar/.crc/cache/crc_libvirt_v4.1.0.rc0/kubeconfig
$ ./create_pv.sh 
persistentvolume/pv1 created
persistentvolume/pv2 created
persistentvolume/pv3 created
persistentvolume/pv4 created
persistentvolume/pv5 created
persistentvolume/pv6 created
persistentvolume/pv7 created
persistentvolume/pv8 created
persistentvolume/pv9 created
persistentvolume/pv10 created
persistentvolume/pv11 created
persistentvolume/pv12 created
persistentvolume/pv13 created
persistentvolume/pv14 created
persistentvolume/pv15 created
persistentvolume/pv16 created
persistentvolume/pv17 created
persistentvolume/pv18 created
persistentvolume/pv19 created
persistentvolume/pv20 created
persistentvolume/pv21 created
persistentvolume/pv22 created
persistentvolume/pv23 created
persistentvolume/pv24 created
persistentvolume/pv25 created
persistentvolume/pv26 created
persistentvolume/pv27 created
persistentvolume/pv28 created
persistentvolume/pv29 created
persistentvolume/pv30 created
persistentvolume/pv31 created
persistentvolume/pv32 created
persistentvolume/pv33 created
persistentvolume/pv34 created
persistentvolume/pv35 created
persistentvolume/pv36 created
persistentvolume/pv37 created
persistentvolume/pv38 created
persistentvolume/pv39 created
persistentvolume/pv40 created
persistentvolume/pv41 created
persistentvolume/pv42 created
persistentvolume/pv43 created
persistentvolume/pv44 created
persistentvolume/pv45 created
persistentvolume/pv46 created
persistentvolume/pv47 created
persistentvolume/pv48 created
persistentvolume/pv49 created
persistentvolume/pv50 created

from snc.

heiko-braun avatar heiko-braun commented on August 27, 2024

Fuse Online development is also blocked by this.

from snc.

gbraad avatar gbraad commented on August 27, 2024

Assigned to @cfergeau as this would likely have to be added to the end of the image generation, right before shut-down and cleanup

from snc.

cfergeau avatar cfergeau commented on August 27, 2024

I'v added a patch doing that to PR #26 , it's only creating one /mnt/pv-data directory/one PV, not clear to me whether one is enough, or if we need to create multiple ones.

from snc.

heiko-braun avatar heiko-braun commented on August 27, 2024

@cfergeau I am not entirely sure either, but to be on the safe side (thinking mininshift compatible), why don't we create the same amount as before? Or do you see any downsides in having mutiple ones?

from snc.

praveenkumar avatar praveenkumar commented on August 27, 2024

@cfergeau we should add atleast ~50 pv directory, in minishift we use to 100 by default but I think ~50 is something good amount for any kind of application developer.

from snc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.