This playbook is designed to create a data folder for internal registry at the restricted network environment.
@bvaturi add youtube recording
-
Access: https://console.redhat.com/openshift/install/pull-secret and download a pull-secret.json file to
/tmp/pull-secret.jsonAlso do the next command and enter your credentials: sudo podman login registry.redhat.io
-
Make sure you have enough space available on the disk (more than 50GB) *** If you use partitions make sure /var have at least 5GB and other memory is at /
-
Make sure you have installed ansible-core and git:
yum install ansible-core git -y- Run:
sudo ansible-galaxy collection install community.crypto
sudo ansible-galaxy collection install containers.podman
sudo ansible-galaxy collection install community.general-
A nice way to find out your operator name" i. Login to your selcted registry (redhat op hub/comunity/etc) ii. Run the following command and edit the according variables.
podman run -itd -p 50051:50051 registry.redhat.io/redhat/<redhat/community/certified>-operator-index:v<major_ocp_version__example=4.9>
iii. Finding out the operator name:
grpcurl -plaintext localhost:50051 api.Registry/ListPackages | grep <operator name or the part you know with an *>
iiii. After this is done you can delete the regitsry pod that we created with the "$ podman // docker rm -f <pod name / pod id>"
-
Run the playbook as
root -
The playbook will create:
i. data_<operator_name>.tar.gz file at extfiles
ii. latest
ocbinary iii. latestopmbinary iv.grpcurlv.kubectliii. A
manifests_<operator_name>file at therundirectory (where you ran the playbook)
-
ocpver this is the parameter that define what openshift cluster version is needed, ie: v4.8
-
index_image Choose one of the following: redhat-operator/certified-operator/community-operator
-
un-tar the data.tar.gz
tar -zxvf data_<operator_name>.tar.gz -
start your local registry
-
create a softlink for local registry data file --> data_<operator_name>
-
restart the registry container
@bvaturi add youtube recording
- Now you have a registry with the data on it. please check:
curl -u admin:redhat -k https://${Local_registry}:5000/v2/_catalog You will see the output with all the images.
-
Please push the images to your artifactory / registry
-
change the image content policy and the catalog source to point to YOUR registry / artifactory
-
Apply the image content policy and the catalog from the manifest folder.
oc apply -f <the files> - V2 - In case the user of the automation wants to mirror multiple operators, generate each of them an index image so they will be decoupled when deployed on OCP