{"id":55110,"date":"2026-04-02T14:49:36","date_gmt":"2026-04-02T22:49:36","guid":{"rendered":"https:\/\/www.sumologic.com\/blog\/kubernetes%ec%97%90%ec%84%9c-postgresql-%eb%b0%b0%ed%8f%ac%ed%95%98%ea%b8%b0"},"modified":"2026-01-23T07:03:38","modified_gmt":"2026-01-23T15:03:38","slug":"kubernetes-deploy-postgres","status":"publish","type":"blog","link":"https:\/\/www.sumologic.com\/ko\/blog\/kubernetes-deploy-postgres","title":{"rendered":"Kubernetes\uc5d0\uc11c PostgreSQL \ubc30\ud3ec \ubc29\ubc95"},"content":{"rendered":"\n<section class=\"e-stn e-stn-0d652506f82b000a392973813b918ee25d5b4211 e-stn--glossary-inner-content e-stn--table-of-content\"><div class=\"container\">\n<div class=\"wp-block-b3rg-row e-row row\">\n<div class=\"wp-block-b3rg-column e-col e-col-1f7b3997080fc292474d26ff00c905d99d3520fa e-col--content-wrapper  col-sm-12 col-lg-12 col-xl-12\">\n<div class=\"e-div e-div-a1b32f66e1749758df41d5aea14f647cd10e362c e-div--card-btn-link\"><div class=\"e-img \">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1400\" height=\"400\" src=\"https:\/\/www.sumologic.com\/wp-content\/uploads\/Deploy-postgreSQl-header.jpg\" alt=\"\" class=\"wp-image-4667\" title=\"\"><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>Kubernetes\ub294 \ucee8\ud14c\uc774\ub108\ud654\ub41c \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc758 \ubc30\ud3ec, \ud655\uc7a5, \uad00\ub9ac\ub97c \uc790\ub3d9\ud654\ud558\ub294 \ucee8\ud14c\uc774\ub108 \uc624\ucf00\uc2a4\ud2b8\ub808\uc774\uc158 \ud50c\ub7ab\ud3fc\uc73c\ub85c, \ub864\ub9c1 \uc5c5\uadf8\ub808\uc774\ub4dc\uc640 \ud655\uc7a5 \uc791\uc5c5\uc5d0 \uc218\ubc18\ub418\ub294 \ub9ce\uc740 \uc218\ub3d9 \ub2e8\uacc4\ub97c \ucd94\uc0c1\ud654\ud574 \uc90d\ub2c8\ub2e4. \ud074\ub77c\uc6b0\ub4dc \ub124\uc774\ud2f0\ube0c \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uad6c\ucd95\ud560 \ub54c\ub294 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc774 \ud074\ub7ec\uc2a4\ud130 \ub0b4\uc5d0\uc11c \uc774\ub7ec\ud55c \uae30\ub2a5\uc744 \ud65c\uc6a9\ud560 \uc218 \uc788\ub3c4\ub85d PostgreSQL\uacfc \uac19\uc740 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \ubc30\ud3ec\ud574\uc57c \ud558\ub294 \uacbd\uc6b0\uac00 \ub9ce\uc2b5\ub2c8\ub2e4.\u00a0\u00a0<\/p>\n\n\n\n<p>\uc774 \uac00\uc774\ub4dc\uc5d0\uc11c\ub294 Kubernetes \ud074\ub7ec\uc2a4\ud130\uc5d0 PostgreSQL\uc744 \ubc30\ud3ec\ud558\ub294 \ubc29\ubc95\uc744 \ub2e8\uacc4\ubcc4\ub85c \uc124\uba85\ud558\uc5ec \uad6c\uc131 \ubc0f \ud655\uc7a5\uc774 \uac00\ub2a5\ud55c \ud074\ub77c\uc6b0\ub4dc \ub124\uc774\ud2f0\ube0c PostgreSQL \ud658\uacbd\uc744 \uad6c\ucd95\ud560 \uc218 \uc788\ub3c4\ub85d \ub3c4\uc640\ub4dc\ub9bd\ub2c8\ub2e4. Google Kubernetes Engine, Amazon EKS, IBM Cloud Kubernetes Service\ub97c \uc0ac\uc6a9\ud558\ub4e0, Minikube\uc640 \uac19\uc740 \ub85c\uceec \uc194\ub8e8\uc158\uc744 \uc0ac\uc6a9\ud558\ub4e0, \uc774 \ud29c\ud1a0\ub9ac\uc5bc\uc744 \uadf8\ub300\ub85c \uc801\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. Kubernetes\uc5d0\uc11c \ud14c\uc2a4\ud2b8\uc6a9 \ub2e8\uc77c PostgreSQL \uc778\uc2a4\ud134\uc2a4\ub97c \ubc30\ud3ec\ud558\ub294 \ubc29\ubc95\uacfc Helm, Kubernetes Operator, Bitnami PostgreSQL\uacfc \uac19\uc740 \ub3c4\uad6c\ub97c \uc0ac\uc6a9\ud558\ub294 \uace0\uae09 \ubc30\ud3ec \ubc29\uc2dd\uc744 \uc54c\uc544\ubcf4\uc138\uc694.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"prerequisites\">\uc0ac\uc804 \uc900\ube44 \uc0ac\ud56d<\/h2>\n\n\n\n<p>\uc774 \uac00\uc774\ub4dc\ub97c \ub530\ub77c \ud558\ub824\uba74 \ub2e4\uc74c\uc774 \ud544\uc694\ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Kubernetes \ud074\ub7ec\uc2a4\ud130(DigitalOcean, AWS, Google Cloud, IBM Cloud \ub4f1\uc758 \ud074\ub77c\uc6b0\ub4dc \ud658\uacbd \ub610\ub294 <a href=\"https:\/\/kind.sigs.k8s.io\/\" target=\"_blank\" rel=\"noreferrer noopener\">Kind<\/a>\u00b7<a href=\"https:\/\/github.com\/kubernetes\/minikube\" target=\"_blank\" rel=\"noreferrer noopener\">Minikube<\/a> \uac19\uc740 \ub85c\uceec \ud658\uacbd)<\/li>\n\n\n\n<li><a href=\"https:\/\/www.sumologic.com\/blog\/kubectl-logs\">Kubectl<\/a> \uad00\ub828 \uc9c0\uc2dd \u2014 Kubernetes API\ub97c \uc81c\uc5b4\ud558\ub294 \uba85\ub839\uc904 \ub3c4\uad6c\uc5d0 \ub300\ud55c \uae30\ubcf8 \uc9c0\uc2dd<\/li>\n<\/ul>\n\n\n\n<p>\uc2dc\uc791\ud558\uae30 \uc804\uc5d0 Kubernetes\uc5d0\uc11c \ub2e8\uc77c PostgreSQL \uc778\uc2a4\ud134\uc2a4\ub97c \ubc30\ud3ec\ud558\ub294 \uae30\ubcf8 \ub2e8\uacc4\ubd80\ud130 \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"simple-postgresql-deployment\">\uac04\ub2e8\ud55c PostgreSQL \ubc30\ud3ec<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"dockerize-postgresql\">PostgreSQL \ub3c4\ucee4\ub77c\uc774\uc9d5<\/h3>\n\n\n\n<p>Kubernetes\ub294 \ub808\uc9c0\uc2a4\ud2b8\ub9ac\uc5d0\uc11c <a href=\"https:\/\/www.sumologic.com\/glossary\/docker\">\ub3c4\ucee4<\/a> \uc774\ubbf8\uc9c0\ub97c \uac00\uc838\uc640 \uad6c\uc131 \ud30c\uc77c\uc5d0 \uadfc\uac70\ud558\uc5ec \ubc30\ud3ec\ud569\ub2c8\ub2e4. <a href=\"https:\/\/docs.docker.com\/samples\/postgresql_service\/#install-postgresql-on-docker\" target=\"_blank\" rel=\"noreferrer noopener\">\ub2e4\uc74c \ub2e8\uacc4\uc5d0 \ub530\ub77c \uc9c1\uc811 PostgreSQL \ub3c4\ucee4 \uc774\ubbf8\uc9c0<\/a>\ub97c \ube4c\ub4dc\ud560 \uc218\ub3c4 \uc788\uace0, \ub3c4\ucee4 \ud5c8\ube0c\uc5d0\uc11c \uc81c\uacf5\ud558\ub294 \uacf5\uc2dd \uc624\ud508 \uc18c\uc2a4 \uc774\ubbf8\uc9c0\ub97c \uc0ac\uc6a9\ud560 \uc218\ub3c4 \uc788\uc2b5\ub2c8\ub2e4. \uc774 \uae00\uc5d0\uc11c\ub294 \ucd5c\uc2e0 <a href=\"https:\/\/hub.docker.com\/_\/postgres\" target=\"_blank\" rel=\"noreferrer noopener\">Postgres 15.3 \uc774\ubbf8\uc9c0<\/a>\ub97c \uc0ac\uc6a9\ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"create-your-connection-configuration-and-secrets\">\uc5f0\uacb0 \uad6c\uc131 \ubc0f \uc2dc\ud06c\ub9bf(Secret) \uc0dd\uc131<\/h3>\n\n\n\n<p>\ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc790\uaca9 \uc99d\uba85\uacfc \uac19\uc740 \ubbfc\uac10\ud55c \uc815\ubcf4\ub97c \uc548\uc804\ud558\uac8c \uc800\uc7a5\ud558\uae30 \uc704\ud574 Kubernetes\uc758 \uae30\ubcf8 \ub9ac\uc18c\uc2a4 \uc911 \ud558\ub098\uc778 \uc2dc\ud06c\ub9bf \uad6c\uc131\uc744 \uc0ac\uc6a9\ud569\ub2c8\ub2e4.\u00a0<\/p>\n\n\n\n<p>Kubernetes\ub294 \uae30\ubcf8\uc801\uc73c\ub85c \uc2dc\ud06c\ub9bf\uc744 base64\ub85c \uc778\ucf54\ub529\ub41c \ud615\ud0dc\ub85c \uc800\uc7a5\ud558\ub294\ub370, \uc774\uac83\ub9cc\uc73c\ub85c\ub294 \uc548\uc804\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. \ubcf4\uc548\uc744 \uac15\ud654\ud558\ub824\uba74 \uc800\uc7a5 \uc2dc \uc554\ud638\ud654\ub97c \ud65c\uc131\ud654\ud574\uc57c \ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<p>\uad6c\uc131\uc774 \uc644\ub8cc\ub418\uba74 Kubernetes \uc2dc\ud06c\ub9bf\uc744 \uc704\ud55c \uad6c\uc131\uc744 \uc0dd\uc131\ud569\ub2c8\ub2e4. \uc5ec\uae30\uc11c\ub294 Postgres \ube44\ubc00\ubc88\ud638\uc5d0 \ub300\ud574 \ub2e4\uc74c \uac12\uc744 \uc0ac\uc6a9\ud558\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<code>\u276f echo -n \"postgres\" | base64<br\/>cG9zdGdyZXMK<\/code>\n\n\n\n<p><\/p>\n\n\n\n<p>\uc774\uc81c \uc2dc\ud06c\ub9bf \uad6c\uc131 \ud30c\uc77c\uc744 \ub9cc\ub4e4\uace0 \ud074\ub7ec\uc2a4\ud130\uc5d0 \uc801\uc6a9\ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<code>&gt; cat postgres-secrets.yml<br\/>apiVersion: v1<br\/>kind: Secret<br\/>metadata:<br\/>name: postgres-secret-config<br\/>type: Opaque<br\/>data:<br\/>password: cG9zdGdyZXMK<\/code>\n\n\n\n<p><\/p>\n\n\n\n<p>\uc5ec\uae30\uc11c\ub294 Kubernetes\uc5d0 \ub370\uc774\ud130\ub97c \uc800\uc7a5\ud558\uae30 \uc704\ud574 \uc2dc\ud06c\ub9bf \uc81c\uacf5\uc790\ub97c \uc0ac\uc6a9\ud558\ub77c\uace0 \uc9c0\uc2dc\ud558\ub294 \ube44\ubc00 \uac1d\uccb4\uc778 <code>kind<\/code>\ub97c \uc0ac\uc6a9\ud588\uc2b5\ub2c8\ub2e4. \uc774\ub7ec\ud55c \uac12\ub4e4\uc744 \uc800\uc7a5\ud560 \ub54c \uc0ac\uc6a9\ud574\uc57c \ud558\ub294 \uc774\ub984\uc740 <code>postgres-secret-config<\/code>\ub77c\ub294 \ud0a4 \uc544\ub798\uc5d0 \uc788\uc2b5\ub2c8\ub2e4. \ub9c8\uc9c0\ub9c9\uc73c\ub85c data \uc139\uc158\uc5d0 \ube44\ubc00 \uac12\uc73c\ub85c \uc800\uc7a5\ud574\uc57c \ud558\ub294 \ud0a4\/\uac12 \uc30d\uc744 \uc81c\uacf5\ud588\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<p>\uc774\uc81c \uc774 \uad6c\uc131\uc744 \uc801\uc6a9\ud55c \ub4a4 \ub0b4\uc6a9\uc774 \uc62c\ubc14\ub974\uac8c \uc800\uc7a5\ub418\uc5c8\ub294\uc9c0 \ud655\uc778\ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<code>\u276f kubectl apply -f postgres-secrets.yml<br\/>secret\/postgres-secret-config created<br\/>\u276f kubectl get secret postgres-secret-config -o yaml<br\/>apiVersion: v1<br\/>data:<br\/>password: cG9zdGdyZXMK<br\/>....<br\/><\/code>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"create-persistentvolume-and-persistentvolumeclaim\">PersistentVolume\uacfc PersistentVolumeClaim \uc0dd\uc131\ud558\uae30<\/h3>\n\n\n\n<p>\ub2e4\uc74c\uc73c\ub85c \ub370\uc774\ud130\ubca0\uc774\uc2a4 \ub370\uc774\ud130\ub97c \uc601\uad6c\uc801\uc73c\ub85c \uc800\uc7a5\ud560 \ud30c\uc77c \uc2a4\ud1a0\ub9ac\uc9c0\ub97c \uc0dd\uc131\ud574\uc57c \ud569\ub2c8\ub2e4. \uae30\ubcf8\uc801\uc73c\ub85c \ub3c4\ucee4 \uc778\uc2a4\ud134\uc2a4\ub294 \ucee8\ud14c\uc774\ub108\uac00 \ub354 \uc774\uc0c1 \uc874\uc7ac\ud558\uc9c0 \uc54a\uac8c \ub418\uba74 \uc5b4\ub5a4 \uc815\ubcf4\uc5d0 \ub300\ud574\uc11c\ub3c4 \uc601\uad6c \uc2a4\ud1a0\ub9ac\uc9c0\uac00 \uc81c\uacf5\ub418\uc9c0 \uc54a\uae30 \ub54c\ubb38\uc785\ub2c8\ub2e4.<\/p>\n\n\n\n<p>\ud574\uacb0 \ubc29\ubc95\uc740 PostgreSQL \ub370\uc774\ud130\ub97c \uc800\uc7a5\ud560 \ud30c\uc77c \uc2dc\uc2a4\ud15c\uc744 \ub9c8\uc6b4\ud2b8\ud558\ub294 \uac83\uc785\ub2c8\ub2e4. Kubernetes\uc5d0\uc11c\ub294 \uc774\ub7ec\ud55c \uc791\uc5c5\uc744 \uc704\ud574 \uc11c\ub85c \ub2e4\ub978 \uad6c\uc131 \ud615\uc2dd\uc744 \uc0ac\uc6a9\ud558\ubbc0\ub85c \ub2e4\uc74c \ub2e8\uacc4\ub97c \ub530\ub985\ub2c8\ub2e4.\u00a0\u00a0<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>PersistentVolume(PV) \ub9e4\ub2c8\ud398\uc2a4\ud2b8\ub97c \uc0dd\uc131\ud558\uc5ec \uc0ac\uc6a9\ud560 \ubcfc\ub968 \uc720\ud615\uc744 \uc815\uc758\ud569\ub2c8\ub2e4.\u00a0<\/li>\n\n\n\n<li>PersistentVolumeClaim(PVC)\uc744 \uc0dd\uc131\ud558\uc5ec \ub3d9\uc77c\ud55c \uc2a4\ud1a0\ub9ac\uc9c0 \ud074\ub798\uc2a4(storage class)\ub97c \uae30\ubc18\uc73c\ub85c \ud574\ub2f9 PersistentVolume\uc758 \uc0ac\uc6a9\uc744 \uc694\uccad\ud569\ub2c8\ub2e4.<\/li>\n<\/ol>\n\n\n\n<p>\uc774\ubc88 \uc608\uc81c\uc5d0\uc11c\ub294 \ud604\uc7ac \ub178\ub4dc\uc758 \ud30c\uc77c \uc2dc\uc2a4\ud15c\uc744 \ubcfc\ub968\uc73c\ub85c \uc0ac\uc6a9\ud558\uc9c0\ub9cc, \uc2e4\uc81c \uc6b4\uc601 \ud658\uacbd\uc5d0\uc11c\ub294 standard, gp2 \ub4f1 \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc6a9 \ud45c\uc900 <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/storage\/storage-classes\/\" target=\"_blank\" rel=\"noopener\">\uc2a4\ud1a0\ub9ac\uc9c0 \ud074\ub798\uc2a4<\/a>\ub098 \ubcf5\uc81c \ubc0f IOPS \ucd5c\uc801\ud654\ub97c \uc9c0\uc6d0\ud558\ub294 \ud074\ub77c\uc6b0\ub4dc \uc81c\uacf5\uc790 \uc804\uc6a9 \ub3d9\uc801 \ud504\ub85c\ube44\uc800\ub108(dynamic provisioner)\ub97c \uc0ac\uc6a9\ud558\ub294 \uac83\uc774 \uc88b\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<p>\uba3c\uc800 PersistentVolume\uc758 \uad6c\uc131\uc744 \uc815\uc758\ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<code>&gt; cat pv-volume.yml<br\/>apiVersion: v1<br\/>kind: PersistentVolume<br\/>metadata:<br\/>name: postgres-pv-volume<br\/>labels:<br\/>type: local<br\/>spec:<br\/>storageClassName: manual<br\/>capacity:<br\/>storage: 5Gi<br\/>accessModes:<br\/>- ReadWriteOnce<br\/>hostPath:<br\/>path: \"\/mnt\/data\"<br\/><\/code>\n\n\n\n<p><\/p>\n\n\n\n<p>\uc774 \uad6c\uc131\uc5d0\uc11c\ub294 \ud074\ub7ec\uc2a4\ud130 \ub178\ub4dc\uc758 \/mnt\/data \uacbd\ub85c\uc5d0 5GB\uc758 \uc77d\uae30-\uc4f0\uae30(ReadWrite) \uc2a4\ud1a0\ub9ac\uc9c0\ub97c \uc608\uc57d\ud558\ub3c4\ub85d \uc9c0\uc815\ud588\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<p>\uc774\uc81c \uad6c\uc131\uc744 \uc801\uc6a9\ud558\uace0, PersistentVolume\uc774 \uc815\uc0c1\uc801\uc73c\ub85c \uc0dd\uc131\ub418\uc5c8\ub294\uc9c0 \ud655\uc778\ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<code>\u276f kubectl apply -f pv-volume.yml<br\/>persistentvolume\/postgres-pv-volume created<br\/>\u276f kubectl get pv postgres-pv-volume<br\/>NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE<br\/>postgres-pv-volume 5Gi RWO Retain Available manual 51s<br\/><\/code>\n\n\n\n<p><\/p>\n\n\n\n<p>\uc774\uc81c \uc55e\uc11c \uc815\uc758\ud55c PersistentVolume\uacfc \uc77c\uce58\ud558\ub294 PersistentVolumeClaim\uc744 \uad6c\uc131\ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<code>&gt; cat pv-claim.yml<br\/>apiVersion: v1<br\/>kind: PersistentVolumeClaim<br\/>metadata:<br\/>name: postgres-pv-claim<br\/>spec:<br\/>storageClassName: manual<br\/>accessModes:<br\/>- ReadWriteOnce<br\/>resources:<br\/>requests:<br\/>storage: 1Gi<br\/><\/code>\n\n\n\n<p><\/p>\n\n\n\n<p>\uc774 \uad6c\uc131\uc5d0\uc11c\ub294 \ub3d9\uc77c\ud55c \uc2a4\ud1a0\ub9ac\uc9c0 \ud074\ub798\uc2a4 \uc774\ub984\uc744 \uc0ac\uc6a9\ud574 1GB \uc6a9\ub7c9\uc758 PersistentVolumeClaim\uc744 \uc694\uccad\ud588\uc2b5\ub2c8\ub2e4. \uc774 \ub9e4\uac1c\ubcc0\uc218\ub294 Kubernetes\uac00 \uc804\uccb4 5GB \uc911 \uc774 \ud074\ub808\uc784\uc744 \uc704\ud574 \ub3d9\uc77c\ud55c \uc2a4\ud1a0\ub9ac\uc9c0 \ud074\ub798\uc2a4\uc5d0\uc11c 1GB\ub97c \ub530\ub85c \uc608\uc57d\ud560 \uc218 \uc788\uac8c \ud574\uc8fc\uae30 \ub54c\ubb38\uc5d0 \uc911\uc694\ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<p>\uc774\uc81c \uad6c\uc131\uc744 \uc801\uc6a9\ud558\uace0 PersistentVolumeClaim\uc774 \ubc14\uc778\ub529\ub418\uc5c8\ub294\uc9c0 \ud655\uc778\ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<code><br\/>\u276f kubectl apply -f pv-claim.yml<br\/>persistentvolumeclaim\/postgres-pv-claim created<br\/>\u276f kubectl get pvc postgres-pv-claim<br\/>NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE<br\/>postgres-pv-claim Bound postgres-pv-volume 1Gi RWO manual 5m32s<br\/><\/code>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"create-a-kubernetes-deployment-for-postgresql\">Kubernetes\uc5d0\uc11c PostgreSQL \ubc30\ud3ec\ud558\uae30<\/h3>\n\n\n\n<p>\uc55e\uc11c \uc0dd\uc131\ud55c postgres-secret-config \uc2dc\ud06c\ub9bf \uc774\ub984\uacfc PersistentVolume, PersistentVolumeClaim \uad6c\uc131\uc744 \ucc38\uc870\ud574 \uc774\uc81c Kubernetes \uc778\uc2a4\ud134\uc2a4\uc758 \ubc30\ud3ec(Deployment) \uad6c\uc131\uc744 \ub9cc\ub4e4\uc5b4 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<code><br\/>&gt; cat postgres-deployment.yml<br\/>apiVersion: apps\/v1<br\/>kind: Deployment<br\/>metadata:<br\/>name: postgres<br\/>spec:<br\/>replicas: 1<br\/>selector:<br\/>matchLabels:<br\/>app: postgres<br\/>template:<br\/>metadata:<br\/>labels:<br\/>app: postgres<br\/>spec:<br\/>volumes:<br\/>- name: postgres-pv-storage<br\/>persistentVolumeClaim:<br\/>claimName: postgres-pv-claim<br\/>containers:<br\/>- name: postgres<br\/>image: postgres:11<br\/>imagePullPolicy: IfNotPresent<br\/>ports:<br\/>- containerPort: 5432<br\/>env:<br\/>- name: POSTGRES_PASSWORD<br\/>valueFrom:<br\/>secretKeyRef:<br\/>name: postgres-secret-config<br\/>key: password<br\/>- name: PGDATA<br\/>value: \/var\/lib\/postgresql\/data\/pgdata<br\/>volumeMounts:<br\/>- mountPath: \/var\/lib\/postgresql\/data<br\/>name: postgres-pv-storage<br\/><\/code>\n\n\n\n<p><\/p>\n\n\n\n<p>\uc5ec\uae30\uc11c\ub294 \uc55e\uc5d0\uc11c \uc815\uc758\ud55c \ubaa8\ub4e0 \uad6c\uc131\uc744 Kubernetes \uc2dc\ud06c\ub9bf \uad6c\uc131\uacfc \ud37c\uc2dc\uc2a4\ud134\ud2b8 \ubcfc\ub968 \ub9c8\uc6b4\ud2b8\uc5d0 \ubaa8\ub450 \uacb0\ud569\ud588\uc2b5\ub2c8\ub2e4. \ub610\ud55c selector\uc640 metadata \ud544\ub4dc\ucc98\ub7fc \uc5ec\ub7ec \uc904\uc758 \ud56d\ubaa9\uc744 \ubcc4\ub3c4\ub85c \uc9c0\uc815\ud574 \uc8fc\uc5b4\uc57c \ud558\ub294 apiVersion: apps\/v1 \ud615\uc2dd\uc758 \ubc30\ud3ec \uad6c\uc131\uc744 \uc0ac\uc6a9\ud588\uc2b5\ub2c8\ub2e4. \uadf8 \ud6c4 \ucee8\ud14c\uc774\ub108 \uc774\ubbf8\uc9c0\uc640 \uc774\ubbf8\uc9c0 \ud480(pull) \uc815\ucc45\uc5d0 \ub300\ud55c \uc138\ubd80 \uc815\ubcf4\ub3c4 \ucd94\uac00\ud588\uc2b5\ub2c8\ub2e4. \uc774\ub294 \ud574\ub2f9 \ucee8\ud14c\uc774\ub108\uc5d0 \uc62c\ubc14\ub978 \ubcfc\ub968\uacfc \uc2dc\ud06c\ub9bf\uc774 \uc0ac\uc6a9\ub418\ub3c4\ub85d \ubcf4\uc7a5\ud558\uae30 \uc704\ud574 \ubaa8\ub450 \ud544\uc694\ud55c \uc791\uc5c5\uc785\ub2c8\ub2e4.<\/p>\n\n\n\n<p>\uc774\uc81c \ubc30\ud3ec\ub97c \uc801\uc6a9\ud558\uace0 \uc815\uc0c1\uc801\uc73c\ub85c \uc0ac\uc6a9 \uac00\ub2a5\ud55c\uc9c0 \ud655\uc778\ud558\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<code><br\/>\u276f kubectl apply -f postgres-deployment.yml<br\/>deployment.apps\/postgres created<br\/>\u276f kubectl get deployments<br\/>NAME READY UP-TO-DATE AVAILABLE AGE<br\/>postgres 1\/1 1 1 28s<br\/><\/code>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"create-a-service-to-expose-the-postgresql-server\">PostgreSQL \uc11c\ubc84 \ub178\ucd9c\uc744 \uc704\ud55c \uc11c\ube44\uc2a4 \ub9cc\ub4e4\uae30<\/h3>\n\n\n\n<p>Kubernetes Service\ub97c \uc0ac\uc6a9\ud558\uc5ec PostgreSQL \ud30c\ub4dc\ub97c \uc678\ubd80\ub85c \ub178\ucd9c\ud569\ub2c8\ub2e4. \uc774\ub97c \uc704\ud574 \ub2e4\ub978 \ud3ec\ud2b8\ub97c \uad6c\uc131\ud558\uac70\ub098 NodePort \ub610\ub294 LoadBalancer\ub85c \ub178\ucd9c\ud558\ub3c4\ub85d \uad6c\uc131\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc5ec\uae30\uc11c\ub294 \ub2e8\uc21c\ud558\uac8c \ud558\uae30 \uc704\ud574 \ub178\ub4dc\uc758 IP\uc5d0\uc11c \uace0\uc815 \ud3ec\ud2b8\ub85c \uc11c\ube44\uc2a4\ub97c \ub178\ucd9c\ud558\ub294 NodePort\ub97c \uc0ac\uc6a9\ud558\ub294 \ubc29\ubc95\uc744 \ubcf4\uc5ec \ub4dc\ub9ac\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<p>\uc544\ub798\uc640 \uac19\uc740 \uc11c\ube44\uc2a4 \ub9e4\ub2c8\ud398\uc2a4\ud2b8\ub97c \uc0ac\uc6a9\ud558\uc2e4 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<code><br\/>&gt; cat postgres-service.yml<br\/>apiVersion: v1<br\/>kind: Service<br\/>metadata:<br\/>name: postgres<br\/>labels:<br\/>app: postgres<br\/>spec:<br\/>type: NodePort<br\/>ports:<br\/>- port: 5432<br\/>selector:<br\/>app: postgres<br\/><\/code>\n\n\n\n<p><br\/><\/p>\n\n\n\n<p>\uc774\uc81c \uc11c\ube44\uc2a4\uc758 \uad6c\uc131\uc744 \uc801\uc6a9\ud558\uace0, \ud3ec\ud2b8\uac00 \ud560\ub2f9\ub418\uc5c8\ub294\uc9c0 \ub610\ub294 \uc81c\ub300\ub85c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294\uc9c0 \ud655\uc778\ud558\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<code><br\/>\u276f kubectl apply -f postgres-service.yml<br\/>service\/postgres created<br\/>\u276f kubectl get service postgres<br\/>NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE<br\/><\/code>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"test-the-connection-to-the-postgres-database\">PostgreSQL \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc5f0\uacb0 \ud14c\uc2a4\ud2b8\ud558\uae30<\/h3>\n\n\n\n<p>\uc774\uc81c \ub0b4\ubd80\uc801\uc73c\ub85c PostgreSQL \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc5d0 \uc5f0\uacb0\ud560 \uc218 \uc788\uc5b4\uc57c \ud569\ub2c8\ub2e4. \uc544\ub798 \uba85\ub839\uc5b4\ub97c \uc0ac\uc6a9\ud574 \ud655\uc778\ud574 \ubcfc \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<code><br\/>\u276f kubectl get pods<br\/>NAME READY STATUS RESTARTS AGE<br\/>postgres-57f4746d96-7z5q8 1\/1 Running 0 30m<br\/>\u276f kubectl exec -it postgres-57f4746d96-7z5q8 -- psql -U postgres<br\/><\/code>\n\n\n\n<p><\/p>\n\n\n\n<p>\ub610\ub294 Kubernetes Pod \uc774\ub984\uc744 \ubcc0\uc218\ub85c \uc800\uc7a5\ud574 \ub354 \ud3b8\ub9ac\ud558\uac8c \uc0ac\uc6a9\ud560 \uc218\ub3c4 \uc788\uc2b5\ub2c8\ub2e4<\/p>\n\n\n\n<code><br\/>POD=$(kubectl get pods -l app=postgres -o jsonpath=\"{.items[0].metadata.name}\")<\/code>\n\n\n\n<p><\/p>\n\n\n\n<p>\ub2e4\ub978 \ub3c4\ucee4 \ucee8\ud14c\uc774\ub108\ub97c \uc774\uc6a9\ud574 psql \uba85\ub839\uc73c\ub85c \uc5f0\uacb0\ud560 \uc218\ub3c4 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<code><br\/>export POSTGRES_PASSWORD=$(kubectl get secret postgres-secret-config -o jsonpath=\"{.data.password}\" | base64 --decode)<br\/>\u276f kubectl run postgres-client --rm --tty -i --restart='Never' --image postgres:11 --env=\"PGPASSWORD=$POSTGRES_PASSWORD\" --command -- psql -h postgres -U postgres<br\/><\/code>\n\n\n\n<p><\/p>\n\n\n\n<p>\ub9cc\uc57d \ud504\ub86c\ud504\ud2b8\uac00 \ud45c\uc2dc\ub418\uc9c0 \uc54a\ub294\ub2e4\uba74 Enter \ud0a4\ub97c \ud55c \ubc88 \ub20c\ub7ec\ubcf4\uc138\uc694.<\/p>\n\n\n\n<code><br\/>postgres=#<\/code>\n\n\n\n<p><\/p>\n\n\n\n<p>\uc774\uc81c \ucffc\ub9ac\ub97c \uc2e4\ud589\ud560 \uc900\ube44\uac00 \ub418\uc5c8\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"advanced-postgresql-deployment\">\uace0\uae09 PostgreSQL \ubc30\ud3ec<\/h2>\n\n\n\n<p>\uc55e\uc120 \uc608\uc2dc\uc5d0\uc11c\ub294 \uac1c\ubc1c \ubaa9\uc801\uc73c\ub85c \ub2e8\uc77c PostgreSQL \uc778\uc2a4\ud134\uc2a4\ub9cc \ubc30\ud3ec\ud588\uc2b5\ub2c8\ub2e4. \uadf8\ub7ec\ub098 \uc2e4\uc81c \ud504\ub85c\ub355\uc158\uc774\ub098 \ud558\uc774\ube0c\ub9ac\ub4dc \ud074\ub77c\uc6b0\ub4dc \ud658\uacbd\uc5d0\uc11c\ub294 \ub2e4\uc74c\uacfc \uac19\uc740 \uace0\uae09 \ubc30\ud3ec \uc635\uc158\uc744 \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/bitnami.com\/stack\/postgresql\/containers\" target=\"_blank\" rel=\"noopener\">\ube44\ud2b8\ub098\ubbf8(Bitnami) PostgreSQL \ubc30\ud3ec<\/a>: Bitnami\ub294 \uc5ec\ub7ec \uc720\ud615\uc758 \ubc30\ud3ec \ubc29\uc2dd(\ucee4\ubba4\ub2c8\ud2f0\uc5d0\uc11c \uc720\uc9c0\ud558\ub294 Kubernetes \ud328\ud0a4\uc9c0 \uad00\ub9ac\uc790 Helm \ud3ec\ud568)\uc744 \uc9c0\uc6d0\ud558\uba70, \ub300\uaddc\ubaa8 \ubc30\ud3ec\ub97c \uc704\ud55c \ub2e4\uc591\ud55c \uad6c\uc131 \uc635\uc158\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4.<\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/zalando\/postgres-operator\" target=\"_blank\" rel=\"noopener\">\uc798\ub780\ub3c4(Zalando) PostgreSQL \uc624\ud37c\ub808\uc774\ud130<\/a>: \uae30\uc874<a href=\"https:\/\/github.com\/zalando\/patroni\" target=\"_blank\" rel=\"noopener\"> Patroni<\/a> \uae30\ubc18 \ud074\ub7ec\uc2a4\ud130 \ud15c\ud50c\ub9bf\uc744 \ud65c\uc6a9\ud558\ub294 \uace0\uac00\uc6a9\uc131 Kubernetes \uc624\ud37c\ub808\uc774\ud130\ub85c, \uc548\uc815\uc801\uc774\uace0 \ud655\uc7a5 \uac00\ub2a5\ud55c PostgreSQL \ud074\ub7ec\uc2a4\ud130 \uc6b4\uc601\uc744 \uc9c0\uc6d0\ud569\ub2c8\ub2e4.<\/li>\n<\/ul>\n\n\n\n<p>\uc774\ub7ec\ud55c \uc635\uc158\ub4e4\uc740 \uc5d4\ud130\ud504\ub77c\uc774\uc988\uae09 \uc778\ud504\ub77c \uad6c\ucd95\uacfc \ud074\ub77c\uc6b0\ub4dc \ub124\uc774\ud2f0\ube0c \ucef4\ud4e8\ud305 \uae30\ubc18\uc758 \ubaa8\ubc94 \uc0ac\ub840\ub97c \ub530\ub974\ub294 \ub370 \ub3c4\uc6c0\uc774 \ub429\ub2c8\ub2e4.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"next-steps\">\ub2e4\uc74c \ub2e8\uacc4<\/h2>\n\n\n\n<p>\uc774\uc81c Kubernetes\uc5d0 \uac04\ub2e8\ud55c PostgreSQL \uc778\uc2a4\ud134\uc2a4\ub97c \ubc30\ud3ec\ud588\uc73c\ubbc0\ub85c \ubaa8\ub2c8\ud130\ub9c1\uacfc \ub85c\uae45\uc744 \ud1b5\ud569\ud560 \uc900\ube44\uac00 \ub418\uc5c8\uc2b5\ub2c8\ub2e4. Sumo Logic\uacfc \uac19\uc740 \ub3c4\uad6c\ub294 \uace0\uae09 Kubernetes \ubaa8\ub2c8\ud130\ub9c1\uc744 \uc9c0\uc6d0\ud558\uc5ec \ud074\ub7ec\uc2a4\ud130 \ub9ac\uc18c\uc2a4\ub97c \uad00\ub9ac\ud558\uace0, Kubernetes \ud30c\ub4dc\uc5d0\uc11c \uc0dd\uc131\ub418\ub294 \ub85c\uadf8\ub97c \ubd84\uc11d\ud558\uba70, \ud074\ub77c\uc6b0\ub4dc \ub124\uc774\ud2f0\ube0c \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc758 \uc635\uc800\ubc84\ube4c\ub9ac\ud2f0\ub97c \ubcf4\uc7a5\ud558\ub294 \ub370 \ub3c4\uc6c0\uc744 \uc90d\ub2c8\ub2e4. \uae30\ubcf8 \uc124\uc815\uc5d0\uc11c\ub294 \ud074\ub808\uc784\uc774 \uc0ad\uc81c\ub418\uba74 \ubcfc\ub968\ub3c4 \ud568\uaed8 \uc0ad\uc81c\ub420 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc7ac\ud074\ub808\uc784 \uc815\ucc45(Reclaim Policy)\uc744 Retain(\ubcf4\uc874)\uc73c\ub85c \uc124\uc815\ud558\uba74 PVC\uac00 \uc0ad\uc81c\ub418\ub354\ub77c\ub3c4 \ub370\uc774\ud130\uac00 \uadf8\ub300\ub85c \uc720\uc9c0\ub418\ub3c4\ub85d \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<br\/><br\/><a href=\"https:\/\/www.sumologic.com\/ko\/solutions\/kubernetes-monitoring\" data-type=\"page\" data-id=\"104\">Sumo Logic\uc774 Kubernetes \ubaa8\ub2c8\ud130\ub9c1\uc5d0 \uc5b4\ub5bb\uac8c \ub3c4\uc6c0\uc774 \ub418\ub294\uc9c0 \uc54c\uc544\ubcf4\uc138\uc694<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div><\/section>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":331,"featured_media":46233,"template":"","meta":{"_acf_changed":false,"show_custom_date":false,"custom_date":"","featured":false,"featured_image":0,"learn_more_label":"","image_alt_text":"","learn_more_type":"","show_popup":false,"learn_more_link_file":0,"event_date":false,"event_start_date":"","event_end_date":"","place_holder_image_url":"","post_reading_time":"2","notification_enabled":false,"notification_text":"","notification_logo":"","notification_expiration_time":0,"is_enable_transparent_header":false,"selected_taxonomy_terms":{"blog-category":[319],"blog-tag":[],"translation_priority":[221]},"selected_primary_terms":[],"learn_more_link":[],"featured_page_list":[],"notification_enabled_post_list":[],"_gspb_post_css":"","_relevanssi_hide_post":"","_relevanssi_hide_content":"","_relevanssi_pin_for_all":"","_relevanssi_pin_keywords":"","_relevanssi_unpin_keywords":"","_relevanssi_related_keywords":"","_relevanssi_related_include_ids":"","_relevanssi_related_exclude_ids":"","_relevanssi_related_no_append":"","_relevanssi_related_not_related":"","_relevanssi_related_posts":"62715,62740,62708","_relevanssi_noindex_reason":"","inline_featured_image":false,"footnotes":""},"blog-category":[319],"blog-tag":[],"class_list":["post-55110","blog","type-blog","status-publish","has-post-thumbnail","hentry","blog-category-devops-it-operations"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.sumologic.com\/ko\/wp-json\/wp\/v2\/blog\/55110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sumologic.com\/ko\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/www.sumologic.com\/ko\/wp-json\/wp\/v2\/types\/blog"}],"author":[{"embeddable":true,"href":"https:\/\/www.sumologic.com\/ko\/wp-json\/wp\/v2\/users\/331"}],"version-history":[{"count":3,"href":"https:\/\/www.sumologic.com\/ko\/wp-json\/wp\/v2\/blog\/55110\/revisions"}],"predecessor-version":[{"id":67557,"href":"https:\/\/www.sumologic.com\/ko\/wp-json\/wp\/v2\/blog\/55110\/revisions\/67557"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sumologic.com\/ko\/wp-json\/wp\/v2\/media\/46233"}],"wp:attachment":[{"href":"https:\/\/www.sumologic.com\/ko\/wp-json\/wp\/v2\/media?parent=55110"}],"wp:term":[{"taxonomy":"blog-category","embeddable":true,"href":"https:\/\/www.sumologic.com\/ko\/wp-json\/wp\/v2\/blog-category?post=55110"},{"taxonomy":"blog-tag","embeddable":true,"href":"https:\/\/www.sumologic.com\/ko\/wp-json\/wp\/v2\/blog-tag?post=55110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}