podman_로컬_컨테이너_런타임에서_포드_및_컨테이너_관리

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

podman_로컬_컨테이너_런타임에서_포드_및_컨테이너_관리 [2021/07/27 01:51] – 만듦 koovpodman_로컬_컨테이너_런타임에서_포드_및_컨테이너_관리 [2021/07/27 01:57] (현재) koov
줄 151: 줄 151:
  
 $ curl http://localhost:32597 $ curl http://localhost:32597
 +podman rulez
 </code> </code>
 </WRAP> </WRAP>
  
-podman rulez +다음은 컨테이너를 나열할 때의 모습입니다. 
-And here is what it looks like when listing containers: +<WRAP prewrap> 
 +<code bash>
 $ sudo podman ps -ap $ sudo podman ps -ap
 CONTAINER ID  IMAGE                               COMMAND               CREATED       STATUS            PORTS                  NAMES               POD CONTAINER ID  IMAGE                               COMMAND               CREATED       STATUS            PORTS                  NAMES               POD
 ac8839fc7dea  quay.io/libpod/alpine_nginx:latest  nginx -g daemon o...  4 minutes ago Up 4 minutes ago                         happy_cray          3e4cad88f8c2 ac8839fc7dea  quay.io/libpod/alpine_nginx:latest  nginx -g daemon o...  4 minutes ago Up 4 minutes ago                         happy_cray          3e4cad88f8c2
 c2f7c5651275  k8s.gcr.io/pause:3.1                                      4 minutes ago Up 4 minutes ago  0.0.0.0:32597->80/tcp  3e4cad88f8c2-infra  3e4cad88f8c2 c2f7c5651275  k8s.gcr.io/pause:3.1                                      4 minutes ago Up 4 minutes ago  0.0.0.0:32597->80/tcp  3e4cad88f8c2-infra  3e4cad88f8c2
-  +</code> 
- +</WRAP>
-MariaDB example +
-The following asciinema demo shows how to create a pod via the shortcut method.  The container being run is a MariaDB container image and I bind only to its 127.0.0.1 address.  This means only containers in the same pod will able to access it. I then run an alpine container, install the MariaDB-client package, connect to the database itself, and show defined databases. +
- +
- +
- +
- +
  
-Pods and container management +===== Pods and container management ===== 
-In Podman, the status of the pod and its containers can be exclusive to each other meaning that containers within pods can be restartedstopped, and started without impacting the status of the pod Suppose we have a pod called demodb and it contains two containers (and an “infra” containerrunning a MariaDB and a nginx session.+''Podman''에서 Pod와 해당 컨테이너의 상태는 서로 배타적일 수 있습니다. 즉Pod의 상태에 영향을 주지 않고 Pod 내의 컨테이너를 다시 시작중지 및 시작할 수 있습니다''demodb''라는 포드가 있고 ''MariaDB''와 ''nginx'' 세션을 실행하는 두 개의 컨테이너(및 ''infra'' 컨테이너)가 포함되어 있다고 가정 합니다.
  
 +<WRAP prewrap>
 +<code bash>
 $ sudo podman pod ps $ sudo podman pod ps
 POD ID         NAME   STATUS    CREATED             # OF CONTAINERS   INFRA ID POD ID         NAME   STATUS    CREATED             # OF CONTAINERS   INFRA ID
 fa7924a5196c   demodb Running   About a minute ago  3                 3005ed8491d0 fa7924a5196c   demodb Running   About a minute ago  3                 3005ed8491d0
 +
 $ sudo podman ps -p $ sudo podman ps -p
 CONTAINER ID  IMAGE                                COMMAND              CREATED       STATUS            PORTS  NAMES              POD CONTAINER ID  IMAGE                                COMMAND              CREATED       STATUS            PORTS  NAMES              POD
 02e37a3b9873  quay.io/libpod/alpine_nginx:latest   nginx -g daemon o... 4 minutes ago Up 4 minutes ago         optimistic_edison  fa7924a5196c 02e37a3b9873  quay.io/libpod/alpine_nginx:latest   nginx -g daemon o... 4 minutes ago Up 4 minutes ago         optimistic_edison  fa7924a5196c
 2597454063f8  quay.io/baude/mariadbpoddemo:latest  docker-entrypoint... 4 minutes ago Up 4 minutes ago         eloquent_golick    fa7924a5196c 2597454063f8  quay.io/baude/mariadbpoddemo:latest  docker-entrypoint... 4 minutes ago Up 4 minutes ago         eloquent_golick    fa7924a5196c
-  +</code> 
- +</WRAP>
-If we wanted to stop and start the nginx container, the status of the MariaDB container and the pod itself will remain unchanged.+
  
 +''nginx'' 컨테이너를 중지하고 시작하려는 경우 ''MariaDB'' 컨테이너 및 포드 자체의 상태는 변경되지 않은 상태로 유지됩니다.
 +<WRAP prewrap>
 +<code bash>
 $ sudo podman stop optimistic_edison $ sudo podman stop optimistic_edison
 02e37a3b987300e9124b61820119ae425c5e496b907800ecaf1194a3f50e5dcc 02e37a3b987300e9124b61820119ae425c5e496b907800ecaf1194a3f50e5dcc
-  +</code> 
- +</WRAP>
-With the nginx container stopped, we can still observe the demopod is running and the MariaDB container remains unchanged.+
  
 +''nginx'' 컨테이너가 중지된 상태에서도 여전히 ''demopod''실행 중이고 ''MariaDB'' 컨테이너가 변경되지 않은 상태로 유지되는 것을 볼 수 있습니다 .
 +<WRAP prewrap>
 +<code bash>
 $ sudo podman pod ps $ sudo podman pod ps
 POD ID         NAME   STATUS    CREATED       # OF CONTAINERS   INFRA ID POD ID         NAME   STATUS    CREATED       # OF CONTAINERS   INFRA ID
 fa7924a5196c   demodb Running   5 minutes ago 3                 3005ed8491d0 fa7924a5196c   demodb Running   5 minutes ago 3                 3005ed8491d0
 +
 $ sudo podman ps -p $ sudo podman ps -p
 CONTAINER ID  IMAGE                                COMMAND              CREATED       STATUS            PORTS  NAMES            POD CONTAINER ID  IMAGE                                COMMAND              CREATED       STATUS            PORTS  NAMES            POD
 2597454063f8  quay.io/baude/mariadbpoddemo:latest  docker-entrypoint... 5 minutes ago Up 5 minutes ago         eloquent_golick  fa7924a5196c 2597454063f8  quay.io/baude/mariadbpoddemo:latest  docker-entrypoint... 5 minutes ago Up 5 minutes ago         eloquent_golick  fa7924a5196c
-  +</code> 
- +</WRAP>
-And we can start the nginx container to restore the pod back to its original state.+
  
 +그리고 ''nginx'' 컨테이너를 시작하여 포드를 원래 상태로 복원할 수 있습니다.
 +<WRAP prewrap>
 +<code bash>
 $ sudo podman start optimistic_edison $ sudo podman start optimistic_edison
 optimistic_edison optimistic_edison
 +
 $ sudo podman ps -p $ sudo podman ps -p
 CONTAINER ID  IMAGE                                COMMAND              CREATED       STATUS            PORTS  NAMES              POD CONTAINER ID  IMAGE                                COMMAND              CREATED       STATUS            PORTS  NAMES              POD
 02e37a3b9873  quay.io/libpod/alpine_nginx:latest   nginx -g daemon o... 8 minutes ago Up 6 seconds ago         optimistic_edison  fa7924a5196c 02e37a3b9873  quay.io/libpod/alpine_nginx:latest   nginx -g daemon o... 8 minutes ago Up 6 seconds ago         optimistic_edison  fa7924a5196c
 2597454063f8  quay.io/baude/mariadbpoddemo:latest  docker-entrypoint... 8 minutes ago Up 8 minutes ago         eloquent_golick    fa7924a5196c 2597454063f8  quay.io/baude/mariadbpoddemo:latest  docker-entrypoint... 8 minutes ago Up 8 minutes ago         eloquent_golick    fa7924a5196c
- +</code> 
 +</WRAP>
  
-We can also stop the pod and all of its containers using the podman pod stop command.+''podman pod stop''명령을 사용하여 포드와 모든 컨테이너를 중지할 수도 있습니다 .
  
 +<WRAP prewrap>
 +<code bash>
 $ sudo podman pod stop demodb $ sudo podman pod stop demodb
 fa7924a5196cb403298ad2ce24f0db30a3790e80729c7704ef5fdc27302f7ad0 fa7924a5196cb403298ad2ce24f0db30a3790e80729c7704ef5fdc27302f7ad0
 +
 $ sudo podman ps -ap $ sudo podman ps -ap
 CONTAINER ID  IMAGE                                COMMAND              CREATED        STATUS                     PORTS                    NAMES               POD CONTAINER ID  IMAGE                                COMMAND              CREATED        STATUS                     PORTS                    NAMES               POD
줄 218: 줄 227:
 2597454063f8  quay.io/baude/mariadbpoddemo:latest  docker-entrypoint... 10 minutes ago Exited (0) 19 seconds ago                           eloquent_golick     fa7924a5196c 2597454063f8  quay.io/baude/mariadbpoddemo:latest  docker-entrypoint... 10 minutes ago Exited (0) 19 seconds ago                           eloquent_golick     fa7924a5196c
 3005ed8491d0  k8s.gcr.io/pause:3.1                                      10 minutes ago Exited (0) 19 seconds ago  0.0.0.0:43871->3306/tcp  fa7924a5196c-infra  fa7924a5196c 3005ed8491d0  k8s.gcr.io/pause:3.1                                      10 minutes ago Exited (0) 19 seconds ago  0.0.0.0:43871->3306/tcp  fa7924a5196c-infra  fa7924a5196c
-  +</code> 
- +</WRAP>
-And if we look at the status of the pod, it will show a state of “Exited”.+
  
 +그리고 ''Pod''의 상태를 보면 ''Exited'' 상태로 표시됩니다.
 +<WRAP prewrap>
 +<code bash>
 $ sudo podman pod ps $ sudo podman pod ps
 POD ID         NAME     STATUS   CREATED        # OF CONTAINERS   INFRA ID POD ID         NAME     STATUS   CREATED        # OF CONTAINERS   INFRA ID
 fa7924a5196c   demodb Exited   13 minutes ago                   3005ed8491d0 fa7924a5196c   demodb Exited   13 minutes ago                   3005ed8491d0
- +</code> 
 +</WRAP>
  
-Likewise, we can also start the pod and all of its containers back up After which, all the containers in the pod should be running and the pod should show a status of “Running.+마찬가지로 포드와 모든 컨테이너 백업을 시작할 수도 있습니다그런 다음 포드의 모든 컨테이너가 실행 중이어야 하며 포드는 ''Running'' 상태를 표시해야 합니다.
  
 +<WRAP prewrap>
 +<code bash>
 $ sudo podman pod start demodb $ sudo podman pod start demodb
 fa7924a5196cb403298ad2ce24f0db30a3790e80729c7704ef5fdc27302f7ad0 fa7924a5196cb403298ad2ce24f0db30a3790e80729c7704ef5fdc27302f7ad0
 +
 $ sudo podman ps -p $ sudo podman ps -p
 CONTAINER ID  IMAGE                                COMMAND              CREATED        STATUS            PORTS  NAMES              POD CONTAINER ID  IMAGE                                COMMAND              CREATED        STATUS            PORTS  NAMES              POD
 02e37a3b9873  quay.io/libpod/alpine_nginx:latest   nginx -g daemon o... 14 minutes ago Up 5 seconds ago         optimistic_edison  fa7924a5196c 02e37a3b9873  quay.io/libpod/alpine_nginx:latest   nginx -g daemon o... 14 minutes ago Up 5 seconds ago         optimistic_edison  fa7924a5196c
 2597454063f8  quay.io/baude/mariadbpoddemo:latest  docker-entrypoint... 14 minutes ago Up 4 seconds ago         eloquent_golick    fa7924a5196c 2597454063f8  quay.io/baude/mariadbpoddemo:latest  docker-entrypoint... 14 minutes ago Up 4 seconds ago         eloquent_golick    fa7924a5196c
 +
 $ sudo podman pod ps $ sudo podman pod ps
 POD ID         NAME   STATUS    CREATED        # OF CONTAINERS  INFRA ID POD ID         NAME   STATUS    CREATED        # OF CONTAINERS  INFRA ID
 fa7924a5196c   demodb Running   14 minutes ago 3                3005ed8491d0 fa7924a5196c   demodb Running   14 minutes ago 3                3005ed8491d0
 +</code>
 +</WRAP>
  
-There is also a podman pod restart command that will restart all the containers within a Pod+''podman pod restart'' Pod 내의 모든 컨테이너를 다시 시작 하는 명령 도 있습니다 .
- +
-  +
- +
-Wrap up +
-The ability for Podman to handle pod deployment is a clear differentiator to other container runtimes.  As a libpod maintainer, I am still realizing the advantages of having pods even in a localized runtime. There will most certainly be more development in Podman around pods as we learn how users exploit the use of them.+
  
-For more information on Podman, make sure you visit the libpod project page on githubRelevant blogs and news related to Podman can also be found at podman.io.+===== 참조링크 ===== 
 +  * https://developers.redhat.com/blog/2019/01/15/podman-managing-containers-pods
  
-Podman is included with Red Hat Enterprise Linux 7.6 as well as Red Hat Enterprise Linux 8 beta. 
  
-More about Podman on the Red Hat Developer Blog 
-Containers without daemons: Podman and Buildah available in RHEL 7.6 and RHEL 8 Beta 
-Podman - The next generation of Linux container tools 
-Intro to Podman (New in Red Hat Enterprise Linux 7.6) 
-Managing containerized system services with Podman 
  • podman_로컬_컨테이너_런타임에서_포드_및_컨테이너_관리.1627350687.txt.gz
  • 마지막으로 수정됨: 2021/07/27 01:51
  • 저자 koov