{"id":28480484,"url":"https://github.com/robert076/volumes-theory","last_synced_at":"2025-08-17T14:38:09.498Z","repository":{"id":295567569,"uuid":"990158633","full_name":"Robert076/volumes-theory","owner":"Robert076","description":"Some of my notes as I learn about volumes in Kubernetes. Contains an example on emptyDir and hostPath.","archived":false,"fork":false,"pushed_at":"2025-05-26T08:07:39.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-01T01:07:17.144Z","etag":null,"topics":["empty-directory","hostpath","k8s","kubernetes","volumes"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Robert076.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-25T16:12:01.000Z","updated_at":"2025-05-26T12:04:22.000Z","dependencies_parsed_at":"2025-05-26T09:05:24.762Z","dependency_job_id":"84e84589-4381-4677-8723-6d59919bb690","html_url":"https://github.com/Robert076/volumes-theory","commit_stats":null,"previous_names":["robert076/volumes-theory"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Robert076/volumes-theory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robert076%2Fvolumes-theory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robert076%2Fvolumes-theory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robert076%2Fvolumes-theory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robert076%2Fvolumes-theory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Robert076","download_url":"https://codeload.github.com/Robert076/volumes-theory/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robert076%2Fvolumes-theory/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270860953,"owners_count":24658482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["empty-directory","hostpath","k8s","kubernetes","volumes"],"created_at":"2025-06-07T19:06:33.806Z","updated_at":"2025-08-17T14:38:09.450Z","avatar_url":"https://github.com/Robert076.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌎 volumes-theory\nSome of my notes as I learn about volumes in Kubernetes.\n\nDocker also has a notion of volumes, but it is different from the Kubernetes's notion of volumes. They both do answer the same need but they are not the same.\n\nKubernetes has **2** types of volumes:\n- Volumes\n- PersistentVolume\n\nThese two are **not** the same, as PersistentVolume is a resource on its own whereas a volume is a pod configuration.\n\nVolumes are *storage-bound to the Pod's lifecycle*. Volumes are nothing more than **storage attached to the life cycle of the Pod**. As soon as the pod is deleted, the volumes that were created with it are deleted too.\n\n🚀 Run the script (emptyDir volume):\n\n1) Create the pod:\n```bash\nkubectl apply -f emptydir.yml\n```\n\n2) Check if pods are running:\n```bash\nkubectl get pods\n```\n\n3) Exec into the container and see the volume:\n```bash\nkubectl exec pod/two-containers-with-empty-dir -c nginx-container -- ls /var\n```\n\n4) Or the other container:\n```bash\nkubectl exec pod/two-containers-with-empty-dir -c busybox-container -- ls /var\n```\n\n\u003e ❗️ In the case of the hostPath volume, make sure you have the file created on your host before proceeding. Also keep in mind it is an antipattern.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobert076%2Fvolumes-theory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobert076%2Fvolumes-theory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobert076%2Fvolumes-theory/lists"}