|
1 | | -# Imperative Container |
| 1 | +# Validated Pattern Imperative Container |
2 | 2 |
|
3 | | -imperative container for simplified execution of imperative commands in each of the patterns. |
| 3 | +[](https://quay.io/repository/hybridcloudpatterns/imperative-container) |
| 4 | + |
| 5 | +An imperative container for simplified execution of imperative commands in each of the Validated Patterns. |
| 6 | + |
| 7 | +## Overview |
| 8 | + |
| 9 | +This container provides a focused environment with essential tools for executing imperative commands and automation tasks in Validated Patterns. It includes Ansible, Kubernetes tools, and other utilities needed for pattern implementation and management. |
4 | 10 |
|
5 | 11 |
|
6 | 12 | ## Installed Software |
7 | 13 |
|
8 | 14 | | name | type |version| |
9 | 15 | |:----------------:|:--------:|:-----:| |
10 | | -|ansible |pip |2.16.11| |
11 | | -|ansible.posix |collection|1.6.0 | |
12 | | -|ansible-runner |pip |2.4.0 | |
13 | | -|ansible.utils |collection|5.1.1 | |
14 | | -|community.general |collection|9.4.0 | |
15 | | -|community.okd |collection|4.0.0 | |
16 | | -|git-core |package |2.43.5 | |
| 16 | +|ansible |pip |2.16.14| |
| 17 | +|ansible.posix |collection|2.1.0 | |
| 18 | +|ansible-runner |pip |2.4.1 | |
| 19 | +|ansible.utils |collection|6.0.0 | |
| 20 | +|community.general |collection|11.1.1 | |
| 21 | +|community.okd |collection|5.0.0 | |
| 22 | +|git-core |package |2.47.3 | |
17 | 23 | |jmespath |pip |1.0.1 | |
18 | 24 | |jq |package |1.6 | |
19 | | -|kubernetes.core |collection|5.0.0 | |
20 | | -|kubernetes |pip |31.0.0 | |
| 25 | +|kubernetes.core |collection|6.0.0 | |
| 26 | +|kubernetes |pip |33.1.0 | |
21 | 27 | |make |package |4.3 | |
22 | 28 | |openshift |binary |4.16.14| |
23 | | -|python3-pip |package |21.2.3 | |
24 | | -|python |package |3.11.7 | |
25 | | -|rhvp.cluster_utils|collection|1.0.1 | |
| 29 | +|python3-pip |package |21.3.1 | |
| 30 | +|python |package |3.11.11| |
| 31 | +|rhvp.cluster_utils|collection|1.1.0 | |
26 | 32 | |sshpass |package |1.09 | |
27 | 33 |
|
28 | 34 | ## Usage |
29 | | -**Pull the image** |
| 35 | + |
| 36 | +### Pull the Image |
| 37 | + |
30 | 38 | ```bash |
31 | 39 | podman pull quay.io/hybridcloudpatterns/imperative-container:latest |
32 | 40 | ``` |
33 | 41 |
|
34 | | -**Use image to execute a playbook** |
| 42 | +### Examples |
| 43 | + |
| 44 | +**Interactive shell** |
| 45 | + |
35 | 46 | ```bash |
36 | | -podman run -it --rm --net=host quay.io/hybridcloudpatterns/imperative-container:latest ansible-playbook <playbook>.yml |
| 47 | +podman run --rm -it --net=host \ |
| 48 | + --security-opt label=disable \ |
| 49 | + -v ${HOME}:/pattern \ |
| 50 | + -v ${HOME}:${HOME} \ |
| 51 | + -w $(pwd) \ |
| 52 | + quay.io/hybridcloudpatterns/imperative-container:latest sh |
37 | 53 | ``` |
38 | 54 |
|
39 | | -## Build the image |
40 | | -Just run: `make build` and both amd64 and arm64 will be built locally (you will need the qemu-user-static package installed) |
| 55 | +**Execute an Ansible playbook** |
| 56 | + |
| 57 | +```bash |
| 58 | +podman run --rm -it --net=host \ |
| 59 | + --security-opt label=disable \ |
| 60 | + -v ${HOME}:/pattern \ |
| 61 | + -v ${HOME}:${HOME} \ |
| 62 | + -w $(pwd) \ |
| 63 | + quay.io/hybridcloudpatterns/imperative-container:latest \ |
| 64 | + ansible-playbook <playbook>.yml |
| 65 | +``` |
| 66 | + |
| 67 | +## Troubleshooting |
| 68 | + |
| 69 | +**Permission issues with volume mounts** |
| 70 | +- Ensure the `--security-opt label=disable` flag is used when running the container. |
| 71 | +- Check that your user has read/write access to the mounted directories. |
| 72 | + |
| 73 | +**Network connectivity issues** |
| 74 | +- Use `--net=host` for full network access. |
| 75 | +- For restricted environments, configure appropriate network policies. |
| 76 | + |
| 77 | +**Missing tools or outdated versions** |
| 78 | +- Check the installed software table above for current versions. |
| 79 | +- Consider building a custom image if you need different tool versions. |
| 80 | + |
| 81 | +## Development |
| 82 | + |
| 83 | +### Build the Image |
| 84 | + |
| 85 | +Run `make build` to build both amd64 and arm64 architectures locally (requires qemu-user-static package). |
| 86 | + |
| 87 | +### Upload to Registry |
| 88 | + |
| 89 | +Run `make upload` to push the image to the official repository. |
41 | 90 |
|
42 | | -To upload the image to the official repository, run: `make UPLOADREGISTRY=quay.io/hybridcloudpatterns upload` (by default it uploads somewhere else |
43 | | -to try and avoid accidental uploads) |
| 91 | +### Contributing |
44 | 92 |
|
| 93 | +To update software versions or add new tools, modify the Containerfile and update the software table in this readme. Use `make versions` to generate the software versions table from the container after building locally. |
0 commit comments