-
Notifications
You must be signed in to change notification settings - Fork 64
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
EFS Volume creation automation #2
Comments
Hi, I have the same problem here, any update? |
@hieu29791 I did some workaround for this. I had to create a kubernetes job which is run after the provisioner is created. This kubernetes job basically runs the below shell script: mkdir -p /nfs/${id}/rca-scripts
mkdir -p /nfs/${id}/ica
mkdir -p /nfs/${id}/rca
mkdir -p /nfs/${id}/rca-data
mkdir -p /nfs/${id}/orderer
chmod a+rwx /nfs/${id}/rca-scripts
chmod a+rwx /nfs/${id}/ica
chmod a+rwx /nfs/${id}/rca
chmod a+rwx /nfs/${id}/rca-data
chmod a+rwx /nfs/${id}/orderer
rm -rf /nfs/${id}/rca-scripts/*
rm -rf /nfs/${id}/ica/*
rm -rf /nfs/${id}/rca/*
rm -rf /nfs/${id}/rca-data/*
rm -rf /nfs/${id}/orderer/* where Complete config:Job: apiVersion: 'batch/v1',
kind: 'Job',
metadata: {
name: 'nfs-partitions',
namespace: `${domain}`,
},
spec: {
template: {
spec: {
containers: [
{
name: 'partitioner',
image: 'alpine',
command: ['sh', '/conf/init.sh'],
volumeMounts: [
{
name: 'init',
mountPath: '/conf',
},
{
name: 'nfs',
mountPath: '/nfs',
},
],
},
],
volumes: [
{
name: 'init',
configMap: {
name: 'partition-create-script',
},
},
{
name: 'nfs',
persistentVolumeClaim: {
claimName: `raw-nfs-mount-${id}`,
},
},
],
restartPolicy: 'Never',
},
},
backoffLimit: 1,
} PVCs: kind: 'PersistentVolumeClaim',
apiVersion: 'v1',
metadata: {
name: `raw-nfs-mount-${id}`,
namespace: `${domain}`,
},
spec: {
accessModes: ['ReadWriteMany'],
resources: {
requests: {
storage: '1Gi',
},
},
storageClassName,
volumeName: `raw-nfs-mount-${id}`,
}, PV: kind: 'PersistentVolume',
apiVersion: 'v1',
metadata: {
name: `raw-nfs-mount-${id}`,
namespace: `${domain}`,
},
spec: {
capacity: {
storage: '1Gi',
},
storageClassName,
accessModes: ['ReadWriteMany'],
persistentVolumeReclaimPolicy: 'Retain',
mountOptions: ['nfsvers=4.1', 'rsize=1048576', 'wsize=1048576', 'hard', 'timeo=600', 'retrans=2'],
nfs: {
server: efsServer,
path: '/',
},
}, Configmap: apiVersion: 'v1',
kind: 'ConfigMap',
metadata: {
name: 'partition-create-script',
labels: {
name: 'partition-create-script',
},
namespace: `${domain}`,
},
data: {
'init.sh': `
mkdir -p /nfs/${id}/rca-scripts
mkdir -p /nfs/${id}/ica
mkdir -p /nfs/${id}/rca
mkdir -p /nfs/${id}/rca-data
mkdir -p /nfs/${id}/orderer
chmod a+rwx /nfs/${id}/rca-scripts
chmod a+rwx /nfs/${id}/ica
chmod a+rwx /nfs/${id}/rca
chmod a+rwx /nfs/${id}/rca-data
chmod a+rwx /nfs/${id}/orderer
rm -rf /nfs/${id}/rca-scripts/*
rm -rf /nfs/${id}/ica/*
rm -rf /nfs/${id}/rca/*
rm -rf /nfs/${id}/rca-data/*
rm -rf /nfs/${id}/orderer/*
`,
}, Hope this helps |
@jazzyarchitects Thanks for your help. Could you explain more to me about this step? When I run start-fabric.sh I want automatically create folders on EFS. How to I migration your script and this example, I just run start-fabric.sh and this automatically do the rest. |
When you run start-fabric.sh, it calls a function makeDirs. This creates
the directories on efs. Can you check the output of start-fabric.sh and
confirm any errors that are seen here? You can check the dirs on efs by
doing ls /opt/share on the bastion, since efs is mounted on the bastion
also .
…On Fri, 22 Feb 2019, 17:04 hieu29791, ***@***.***> wrote:
@jazzyarchitects <https://github.com/jazzyarchitects> Thanks for your
help. Could you explain more to me about this step? When I run
start-fabric.sh I want automatically create folders on EFS. How to I
migration your script and this example, I just run start-fabric.sh and this
automatically do the rest.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AL0HGpGQ94-NlWX8yjomu5Aq0hkX-zhZks5vP7KIgaJpZM4aKJLl>
.
|
Hi,
On Bastion, I see folder already create on /op/share/ I don't know what wrong is it. Could you explain to me.
|
Excuse me by starting this topic again. Can't be this problem related to execute the code in a local machine with kubectl and not in the ec2 instance? Executed in local, I would recommend to create the files not in local but in a job as the default way, as shown by @jazzyarchitects. This way fabric could be started from everywhere. One problem of this would be that |
I am trying to create a Hyperledger network and I get the following error for the pods when RCA is being deployed.
I can see that it is because the mount directories don't exist in the NFS server but isn't the script supposed to take care of that instead of manually mounting and creating directories?
The text was updated successfully, but these errors were encountered: