Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

To make Kubernetes data survive pod replacement, create a PersistentVolume (PV), bind a PersistentVolumeClaim (PVC) to it, and have the pod mount the claim. To attach an existing Azure public IP to a VM, update the public IP association on the VM’s network interface (NIC) IP configuration—not on the VM itself. These are separate exercises, but both depend on following the resource relationship and checking the result at more than one layer.

What do these two configuration tasks have in common?

Both tasks are easier to reason about when you identify the resource that actually owns the behavior. In Kubernetes, a pod mounts a PVC, and that claim binds to a PV. In Azure, a VM uses a NIC, whose IP configuration is associated with a public IP. The pod does not mount the PV directly, and the public IP is not attached directly to the VM.

That indirection is useful: a pod can ask for storage through a claim without naming the underlying volume, while an Azure VM can use networking configured on its NIC. It also creates common failure points. A claim can be unbound or backed by storage on the wrong node; a public IP can be associated correctly while a firewall rule still blocks the service.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Exercise Resource relationship What to verify
Kubernetes storage Pod → PVC → PV → backing storage Claim binding, then the file after pod replacement, then application behavior
Azure networking VM → NIC → IP configuration → public IP Association, then required port reachability, then the application response

How do I make Kubernetes storage survive pod deletion?

Create a PV backed by storage, create a PVC whose request matches it, and mount the PVC in the pod. The example below follows a single-node exercise: a 3 GiB PV named pv-xfusion uses the node path /mnt/security, and a 3 GiB PVC named pvc-xfusion requests matching storage.

Popular on Amazon
Silkland 40Gbps USB C 90 Degree Right Angle Adapter 2 Pack, 240W USB4 | Male to Female Extender, 8K@60Hz, Thunderbolt 4/3, Steam Deck, ROG Ally, MacBook, Switch 2, iPhone 18/17/16/15, Quest 3 VR
  • 【90 Degree Full Function USB C Adapter】Supports the latest USB4 standard for up to 40Gbps of bandwidth, 8K video support, and up to 240W Fast charging; Support USB PD 3.1 Extended Power Range (EPR) including 140W, 180W and 240W. Your productivity is easily doubled. *Warm Tip: For the best fit, please make sure the USB-C port is fully exposed; thick or bulky cases may affect compatibility.
  • 【Reliable Quality】Made from high-quality, scratch-resistant aluminum alloy, delicate metal frame. get excellent wear resistance and heat dissipation. Non-Slip Design for easier insertion and removal.
  • 【Small and portable】Ultra thin size, ultra compact design, a petite physique that matches the minimalist design of your modern laptops. Coming with a slim figure that won't block the port next to the one it's plugged into.
  • 【Compatibility】Widely work with most usb c, thunderbolt 4/3 devices. Compatibilit for ROG Ally, Steam Deck, Switch, MacBook Pro, Quest 3 VR headset, Surface Book 2, iPhone 18/17/16/15, Samsung Galaxy S23/S22/S21, Note 20/10, Google Pixel, ChromeBook, etc.
  • 【Excellence Customer Support】If you experience any issues or cable failure, simply reach out to our dedicated customer service team. We provide a prompt response within 18 hours, providing you with the necessary technical support to resolve any concerns.

A PV describes storage available to the cluster. A PVC describes what a workload needs. Kubernetes can bind the claim to a compatible volume when the storage-class name, access mode, and available capacity match. In this example both objects use the class name manual; a manually defined PV/PVC match does not require a StorageClass object named manual.

1. Create the PersistentVolume

Save this manifest as pv.yaml and apply it. The hostPath is local to the node, so use this pattern only for a controlled single-node exercise, not as a general multi-node storage design.

apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-xfusion
spec:
  capacity:
    storage: 3Gi
  accessModes:
    - ReadWriteOnce
  storageClassName: manual
  hostPath:
    path: /mnt/security
    type: DirectoryOrCreate
kubectl apply -f pv.yaml
kubectl get pv pv-xfusion

DirectoryOrCreate creates the path on the node if it does not already exist. The PV’s hostPath is the backing location; it is not a directory inside the pod. A pod only sees it through the volume mount declared later.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. Create a matching claim

Save the following as pvc.yaml. Its requested capacity and class match the PV, and its access mode is compatible.

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc-xfusion
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: manual
  resources:
    requests:
      storage: 3Gi
kubectl apply -f pvc.yaml
kubectl get pvc pvc-xfusion
kubectl get pv pv-xfusion

Check that the PVC reports Bound and that the PV shows the claim. A created PV and a created PVC are not enough: the binding is the control-plane indication that Kubernetes matched them.

3. Mount the claim in a pod

The workload refers to pvc-xfusion by name. It does not name pv-xfusion. This is the central abstraction: the claim is the pod’s storage request, and the claim’s binding determines which volume supplies it.

The example task uses the httpd:latest Apache image. Apache serves files from /usr/local/apache2/htdocs/, so mount the volume beneath that directory if the goal is to serve a persisted test file. A mount at /usr/share/nginx/html/data is an nginx-style path and can store a file successfully without Apache serving it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Also popular on Amazon
Sale
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display | 85W Max PD, 1 Powered USB-C 5Gbps & 2 Powered USB-A 3.0 5Gbps Data Ports, for MacBook Pro, MacBook Air, Dell and More (Black)
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
apiVersion: v1
kind: Pod
metadata:
  name: xfusion-web
  labels:
    app: xfusion
spec:
  containers:
    - name: httpd
      image: httpd:latest
      ports:
        - containerPort: 80
      volumeMounts:
        - name: site-data
          mountPath: /usr/local/apache2/htdocs/data
  volumes:
    - name: site-data
      persistentVolumeClaim:
        claimName: pvc-xfusion
kubectl apply -f pod.yaml
kubectl get pod xfusion-web

The mount hides any pre-existing contents at the mount point inside the container while it is mounted. Choose a path that fits the application and its image; a persistent mount alone does not make the application read from that path.

4. Write a file, replace the pod, and read it back

To check persistence, write a file in the mounted directory, delete the pod, recreate the same pod specification, and read the file from the new pod. Nnamdi Felix Ibe’s October 10, 2026 walkthrough describes writing Hello from persistent storage, replacing the pod, and reading the file back. This is a stronger check than looking only at the PV and PVC status because it tests the data path across pod replacement.

kubectl exec xfusion-web -- sh -c 'echo "Hello from persistent storage" > /usr/local/apache2/htdocs/data/persist.txt'
kubectl delete pod xfusion-web
kubectl apply -f pod.yaml
kubectl wait --for=condition=Ready pod/xfusion-web
kubectl exec xfusion-web -- cat /usr/local/apache2/htdocs/data/persist.txt

The expected file content is Hello from persistent storage. The walkthrough reports that the data remained because the file was stored on the hostPath-backed volume rather than in the disposable container filesystem. A pod replacement is not the same as deleting the PVC or PV: those objects have their own lifecycle and deletion behavior.

5. Expose the pod with a NodePort Service

The exercise’s Service is named web-xfusion, selects pods labeled app: xfusion, sends traffic to port 80, and uses node port 30008. A Service routes to the pod; it does not change where Apache reads files.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
apiVersion: v1
kind: Service
metadata:
  name: web-xfusion
spec:
  type: NodePort
  selector:
    app: xfusion
  ports:
    - port: 80
      targetPort: 80
      nodePort: 30008
kubectl apply -f service.yaml
kubectl get service web-xfusion
kubectl get endpoints web-xfusion

Confirm that the Service has an endpoint for the selected pod. To validate the application path, request /data/persist.txt through the Service using a reachable node address and port 30008. A successful binding does not prove the Service selects the pod, and a reachable Service does not prove the file is at the server’s document root.

Why might a Kubernetes PVC stay Pending?

A PVC remains Pending when Kubernetes cannot find or provision a volume satisfying its request. For this manually matched exercise, inspect the class name, capacity, access mode, and PV status before changing the pod.

  • Class mismatch: the claim’s storageClassName must match the PV’s value. In this exercise, both are manual.
  • Insufficient capacity: the PV must offer at least the amount requested by the claim. Here both specify 3 GiB.
  • Incompatible access mode: the PV must support the claim’s requested mode. Here both specify ReadWriteOnce.
  • PV unavailable: check whether the PV is already bound or has a lifecycle state that prevents a new claim from using it.

Use kubectl describe pvc pvc-xfusion and kubectl get pv to inspect status and events. A manual class name is a matching label in this setup; dynamic provisioning through a StorageClass is a different design in which a claim can trigger storage creation.

Also popular on Amazon
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter | 85W Max PD, 2 USB 3.0 & 1 USBC Data Ports, SD/TF Card Reader, for Laptops/Mac and Other Type C Devices (Charger Not Included)
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

What do hostPath, access modes, and reclaim policy mean for the data?

They determine where the data lives, where it can be mounted, and what happens to the volume when its claim is removed. They are lifecycle choices, not merely syntax needed to make a manifest pass validation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

hostPath is node-local

A hostPath volume points to a path on a particular cluster node. If a replacement pod lands on a different node, the same path may refer to a different directory and therefore different data. Kubernetes documentation cautions, “If you can avoid using a hostPath volume, you should.” For production-oriented multi-node clusters, use storage provisioned through an appropriate StorageClass rather than relying on an arbitrary local node path.

ReadWriteOnce is not the same as one pod only

ReadWriteOnce is node-scoped: it permits read-write mounting by one node, and multiple pods on that node may be able to use the volume. It does not mean that only one pod in the cluster can mount it. ReadWriteOncePod is the stricter mode when the intended constraint is a single pod mounting a volume read-write. Select the mode based on the storage driver’s support and the workload’s requirements.

Deleting a claim can leave a retained volume

For a manually created PV, the default reclaim policy described in the walkthrough is Retain. Deleting the claim can leave the PV in Released, with prior data retained and the volume not immediately available to a new claim. Do not treat deleting the PVC as a cleanup shortcut if the data matters. A safer cleanup order is to stop the pod using the claim, then handle the claim, then the PV, while confirming the intended data-retention outcome.

Kubernetes storage integrations also change over time. The walkthrough notes that the in-tree awsElasticBlockStore and azureDisk volume types were removed in Kubernetes v1.27 and identifies ebs.csi.aws.com as the current AWS CSI provisioner in the examples it discusses. Check version-specific storage documentation when adapting an older manifest; do not assume an in-tree volume plugin remains available in a newer cluster.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do I attach an existing Azure public IP to a VM?

Find the VM’s NIC and the NIC’s actual IP-configuration name, then associate the existing public IP with that configuration. Do not assume the configuration is named ipconfig1: the walkthrough found ipconfigdevops-vm-pip for its example VM.

The Azure exercise uses an existing public IP named devops-pip and VM named devops-vm-pip. Set RG to the resource group’s name before running these Bash commands. The VM and public IP must be in the resource group indicated by the commands, or adjust the relevant resource-group arguments to match their actual locations.

Also popular on Amazon
BENFEI USB C Hub 5-in-1 with 4K HDMI(Certified), 100W Power Delivery, 3 USB-A, Silicone Cable, Aluminum Case Compatible with MacBook Pro/Air, iPad Pro, iMac, iPhone 15 Pro/Pro Max, XPS, Thinkpad
  • Portable and powerful USB-C HUB: BENFEI USB Type-C HUB, with super-soft and knot-free silicone woven design cable, meets most mobile office needs. Compact, lightweight, stylish, and powerful portable USB C Hub equipped with 1 x HDMI port, 1 x 100W charging, and 3 x USB ports. 18-month warranty, 24-hour response, to ensure you feel at ease when using our product.
  • Design centered on comfort and reliability: Thanks to BENFEI's end-to-end in-house cable production capability, in-house PCBA and assembly capability, using the industry's most advanced silicone woven design and process, 20cm cable in length, no knots, super-soft, the HUB is easy to use in all scenarios: laptop, tablet, stand etc. Super-soft, 25000+ life cycles, to meet your daily carrying and office needs.
  • 100W Charging: Support up to 90W USB C pass-through charging via Type-C port to keep your laptop powered. 10W is reserved for other interface operations. No data and video function on the Type-C port.
  • 4K HDMI Display: The HDMI port supports media display at resolutions up to 4K 30Hz, keeping every incredible moment detailed and ultra vivid. Please note that the C port of the Host device needs to support video output.
  • Transfer Files in Seconds: Transfer files and from your laptop at speeds up to 10 Gbps with USB A 3.2 port. Extra 2 USB A 2.0 ports are perfectly for your keyboards and mouse.

1. Discover the NIC and IP configuration instead of guessing

RG="your-resource-group"
VM="devops-vm-pip"
PIP="devops-pip"

NIC_ID=$(az vm show -g "$RG" -n "$VM" --query 'networkProfile.networkInterfaces[0].id' -o tsv)
NIC=${NIC_ID##*/}
IPCFG=$(az network nic show -g "$RG" -n "$NIC" --query 'ipConfigurations[0].name' -o tsv)

printf 'NIC: %snIP configuration: %sn' "$NIC" "$IPCFG"

The commands read the NIC resource ID from the VM, extract its name, and query the NIC for its first IP configuration’s name. This avoids a brittle assumption about Azure-generated or task-specific names. If the VM has multiple NICs or the intended address is on a different IP configuration, inspect all NICs and configurations and select the one that should own the public address rather than blindly using index zero.

2. Associate the existing public IP

az network nic ip-config update -g "$RG" --nic-name "$NIC" -n "$IPCFG" --public-ip-address "$PIP"

This updates the NIC IP configuration. The walkthrough reports that its VM remained running during the update because the association was changed on the NIC configuration rather than by changing the VM itself. That observation is specific to the described task; it is not a guarantee that every networking change is interruption-free.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Confirm both sides of the association

az vm show -d -g "$RG" -n "$VM" --query publicIps -o tsv
az network public-ip show -g "$RG" -n "$PIP" --query '{address:ipAddress,configuration:ipConfiguration.id}' -o json

Check the VM’s computed public address and the public IP resource’s address and ipConfiguration.id. The two views should identify the expected address and association. Before attachment, the walkthrough’s VM query returned an empty string for publicIps, not null; an empty result is therefore not necessarily a literal null value.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Why can an Azure VM have a public IP but still reject connections?

A public-IP association confirms control-plane configuration; it does not prove that packets can reach a service. Check network permissions and the service itself separately. In particular, an applicable network security group (NSG) must permit inbound traffic on the required protocol and port.

Check reachability for the intended port

The walkthrough describes a TCP connection test to port 22 and reports success because an allow rule was already present. That is a test of SSH-port reachability in that environment, not proof that every port or application is reachable. Bash’s TCP redirection attempts to open a TCP socket; a timeout or refusal can point to a blocked route, missing allow rule, or service that is not listening.

IP="the-verified-public-ip"
timeout 5 bash -c ':

Replace the example value with the address returned by Azure, and test the port your service actually needs. A successful TCP connection only establishes that a socket could be opened; it does not confirm that SSH authentication works or that an HTTP application returns the expected page.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check the guest and application after the network path

Azure's public address is translated outside the guest OS. An ordinary interface listing inside the VM shows its private address, not the public address, so use Azure resource queries to verify the public-IP association. Then confirm that the guest firewall and service are configured for the desired port and that the application responds correctly.

Also popular on Amazon
𝟒𝐏𝐚𝐜𝐤 𝐔𝐩𝐠𝐫𝐚𝐝𝐞𝐝 USB to USB C Adapter,Type-C Female to A Male Charger Converter for iPhone 18 Charger,iWatch Ultra SE 9 10,iPhone 17 Pro Max 16 15 14,Samsung S25,AirPods,iPad,Car,Xbox
  • 【Read before You Buy】 Note: This adapter is USB 2.0 version and cannot transmit HDM, VGA, or other video signals. Nevertheless, they are fully capable of charging devices,duplicating files, and can be seamlessly integrated with USB-C earphones, wireless network adapters, and SD card adapters.
  • 【Easy to Use and Safe】Thanks to modern manufacturing techniques, we've made these adapters sufficiently compact so that they can remain inserted in your device without noticeable protrusion or inconvenience. This means you don't have to constantly plug and unplug them, reducing the likelihood of wear and misalignment, and making them more convenient to carry around.
  • 【Reliable Quality】Engineered for enhanced durability, durable aluminum alloy shell material,get excellent wear resistance and heat dissipation,the male USB C and female USB connectors & the male USB and female USB C connectors are designed to be plugged and unplugged up to 20000 times. Provides data transfer, device charging, memory space expansion, and additional computer peripherals.
  • 【Think more for you】Do you need to connect a USB-C-enabled device to an odd device that only has USB-A ports? Then these USB-A male to USB-C female adapters are made for you.Simply insert the adapter into the USB-A port on the device, and you can instantly connect your USB-C device to the device that originally didn't have the correct connection port.
  • 【Trusted xiwxi Quality and Service】As a responsible brand seller, you will receive xiwxi's 12-month Quality assurance and lifetime friendly customer service, you're not just buying a product,you're investing in peace of mind with all-round quality and exceptional customer service.

These are three separate checks: control plane—is the IP associated with the intended configuration? data plane—can a client establish a connection to the required port? application—does the service respond as intended? Treating those as one test makes diagnosis harder.

How should you remove or change these resources safely?

Follow each resource chain in dependency order and decide whether the underlying data or address must remain. In Kubernetes, stop the workload that mounts the claim before removing storage objects; with a retained PV, consider the data and PV state before attempting to reuse it.

In Azure, dissociate a public IP before deleting the public IP resource. If an active SSH session uses that address, removing or changing the association can interrupt that session. Verify which NIC configuration references the address before deleting it, and keep a separate management path available if the connection is important.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What should you take away from the two exercises?

Use the object that forms the supported link to the behavior: a pod declares a PVC, and an Azure public IP belongs to a NIC IP configuration. Then verify progressively beyond resource status. For Kubernetes, read back a file after pod replacement and confirm that the server serves from the mount path. For Azure, confirm the association from both resource views, test the needed network port, and check the application response. A green control-plane status is a starting point, not the end of validation.

Frequently Asked Questions

Can a Kubernetes PVC bind if there is no StorageClass object named manual?

Yes, in a manually created PV/PVC match, the shared `storageClassName` can identify the match without a StorageClass resource of that name. That differs from dynamic provisioning, where a StorageClass configures how storage is created.

Does deleting a Kubernetes pod delete its PVC or stored data?

Deleting a pod does not by itself delete the PVC it references. The PV's reclaim policy and subsequent claim or volume deletion determine what happens to the backing storage.

Why can’t I see my Azure public IP in the VM’s network-interface listing?

Azure’s public address is translated outside the guest, so the guest’s normal interface listing shows a private address. Query the Azure public-IP resource or the VM’s computed public address instead.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Can I delete an Azure public IP while it is still associated with a NIC?

The public IP must be dissociated before deletion. If a live SSH session uses that address, removing the association can interrupt the session, so plan a separate way to manage the VM.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply. Prices as of December 6, 2026 10:01 am GMT.