Felhasználói eszközök

Eszközök a webhelyen


kubernetes:alapok

POD létrehozása podman segítségével

Ellenőrzések

# podman ps -a
CONTAINER ID  IMAGE       COMMAND     CREATED     STATUS      PORTS       NAMES

# podman image ls
REPOSITORY  TAG         IMAGE ID    CREATED     SIZE

# podman network ls
NETWORK ID    NAME        DRIVER
2f259bab93aa  podman      bridge

# podman secret ls
ID          NAME        DRIVER      CREATED     UPDATED

# podman volume ls

Pod létrehozása

# podman pod create -p 80:80 --name webpod
369dc0cd85605670aa10c893f4332495ee61f6317101555871cca1b95030d6f2

Ellenőrzés

# podman pod ls
POD ID        NAME        STATUS      CREATED             INFRA ID      # OF CONTAINERS
369dc0cd8560  webpod      Created     About a minute ago  50957a795471  1

# podman ps -a
CONTAINER ID  IMAGE                                    COMMAND     CREATED         STATUS      PORTS               NAMES
50957a795471  localhost/podman-pause:5.4.0-1757462400              38 seconds ago  Created     0.0.0.0:80->80/tcp  369dc0cd8560-infra

# podman image ls
REPOSITORY              TAG               IMAGE ID      CREATED             SIZE
localhost/podman-pause  5.4.0-1757462400  918a1d4c216b  About a minute ago  706 kB

Konténerek hozzáadása

# podman run -d --name nginx --pod webpod nginx
Resolved "nginx" as an alias (/var/cache/containers/short-name-aliases.conf)
Trying to pull docker.io/library/nginx:latest...
Getting image source signatures
Copying blob 250b90fb2b9a done   | 
Copying blob 8da8ed3552af done   | 
Copying blob 58d144c4badd done   | 
Copying blob 5d8ea9f4c626 done   | 
Copying blob b459da543435 done   | 
Copying blob 8c7716127147 done   | 
Copying blob 54e822d8ee0c done   | 
Copying config 07ccdb7838 done   | 
Writing manifest to image destination
d050166ef1f7548a8af64f8cca98f321dbae364f3e074977f7a635084b574ea9

# podman run -it --rm --pod webpod busybox wget -qO- http://127.0.0.1
Resolved "busybox" as an alias (/etc/containers/registries.conf.d/000-shortnames.conf)
Trying to pull docker.io/library/busybox:latest...
Getting image source signatures
Copying blob 80bfbb8a41a2 done   | 
Copying config 0ed463b26d done   | 
Writing manifest to image destination
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>
</body>
</html>

Törlés

# podman pod stop webpod

# podman pod rm webpod

Ugyanez megoldható yaml definícióval

nginx-pod.yaml
apiVersion: v1
kind: Pod
metadata:
  name: webpod
spec:
  containers:
    - name: nginx
      image: docker.io/library/nginx:latest
      ports:
        - containerPort: 80
    - name: busybox
      image: docker.io/library/busybox:latest
      command: ["sleep", "3600"]

Futtatás

podman play kube nginx-pod.yaml
kubernetes/alapok.txt · Utolsó módosítás: szerkesztette: riba.zoltan