{"id":1264,"date":"2021-01-22T10:19:46","date_gmt":"2021-01-22T10:19:46","guid":{"rendered":"https:\/\/blog.samarthya.me\/wps\/?p=1264"},"modified":"2021-01-22T10:19:47","modified_gmt":"2021-01-22T10:19:47","slug":"pod-volume-k8s","status":"publish","type":"post","link":"https:\/\/blog.samarthya.me\/wps\/2021\/01\/22\/pod-volume-k8s\/","title":{"rendered":"Pod &#038; Volume: K8S"},"content":{"rendered":"<p>Everything in the same file<\/p>\n\n\n<pre class=\"wp-block-code\"><code>apiVersion: v1\nkind: Pod\nmetadata:\n  name: redispod\nspec:\n  containers:\n  - image: redis\n    name: redisdb\n    volumeMounts:\n    - name: redis-data\n      mountPath: \/data\n    ports:\n    - containerPort: 6379\n      protocol: TCP\n  volumes:\n  - name: redis-data\n    persistentVolumeClaim:\n      claimName: redisdb-pvc\n---\napiVersion: v1\nkind: PersistentVolume\nmetadata:\n  name: redis-pv\nspec:\n  storageClassName: \"\"\n  capacity:\n    storage: 1Gi\n  accessModes:\n    - ReadWriteOnce\n  hostPath:\n    path: \"\/mnt\/data\"\n---\napiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n  name: redisdb-pvc\nspec:\n  storageClassName: \"\"\n  accessModes:\n    - ReadWriteOnce\n  resources:\n    requests:\n      storage: 1Gi<\/code><\/pre>\n\n\n\n<p>If you deploy you will get something like<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>k apply -f redis.yaml \npod\/redispod created\npersistentvolume\/redis-pv created\npersistentvolumeclaim\/redisdb-pvc created<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Everything in the same file If you deploy you will get something like<\/p>\n","protected":false},"author":2,"featured_media":1266,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"image","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[86,34],"tags":[18,145,144],"class_list":["post-1264","post","type-post","status-publish","format-image","has-post-thumbnail","hentry","category-docker","category-technical","tag-k8s","tag-pv","tag-pvc","post_format-post-format-image"],"_links":{"self":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/posts\/1264","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/comments?post=1264"}],"version-history":[{"count":0,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/posts\/1264\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/media\/1266"}],"wp:attachment":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/media?parent=1264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/categories?post=1264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/tags?post=1264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}