Bookmark this page

Quiz: Compose Overview and Use Cases

Compose Overview and Use Cases

Choose the correct answers to the following questions:


  1. 1.

    Based on your understanding of Podman Compose, which statement presents a suitable use for Podman Compose?

    A

    Automate deployment of multi-container applications for a multi-node production environment.

    B

    Automate deployment of multi-container applications for local development.

    C

    Stop using Podman to gain security benefits of Podman Compose.

    D

    Stop using Podman to gain network isolation benefits of Podman Compose.

  2. 2.

    Based on the provided output of Podman Compose, which statement is correct?

    ['podman', 'network', 'exists', 'compose_app-net']
    podman run --name=compose_frontend_1 -d --net compose_app-net --network-alias frontend -p 8082:8080 quay.io/redhattraining/ubi-httpd
    64029...ffe1
    exit code: 0
    ['podman', 'network', 'exists', 'compose_app-net']
    ['podman', 'network', 'exists', 'compose_db-net']
    podman run --name=compose_backend_1 -d --net compose_db-net,compose_app-net --network-alias backend -p 8081:8080 quay.io/redhattraining/podman-quotes:quarkus
    2023...13a1
    exit code: 0
    ['podman', 'network', 'exists', 'compose_db-net']
    podman run --name=compose_db_1 -d -e POSTGRESQL_ADMIN_PASSWORD=redhat --net compose_db-net --network-alias db -p 8001:5432 registry.redhat.io/rhel8/postgresql-13
    e15b...c0da
    exit code: 0
    A

    The application failed to start because some objects defined in the Compose file already exist, such as the network.

    B

    The application consists of two containers.

    C

    The front-end container can reach the database container.

    D

    The front-end container uses two networks.

    E

    The back-end container can reach the database and front-end containers.

    F

    The Compose file exposes two containers on the port 8080.

  3. 3.

    Which statement about networks in Podman Compose is correct?

    A

    You cannot limit network traffic among containers in a single Compose file. To limit such traffic, you must create multiple Compose files.

    B

    You must use at most one network per container.

    C

    Containers cannot communicate over the network by default. Create a default network to allow network traffic.

    D

    Containers can communicate over the network by default. Define additional networks to further limit the network traffic.

  4. 4.

    Based on the provided Compose file, which three statements are correct? (Choose three.)

    services:
      db-admin:
        image: quay.io/pgadmin4
        environment:
          PGADMIN_DEFAULT_EMAIL: user@redhat.com
          PGADMIN_DEFAULT_PASSWORD: redhat
        ports:
          - "9876:80"
      db:
        image: registry.redhat.io/rhel8/postgresql-13
        environment:
          POSTGRESQL_USER: redhat
          POSTGRESQL_DATABASE: db
          POSTGRESQL_PASSWORD: redhat
        ports:
          - "5432:5423"
        volumes:
          - db-vol:/var/lib/postgresql/data
    
    volumes:
      db-vol: {}
    A

    The db-admin container can send traffic to the db container by using the db hostname.

    B

    The db-admin container cannot communicate with the db container. To fix the issue, you must define a new, common network.

    C

    The db-admin container is accessible from the host machine on port 80.

    D

    The db-admin container is accessible from the host machine on port 9876.

    E

    The db container must expose the port 5432. Otherwise, the db-admin container cannot send traffic to that port.

    F

    The traffic from the db-admin container to the db container uses a default network. Therefore, exposing the 5432 port is not necessary unless you intend to access the DB from the host network.

    G

    The Compose file is syntactically wrong because the db-vol: {} line is incorrect. You must change it to db-vol: to fix the issue.

  5. 5.

    Which three statements about Podman Compose are correct? (Choose three.)

    A

    Execute podman-compose up to create and start containers that are defined in the Compose file.

    B

    Execute podman compose start to create and start containers that are defined in the Compose file.

    C

    Execute podman-compose down to stop and delete containers that are defined in the Compose file.

    D

    Execute podman-compose stop to stop and delete containers that are defined in the Compose file.

    E

    Execute podman-compose stop to stop containers that are defined in the Compose file.

Revision: do188-4.14-8c43a16