diff --git a/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/_index.md b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/_index.md new file mode 100644 index 0000000000..854b4ae5b2 --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/_index.md @@ -0,0 +1,70 @@ +--- +title: Deploy OpenEBS on Azure Cobalt 100 Arm64 virtual machines for Kubernetes-native persistent storage + + +description: Learn how to install and configure OpenEBS LocalPV on an Azure Cobalt 100 Arm64 virtual machine using K3s Kubernetes, provision persistent storage dynamically, deploy stateful applications, and validate persistent storage functionality. + +minutes_to_complete: 60 + +who_is_this_for: This is an introductory topic for DevOps engineers, platform engineers, cloud-native developers, and Kubernetes administrators who want to deploy lightweight Kubernetes-native persistent storage on Arm-based cloud infrastructure. + +learning_objectives: + - Install and configure K3s Kubernetes on Azure Cobalt 100 Arm64 virtual machines + - Deploy OpenEBS LocalPV using Helm + - Configure Kubernetes storage classes and Persistent Volume Claims (PVCs) + - Deploy and validate stateful Kubernetes workloads with persistent storage + +prerequisites: + - A [Microsoft Azure account](https://azure.microsoft.com/) with access to Cobalt 100 based instances (Dpsv6) + - Basic knowledge of Linux command-line operations + - Familiarity with SSH and remote server access + - Basic understanding of Kubernetes concepts and containerized applications + +author: Pareena Verma + +### Tags +skilllevels: Introductory +subjects: Containers and Virtualization +cloud_service_providers: + - Microsoft Azure + +armips: + - Neoverse + +tools_software_languages: + - Kubernetes + - K3s + - OpenEBS + - Helm + +operatingsystems: + - Linux + +further_reading: + - resource: + title: OpenEBS Official Website + link: https://openebs.io/ + type: website + - resource: + title: OpenEBS Documentation + link: https://openebs.io/docs + type: documentation + - resource: + title: K3s Documentation + link: https://docs.k3s.io/ + type: documentation + - resource: + title: Kubernetes Documentation + link: https://kubernetes.io/docs/ + type: documentation + - resource: + title: Azure Cobalt 100 processors + link: https://techcommunity.microsoft.com/blog/azurecompute/announcing-the-preview-of-new-azure-vms-based-on-the-azure-cobalt-100-processor/4146353 + type: documentation + +### FIXED, DO NOT MODIFY +# ================================================================================ +weight: 1 +layout: "learningpathall" +learning_path_main_page: "yes" +--- diff --git a/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/_next-steps.md b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/_next-steps.md new file mode 100644 index 0000000000..c3db0de5a2 --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/_next-steps.md @@ -0,0 +1,8 @@ +--- +# ================================================================================ +# FIXED, DO NOT MODIFY THIS FILE +# ================================================================================ +weight: 21 # Set to always be larger than the content in this path to be at the end of the navigation. +title: "Next Steps" # Always the same, html page title. +layout: "learningpathall" # All files under learning paths have this same wrapper for Hugo processing. +--- diff --git a/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/background.md b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/background.md new file mode 100644 index 0000000000..8e903707f4 --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/background.md @@ -0,0 +1,66 @@ +--- +title: Understand OpenEBS on Azure Cobalt 100 +weight: 2 + +layout: "learningpathall" +--- + +## Why run OpenEBS on Azure Cobalt 100 + +OpenEBS on Arm-based Azure Cobalt 100 processors provides lightweight, Kubernetes-native persistent storage for cloud-native workloads. Azure Cobalt 100 processors deliver dedicated physical cores per vCPU, enabling consistent and predictable performance for Kubernetes storage operations and stateful applications. + +OpenEBS integrates directly with Kubernetes and dynamically provisions Persistent Volumes for applications using Container Storage Interface (CSI) drivers and storage engines. Running OpenEBS on Azure Cobalt 100 enables efficient Arm64-native Kubernetes storage deployments optimized for lightweight cloud-native environments. + +## Azure Cobalt 100 Arm-based processor + +Azure’s Cobalt 100 is Microsoft’s first-generation, in-house Arm-based processor. Built on Arm Neoverse N2, Cobalt 100 is a 64-bit CPU that delivers strong performance and energy efficiency for cloud-native, scale-out Linux workloads. These workloads include web and application servers, data analytics, open-source databases, and caching systems. Running at 3.4 GHz, Cobalt 100 allocates a dedicated physical core for each vCPU, ensuring consistent and predictable performance. + +To learn more, see the Microsoft blog [Announcing the preview of new Azure VMs based on the Azure Cobalt 100 processor](https://techcommunity.microsoft.com/blog/azurecompute/announcing-the-preview-of-new-azure-vms-based-on-the-azure-cobalt-100-processor/4146353). + +## How OpenEBS improves Kubernetes storage + +OpenEBS is an open-source, Kubernetes-native storage platform designed for stateful workloads running inside Kubernetes clusters. Unlike traditional external storage systems, OpenEBS runs completely inside Kubernetes and dynamically provisions storage volumes directly through Kubernetes APIs. + +OpenEBS enables applications to retain persistent data even after pods restart, reschedule, or recreate. This makes OpenEBS ideal for databases, analytics platforms, message queues, and other stateful cloud-native applications. + +To learn more, see the official [OpenEBS documentation](https://openebs.io/docs). + +OpenEBS provides key capabilities for Kubernetes-native storage management: + +- Dynamic Provisioning: Automatically creates Persistent Volumes using Kubernetes Persistent Volume Claims (PVCs). +- Kubernetes-native Architecture: Runs entirely inside Kubernetes without requiring external storage appliances. +- Lightweight Local Storage: OpenEBS LocalPV uses node-local storage optimized for lightweight Kubernetes environments. +- CSI Integration: Integrates with Kubernetes Container Storage Interface (CSI) drivers for standard storage management. +- Stateful Workload Support: Enables persistent storage for databases, web applications, and distributed systems. + +## Why OpenEBS LocalPV for this learning path + +This learning path uses OpenEBS LocalPV because it is optimized for: + +- Single-node Kubernetes clusters +- Arm64 environments +- Lightweight Kubernetes deployments +- Development and learning environments +- High-performance local storage provisioning + +Advanced replicated storage engines such as Mayastor are designed for multi-node production environments and are intentionally excluded from this setup. + +## Learning path overview + +In this Learning Path, you'll deploy OpenEBS LocalPV on an Azure Cobalt 100 Arm64 virtual machine using a lightweight K3s Kubernetes cluster. + +You'll learn how to: + +- Install Kubernetes using K3s +- Deploy OpenEBS LocalPV +- Configure Kubernetes storage classes +- Create Persistent Volume Claims (PVCs) +- Deploy stateful applications +- Validate persistent storage functionality +- Expose Kubernetes applications externally using Azure networking + +## What you've learned and what's next + +You now understand why Azure Cobalt 100 and OpenEBS are a strong combination for lightweight Kubernetes-native persistent storage on Arm64 infrastructure. + +Next, you'll configure Azure networking to allow external access to the Kubernetes application deployed with OpenEBS persistent storage. diff --git a/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/firewall.md b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/firewall.md new file mode 100644 index 0000000000..b3cb01b8e9 --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/firewall.md @@ -0,0 +1,73 @@ +--- +title: Allow access to the OpenEBS application on Azure +weight: 5 + +### FIXED, DO NOT MODIFY +layout: learningpathall +--- + +## Configure external traffic for the OpenEBS application + +To allow external traffic to the Kubernetes application running with OpenEBS persistent storage on an Azure virtual machine, open the Kubernetes NodePort in the Network Security Group (NSG). + +The NSG can be attached to the virtual machine's network interface or subnet. + +{{% notice Note %}}For more information about Azure setup, see [Getting started with Microsoft Azure Platform](/learning-paths/servers-and-cloud-computing/csp/azure/).{{% /notice %}} + +## Verify the Kubernetes service + +Check the Kubernetes service to identify the exposed NodePort: + +```bash +kubectl get svc +``` + +The output is similar to: + +```output +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) +nginx-openebs NodePort 10.x.x.x 80:31635/TCP +``` + +In this example, the NodePort exposed externally is `31635`. + +### Add an inbound firewall rule in Azure + +To expose the Kubernetes NodePort externally, create a firewall rule. + +1. Navigate to the [Azure portal](https://portal.azure.com), go to **Virtual Machines**, and select your virtual machine. + +![Azure Portal Virtual Machines page with the target VM selected. Check that you are opening the correct virtual machine before configuring its network access.#center](images/virtual_machine.png "Virtual Machines") + +2. In the left menu, select **Networking**, then select **Network settings**. + +![Azure Portal Networking page showing the network settings linked to the virtual machine. Use this entry to reach the Network Security Group settings for the inbound rule.#center](images/networking.png "Network settings") + +3. Navigate to **Create port rule**, and select **Inbound port rule**. + +![Azure Portal Create port rule menu with Inbound port rule selected. Choose this option to open port 31635 to expose the Kubernetes Node Port Externally.#center](images/port_rule.png "Create rule") + +4. Configure the inbound security rule with the following settings: + +- **Source:** My IP address +- **Source IP addresses:** *(auto-populated with your current public IP)* +- **Source port ranges:** * +- **Destination:** Any +- **Destination port ranges:** **31635** +- **Protocol:** TCP +- **Action:** Allow +- **Name:** allow-openebs-port + +{{% notice Note %}}Setting Source to My IP address restricts access to the Kubernetes application to your current machine only. Source port ranges remains * because this refers to the client's ephemeral outbound port, which is dynamically assigned. If your IP address changes or you need to access the application from another machine, update the source IP in this rule.{{% /notice %}} + +5. After filling in the details, select **Add** to save the rule. + +You can now access the Kubernetes application externally using the NodePort. + +## What you've learned and what's next + +You've now configured the Azure Network Security Group to allow external access to the Kubernetes application running with OpenEBS LocalPV persistent storage. + +This firewall rule enables external browser access to the application deployed on your single-node Kubernetes cluster running on Azure Cobalt 100 Arm64. + +Next, you'll install OpenEBS LocalPV on Kubernetes and configure persistent storage provisioning for stateful workloads. diff --git a/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/images/final-vm.png b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/images/final-vm.png new file mode 100644 index 0000000000..5207abfb41 Binary files /dev/null and b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/images/final-vm.png differ diff --git a/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/images/instance.png b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/images/instance.png new file mode 100644 index 0000000000..285cd764a5 Binary files /dev/null and b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/images/instance.png differ diff --git a/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/images/instance1.png b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/images/instance1.png new file mode 100644 index 0000000000..b9d22c352d Binary files /dev/null and b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/images/instance1.png differ diff --git a/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/images/instance4.png b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/images/instance4.png new file mode 100644 index 0000000000..2a0ff1e3b0 Binary files /dev/null and b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/images/instance4.png differ diff --git a/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/images/networking.png b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/images/networking.png new file mode 100644 index 0000000000..9d6d15f8a3 Binary files /dev/null and b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/images/networking.png differ diff --git a/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/images/openebs-browser.png b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/images/openebs-browser.png new file mode 100644 index 0000000000..2780072e6b Binary files /dev/null and b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/images/openebs-browser.png differ diff --git a/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/images/port_rule.png b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/images/port_rule.png new file mode 100644 index 0000000000..681dc71aa1 Binary files /dev/null and b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/images/port_rule.png differ diff --git a/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/images/ubuntu-pro.png b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/images/ubuntu-pro.png new file mode 100644 index 0000000000..d54bd75ca6 Binary files /dev/null and b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/images/ubuntu-pro.png differ diff --git a/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/images/virtual_machine.png b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/images/virtual_machine.png new file mode 100644 index 0000000000..cf6704fcc6 Binary files /dev/null and b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/images/virtual_machine.png differ diff --git a/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/instance.md b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/instance.md new file mode 100644 index 0000000000..4e421f9680 --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/instance.md @@ -0,0 +1,66 @@ +--- +title: Create an Azure Cobalt 100 Arm64 virtual machine +weight: 3 + +### FIXED, DO NOT MODIFY +layout: learningpathall +--- + +## Set up the Azure virtual machine + +In this section, you'll launch the Azure portal to create a virtual machine (VM) with the Arm-based Azure Cobalt 100 processor. + +This Learning Path focuses on general-purpose virtual machines in the Dpsv6 series. For more information, see the [Microsoft Azure guide for the Dpsv6 size series](https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/general-purpose/dpsv6-series). + +While the steps to create this instance are included here for convenience, you can also see [Deploy a Cobalt 100 virtual machine on Azure Learning Path](/learning-paths/servers-and-cloud-computing/cobalt/). + +### Create an Arm-based virtual machine in the Azure portal + +To create an Azure virtual machine using the Azure portal: + +1. Launch the Azure portal and navigate to **Virtual Machines**. +2. Select **Create**, and select **Virtual Machine** from the drop-down list. +3. In the **Basic** tab, fill in the instance details such as **Virtual machine name** and **Region**. +4. Select **Ubuntu Pro 24.04 LTS** as the image for your virtual machine, and select **Arm64** as the VM architecture. +5. In the **Size** field, select **See all sizes** and select the D-Series v6 family of virtual machines. +6. Select **D4ps_v6** from the list as shown in the diagram below: + +![Azure Portal showing D-Series v6 VM size selection with D4ps_v6 highlighted#center](images/instance.png "Select D4ps_v6 from the D-Series v6 family") + +7. For **Authentication type**, select **SSH public key**. + +{{% notice Note %}} +Azure generates an SSH key pair for you and lets you save it for future use. This method is fast, secure, and easy for connecting to your virtual machine. +{{% /notice %}} + +8. Fill in the **Administrator username** for your VM. +9. Select **Generate new key pair**, and select **RSA SSH Format** as the SSH Key Type. + +{{% notice Note %}} +RSA offers better security with keys longer than 3072 bits. +{{% /notice %}} + +10. Give your SSH key a key pair name. +11. In the **Inbound port rules**, select **HTTP (80)** and **SSH (22)** as the inbound ports, as shown in the following image: + +![Azure Portal inbound port configuration showing SSH and HTTP selected. Check that the required access settings are in place before creating the virtual machine.#center](images/instance1.png "Configure inbound port rules for HTTP and SSH access") + +12. Select the **Review + Create** tab and review the configuration for your virtual machine. It should look like the following: + +![Azure Portal Review + Create tab showing VM configuration summary ready for deployment#center](images/ubuntu-pro.png "Review VM configuration before creation") + +13. When you're happy with your selection, select the **Create** button and then **Download Private key and Create Resource**. + +![Azure Portal showing Create button and SSH key download dialog#center](images/instance4.png "Download SSH key and create the virtual machine") + +Your virtual machine should be ready and running in a few minutes. You can SSH into the virtual machine using the private key, along with the public IP details. + +![Azure Portal deployment result showing that the virtual machine was created successfully. Look for the successful deployment status and the connection details you will use to access the virtual machine in the next step.#center](images/final-vm.png "Successful VM deployment confirmation") + +{{% notice Note %}}To learn more about Arm-based virtual machines in Azure, see "Getting Started with Microsoft Azure" in [Get started with Arm-based cloud instances](/learning-paths/servers-and-cloud-computing/csp/azure/).{{% /notice %}} + +## What you've accomplished and what's next + +You've created an Azure Cobalt 100 Arm64 virtual machine running Ubuntu 24.04 LTS with SSH authentication configured. The virtual machine is now ready for deploying Kubernetes and OpenEBS LocalPV workloads. + +Next, you'll install K3s Kubernetes on the VM and deploy OpenEBS LocalPV to build a lightweight Kubernetes-native persistent storage platform for stateful applications and cloud-native workloads. diff --git a/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/openebs-installation.md b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/openebs-installation.md new file mode 100644 index 0000000000..b7ee164ef7 --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/openebs-installation.md @@ -0,0 +1,236 @@ +--- +title: Deploy OpenEBS on Azure Cobalt 100 +weight: 5 + +### FIXED, DO NOT MODIFY +layout: learningpathall +--- + +## Set up OpenEBS on the VM + +In this section, you'll install OpenEBS LocalPV on an Azure Cobalt 100 Arm-based virtual machine (VM) using a lightweight single-node Kubernetes cluster. + +You'll configure Kubernetes storage provisioning and prepare the environment for persistent workloads. + +## Update your system + +Start by updating the package index and installing the latest package updates on the virtual machine. + +```bash +sudo apt update && sudo apt upgrade -y +``` + +## Install required dependencies + +Install the tools required for Kubernetes and Helm setup. + +```bash +sudo apt install -y curl wget git apt-transport-https +``` + +## Install Kubernetes using K3s + +K3s is a lightweight Kubernetes distribution optimized for edge systems, Arm64 environments, and single-node deployments. + +### Install K3s + +Run the following command to install K3s: + +```bash +curl -sfL https://get.k3s.io | sh - +``` + +Verify the installation: + +```bash +sudo kubectl get nodes +``` + +The output is similar to: + +```output +NAME STATUS ROLES AGE VERSION +openebs-arm64 Ready control-plane 7s v1.35.5+k3s1 +``` + +## Configure kubectl access + +Create the Kubernetes configuration directory: + +```bash +mkdir -p ~/.kube +``` + +Copy the K3s kubeconfig file: + +```bash +sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config +``` + +Update ownership permissions: + +```bash +sudo chown $USER:$USER ~/.kube/config +``` + +Set the Kubernetes configuration environment variable: + +```bahs +export KUBECONFIG=$HOME/.kube/config +``` + +Persist the configuration: + +```bash +echo 'export KUBECONFIG=$HOME/.kube/config' >> ~/.bashrc +source ~/.bashrc +``` + +Verify access: + +```bash +kubectl get nodes +``` + +The output is similar to: + +```output +NAME STATUS ROLES AGE VERSION +openebs-arm64 Ready control-plane 62s v1.35.5+k3s1 +``` + +## Install Helm + +Helm is the Kubernetes package manager used to deploy OpenEBS. + +### Install Helm + +```bash +curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash +``` + +Verify: + +```bash +helm version +``` + +The output is similar to: + +```output +version.BuildInfo{Version:"v3.21.0", GitCommit:"e0878d41b711792be60777fd65ad23a101e6b85f", GitTreeState:"clean", GoVersion:"go1.25.10"} +``` +## Add the OpenEBS repository + +Add the official OpenEBS Helm repository: + +```bash +helm repo add openebs https://openebs.github.io/openebs +``` + +## Update Helm repositories: + +```bash +helm repo update +``` + +## Deploy OpenEBS LocalPV + +Create the OpenEBS namespace + +```bash +kubectl create namespace openebs +``` + +## Install lightweight OpenEBS + +This deployment installs only OpenEBS LocalPV components and disables Mayastor, Loki, Alloy, and observability services, which are unnecessary for a single-node setup. + +```bash +helm install openebs openebs/openebs \ + --namespace openebs \ + --set engines.replicated.mayastor.enabled=false \ + --set loki.enabled=false \ + --set alloy.enabled=false \ + --set obs.enabled=false +``` + +### Verify OpenEBS installation + +Check the OpenEBS pods: + +```bash +kubectl get pods -n openebs +``` + +The output is similar to: + +```output +NAME READY STATUS RESTARTS AGE +openebs-localpv-provisioner-6f9447fcc9-nnbgm 1/1 Running 0 17s +openebs-lvm-localpv-controller-5996c4fbfc-d8274 5/5 Running 0 17s +openebs-lvm-localpv-node-9g49t 2/2 Running 0 17s +openebs-zfs-localpv-controller-6b98b6cc9d-rjq76 5/5 Running 0 17s +openebs-zfs-localpv-node-p28g2 2/2 Running 0 17s +``` + +### Verify storage classes + +Check the available Kubernetes storage classes: + +```bash +kubectl get sc +``` + +The output is similar to: + +```output +NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE +local-path (default) rancher.io/local-path Delete WaitForFirstConsumer false 2m16s +openebs-hostpath openebs.io/local Delete WaitForFirstConsumer false 32s +``` + +## Configure OpenEBS as the default storage class +Set OpenEBS HostPath as the default storage class: + +```bash +kubectl patch storageclass openebs-hostpath \ + -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}' +``` + +Remove the default flag from the K3s local-path storage class: + +```bash +kubectl patch storageclass local-path \ + -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}' +``` + +Verify: + +```bash +kubectl get sc +``` + +The output is similar to: + +```output +NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE +local-path rancher.io/local-path Delete WaitForFirstConsumer false 2m55s +openebs-hostpath (default) openebs.io/local Delete WaitForFirstConsumer false 71s +``` + +## Verify OpenEBS resources + +Check all OpenEBS resources: + +```bash +kubectl get all -n openebs +``` + +At this stage, OpenEBS LocalPV is successfully configured and ready to provision persistent storage volumes for Kubernetes workloads. + +## What you've learned and what's next + +You now have a lightweight single-node Kubernetes cluster running on Azure Cobalt 100 Arm64 with OpenEBS LocalPV configured as the default storage class. + +Next, you'll create Persistent Volume Claims (PVCs), deploy a stateful NGINX application, and validate persistent storage functionality using OpenEBS. diff --git a/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/openebs-persistent-storage-validation.md b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/openebs-persistent-storage-validation.md new file mode 100644 index 0000000000..3d38a3f32f --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/openebs-cobalt/openebs-persistent-storage-validation.md @@ -0,0 +1,260 @@ +--- +title: Validate Persistent Storage with OpenEBS on Azure Cobalt 100 +weight: 6 + +### FIXED, DO NOT MODIFY +layout: learningpathall +--- + +## Create and validate persistent storage + +In this section, you'll create a Persistent Volume Claim (PVC), deploy a stateful NGINX application, and validate persistent storage behavior using OpenEBS LocalPV. + +You'll verify that data persists even after the application pod is deleted and recreated. + +## Create a Persistent Volume Claim + +Create a Persistent Volume Claim (PVC) manifest: + +```bash +cat > pvc.yaml < 134m +``` + +The PVC is dynamically provisioned by OpenEBS LocalPV. + +## Deploy a stateful NGINX application + +Create the deployment manifest: + +```bash +cat > nginx-openebs.yaml < 136m +``` + +Check the Persistent Volume (PV): + +```bash +kubectl get pv +``` + +The output is similar to: + +```output +NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS VOLUMEATTRIBUTESCLASS REASON AGE +pvc-4784909a-837e-457d-90aa-0aa6867f26de 5Gi RWO Delete Bound default/openebs-pvc openebs-hostpath 134m +``` + +The output confirms that the Persistent Volume has been dynamically created and attached. + +## Write persistent data + +Get the pod name: + +```bash +POD=$(kubectl get pod -l app=nginx-openebs -o jsonpath='{.items[0].metadata.name}') +``` + +Write test data into the mounted volume: + +```bash +kubectl exec -it $POD -- sh -c 'echo "OpenEBS on Azure Cobalt D4ps Arm64" > /usr/share/nginx/html/index.html' +``` + +Verify the data: + +```bash +kubectl exec -it $POD -- cat /usr/share/nginx/html/index.html +``` + +The output is similar to: + +```output +OpenEBS on Azure Cobalt D4ps Arm64 +``` + +## Validate persistence after pod recreation + +Delete the NGINX pod: + +```bash +kubectl delete pod -l app=nginx-openebs +``` + +Wait for Kubernetes to recreate the pod: + +```bash +kubectl get pods -w +``` + +Press `Ctrl + C` after the new pod reaches the Running state. + +Get the new pod name: + +```bash +NEW_POD=$(kubectl get pod -l app=nginx-openebs -o jsonpath='{.items[0].metadata.name}') +``` + +Verify the data again: + +```bash +kubectl exec -it $NEW_POD -- cat /usr/share/nginx/html/index.html +``` + +The output is similar to: + +```output +OpenEBS on Azure Cobalt D4ps Arm64 +``` + +This confirms that the Persistent Volume retains data even after the pod is deleted and recreated. + +## Expose the application + +Create a NodePort service: + +```bash +kubectl expose deployment nginx-openebs \ + --type NodePort \ + --port 80 +``` + +Verify the service: + +```bash +kubectl get svc +``` + +The output is similar to: + +```output +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +kubernetes ClusterIP 10.x.x.x 443/TCP 143m +nginx-openebs NodePort 10.x.x.x 80:31635/TCP 7s +``` + +## Access the application + +Open the following URL in your browser: + +```text +http://:31635 +``` + +You should see: + +```output +OpenEBS on Azure Cobalt D4ps Arm64 +``` + +![NGINX application running on Kubernetes with persistent storage provisioned by OpenEBS LocalPV on Azure Cobalt 100 Arm64.#center](images/openebs-browser.png "NGINX application using OpenEBS persistent storage") + +## Cleanup resources + +Delete the deployment: + +```bash +kubectl delete -f nginx-openebs.yaml +``` + +Delete the PVC: + +```bash +kubectl delete -f pvc.yaml +``` + +## What you've learned + +You successfully created dynamically provisioned Persistent Volumes using OpenEBS LocalPV on a single-node Kubernetes cluster running on Azure Cobalt 100 Arm64. + +You validated persistent storage functionality by recreating application pods while preserving data across restarts.