Installation script for nfs server. 87/9687/1
authorsmahana123 <s.mahana@samsung.com>
Thu, 17 Nov 2022 09:50:59 +0000 (15:20 +0530)
committersmahana123 <s.mahana@samsung.com>
Thu, 17 Nov 2022 09:50:59 +0000 (15:20 +0530)
Issue-Id: AIMLFW-4

Signed-off-by: smahana123 <s.mahana@samsung.com>
Change-Id: I2d9ac2f6df0636b99790e39ba213de586eb5d0dc

tools/nfs/configure_nfs_server.sh [new file with mode: 0755]
tools/nfs/delete_nfs_subdir_external_provisioner.sh [new file with mode: 0755]
tools/nfs/install_nfs_subdir_external_provisioner.sh [new file with mode: 0755]

diff --git a/tools/nfs/configure_nfs_server.sh b/tools/nfs/configure_nfs_server.sh
new file mode 100755 (executable)
index 0000000..9321154
--- /dev/null
@@ -0,0 +1,27 @@
+# ==================================================================================
+#
+#       Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved.
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#          http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#
+# ==================================================================================
+
+sudo apt update
+sudo apt install -y nfs-kernel-server
+sudo mkdir /srv/nfs/kubedata -p
+sudo chown nobody: /srv/nfs/kubedata/
+sudo sed "/kubedata/d" /etc/exports > /tmp/exports_tmp ; sudo mv /tmp/exports_tmp /etc/exports
+echo "/srv/nfs/kubedata $1(rw,sync,no_subtree_check,no_root_squash,no_all_squash,insecure)" >> /etc/exports
+sudo exportfs -a
+sudo systemctl restart nfs-kernel-server
+echo "Configuring NFS server complete"
diff --git a/tools/nfs/delete_nfs_subdir_external_provisioner.sh b/tools/nfs/delete_nfs_subdir_external_provisioner.sh
new file mode 100755 (executable)
index 0000000..bb84398
--- /dev/null
@@ -0,0 +1,19 @@
+# ==================================================================================
+#
+#       Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved.
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#          http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#
+# ==================================================================================
+
+helm delete nfs-subdir-external-provisioner
diff --git a/tools/nfs/install_nfs_subdir_external_provisioner.sh b/tools/nfs/install_nfs_subdir_external_provisioner.sh
new file mode 100755 (executable)
index 0000000..e46f2bb
--- /dev/null
@@ -0,0 +1,20 @@
+# ==================================================================================
+#
+#       Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved.
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#          http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#
+# ==================================================================================
+
+helm repo add nfs-subdir-external-provisioner https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner/
+helm install nfs-subdir-external-provisioner nfs-subdir-external-provisioner/nfs-subdir-external-provisioner --set nfs.server=$1 --set nfs.path=/srv/nfs/kubedata --set storageClass.defaultClass=true