Skip to content

Instantly share code, notes, and snippets.

@mikedep333
Last active October 18, 2022 18:37
Show Gist options
  • Select an option

  • Save mikedep333/38d2af65fc9fd277e2dc115dd8e9617b to your computer and use it in GitHub Desktop.

Select an option

Save mikedep333/38d2af65fc9fd277e2dc115dd8e9617b to your computer and use it in GitHub Desktop.
starting a podman-compose cluster with additional pulp-content hosts
git clone git@github.com:pulp/pulp-oci-images.git
cd pulp-oci-images/images/compose
podman-compose up -d
# Adjust "2 10` for the list of additional content hosts
# pulp-content host #2 will be port 20002, and so on. (`podman ps`)
# Note that the 1st content host will be port 24816, unless you modify podman-compose.yml to have port map "20001:24816"
for i in `seq 2 10`
do
let "port = $i + 20000"
podman create --name=compose_pulp_content_${i} --label io.podman.compose.config-hash=123 --label io.podman.compose.project=compose --label io.podman.compose.version=0.0.1 --label com.docker.compose.project=compose --label com.docker.compose.project.working_dir=$PWD --label com.docker.compose.project.config_files=podman-compose.yml --label com.docker.compose.container-number=1 --label com.docker.compose.service=pulp_content -e POSTGRES_SERVICE_PORT=5432 -e POSTGRES_SERVICE_HOST=postgres -v $PWD/assets/settings.py:/etc/pulp/settings.py:z -v $PWD/assets/certs:/etc/pulp/certs:z -v pulpdev:/var/lib/pulp --net compose_default -p ${port}:24816 -u root --hostname pulp-content pulp/pulp-minimal:latest pulp-content
podman start compose_pulp_content_${i}
done
# To delete everything, again adjust `2 10` as needed:
for i in `seq 2 10`; do podman rm -f compose_pulp_content_${i}; done
podman-compose down
@bmbouter

Copy link
Copy Markdown

I changed pulp-minimal to pulp so the images is fetched from quay.io

git clone git@github.com:pulp/pulp-oci-images.git
cd pulp-oci-images/images/compose

podman-compose up -d
# Adjust "2 10` for the list of additional content hosts
# pulp-content host #2 will be port 20002, and so on. (`podman ps`)
# Note that the 1st content host will be port 24816, unless you modify podman-compose.yml to have port map "20001:24816"
for i in `seq 2 10`
do
  let "port = $i + 20000"

  podman create --name=compose_pulp_content_${i} --label io.podman.compose.config-hash=123 --label io.podman.compose.project=compose --label io.podman.compose.version=0.0.1 --label com.docker.compose.project=compose --label com.docker.compose.project.working_dir=$PWD --label com.docker.compose.project.config_files=podman-compose.yml --label com.docker.compose.container-number=1 --label com.docker.compose.service=pulp_content -e POSTGRES_SERVICE_PORT=5432 -e POSTGRES_SERVICE_HOST=postgres -v $PWD/assets/settings.py:/etc/pulp/settings.py:z -v $PWD/assets/certs:/etc/pulp/certs:z -v pulpdev:/var/lib/pulp --net compose_default -p ${port}:24816 -u root --hostname pulp-content pulp/pulp:latest pulp-content
  
  podman start compose_pulp_content_${i}
done


# To delete everything, again adjust `2 10` as needed:
for i in `seq 2 10`; do podman rm -f compose_pulp_content_${i}; done
podman-compose down

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment