Skip to content

Commit

Permalink
migrate to oc-mirror v2
Browse files Browse the repository at this point in the history
  • Loading branch information
karmab committed Jan 28, 2025
1 parent c45383b commit b00dfde
Show file tree
Hide file tree
Showing 16 changed files with 176 additions and 346 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Note that you can use the baseplan `kcli_plan_infra.yml` to deploy the infrastru
|disconnected_community_operators_version |None |
|disconnected_extra_catalogs |[] |
|disconnected_extra_images |[] |
|disconnected_extra_releases |[] |
|disconnected_extra_release |None |
|disconnected_marketplace_operators |[] |
|disconnected_marketplace_operators_version |None |
|disconnected_operators |[] |
Expand All @@ -128,7 +128,6 @@ Note that you can use the baseplan `kcli_plan_infra.yml` to deploy the infrastru
|go_version |1.13.8 |
|http_proxy |None |
|image |centos9stream |
|imagecontentsources |[] |
|imageregistry |False |
|installer_disk_size |None |
|installer_ip |None |
Expand All @@ -141,7 +140,6 @@ Note that you can use the baseplan `kcli_plan_infra.yml` to deploy the infrastru
|manifests_dir |manifests |
|monitoring_retention |None |
|motd |None |
|nbde |False |
|network_type |OVNKubernetes |
|nfs |False |
|no_proxy |None |
Expand Down
12 changes: 7 additions & 5 deletions install-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@ additionalTrustBundle: |
{{ ca | certificate | replace('\n', '\n ') }}
{% endfor %}
{% endif %}
{% if imagecontentsources %}
{% if disconnected or disconnected_url != None %}
imageContentSources:
{% for source in imagecontentsources %}
- mirrors:
- {{ source }}
source: image-registry.openshift-image-registry.svc:5000/openshift/{{ source | basename | replace("openshift-", "")}}
{% endfor %}
- REGISTRY:PORT/openshift-release-dev/ocp-v4.0-art-dev
- REGISTRY:PORT/openshift/release
source: quay.io/openshift-release-dev/ocp-v4.0-art-dev
- mirrors:
- REGISTRY:PORT/openshift-release-dev
source: {{ 'registry.ci.openshift.org/ocp/release' if version == 'ci' else 'quay.io/openshift-release-dev' }}
{% endif %}
69 changes: 36 additions & 33 deletions scripts/mirror-config.yaml.sample → mirror-config.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,38 @@
apiVersion: mirror.openshift.io/v1alpha2
{% set release = '4.' + (tag|string).split('.')[1] if tag|count('.') > 1 else tag %}

apiVersion: mirror.openshift.io/v2alpha1
kind: ImageSetConfiguration
storageConfig:
registry:
imageURL: $LOCAL_REGISTRY/openshift/release/metadata:latest
mirror:
#platform:
# channels:
# - name: stable-4.10
# minVersion: 4.10.24
# maxVersion: 4.10.24
# graph: true
platform:
graph: false
{% if version in ['ci', 'nightly'] %}
release: registry.ci.openshift.org/ocp/release:{{ tag }}
{% else %}
channels:
- name: {{ 'candidate' if 'rc' in tag else version }}-{{ release }}
{% if tag|count('.') > 1 %}
minVersion: {{ (disconnected_extra_release or tag)|min_ocp_version(tag) }}
maxVersion: {{ (disconnected_extra_release or tag)|max_ocp_version(tag) }}
{% endif %}
{% endif %}
architectures:
# - multi
- amd64
additionalImages:
{% for image in extra_images|default([]) %}
- name: {{ image }}
{% endfor %}
{% set operators = disconnected_operators|default([]) + disconnected_certified_operators|default([]) + disconnected_community_operators|default([]) + disconnected_marketplace_operators|default([]) %}
{% if operators %}
operators:
{% if disconnected_operators %}
{% set catalog = 'quay.io/prega/prega-operator-index' if prega else 'registry.redhat.io/redhat/redhat-operator-index' %}
- catalog: {{ catalog }}:{{ disconnected_operators_version or 'v${OCP_RELEASE}' }}
{% if disconnected_operators|default([]) %}
{% set catalog = 'quay.io/prega/prega-operator-index' if prega|default(False) else 'registry.redhat.io/redhat/redhat-operator-index' %}
- catalog: {{ catalog }}:{{ disconnected_operators_version or "v%s" % OPENSHIFT_TAG }}
packages:
{% for package in disconnected_operators %}
{% if package.name is defined %}
- name: {{ package.name }}
{% else %}
{% else %}{# Comment: Support old syntax #}
- name: {{ package }}
{% endif %}
{% if package.minVersion is defined %}
Expand All @@ -41,12 +55,8 @@ mirror:
{% endif %}
{% endfor %}
{% endif %}
{% if disconnected_certified_operators %}
{% if disconnected_certified_operators_version %}
- catalog: registry.redhat.io/redhat/certified-operator-index:{{ disconnected_certified_operators_version }}
{% else %}
- catalog: registry.redhat.io/redhat/certified-operator-index:v${OCP_RELEASE}
{% endif %}
{% if disconnected_certified_operators|default([]) %}
- catalog: registry.redhat.io/redhat/certified-operator-index:{{ disconnected_certified_operators_version or "v%s" % OPENSHIFT_TAG }}
packages:
{% for package in disconnected_certified_operators %}
{% if package.name is defined %}
Expand Down Expand Up @@ -74,12 +84,8 @@ mirror:
{% endif %}
{% endfor %}
{% endif %}
{% if disconnected_community_operators %}
{% if disconnected_community_operators_version %}
- catalog: registry.redhat.io/redhat/community-operator-index:{{ disconnected_community_operators_version }}
{% else %}
- catalog: registry.redhat.io/redhat/community-operator-index:v${OCP_RELEASE}
{% endif %}
{% if disconnected_community_operators|default([]) %}
- catalog: registry.redhat.io/redhat/community-operator-index:{{ disconnected_community_operators_version or "v%s" % OPENSHIFT_TAG }}
packages:
{% for package in disconnected_community_operators %}
{% if package.name is defined %}
Expand Down Expand Up @@ -107,12 +113,8 @@ mirror:
{% endif %}
{% endfor %}
{% endif %}
{% if disconnected_marketplace_operators %}
{% if disconnected_marketplace_operators_version %}
- catalog: registry.redhat.io/redhat/redhat-marketplace-index:{{ disconnected_marketplace_operators_version }}
{% else %}
- catalog: registry.redhat.io/redhat/redhat-marketplace-index:v${OCP_RELEASE}
{% endif %}
{% if disconnected_marketplace_operators|default([]) %}
- catalog: registry.redhat.io/redhat/redhat-marketplace-index:{{ disconnected_marketplace_operators_version or "v%s" % OPENSHIFT_TAG }}
packages:
{% for package in disconnected_marketplace_operators %}
{% if package.name is defined %}
Expand Down Expand Up @@ -140,7 +142,8 @@ mirror:
{% endif %}
{% endfor %}
{% endif %}
{% if disconnected_extra_catalogs %}
{% endif %}
{% if disconnected_extra_catalogs|default([]) %}
{% for catalog_image in disconnected_extra_catalogs %}
- catalog: {{ catalog_image }}
{% endfor %}
Expand Down
28 changes: 0 additions & 28 deletions mirror-registry/quay_haproxy.cfg

This file was deleted.

29 changes: 0 additions & 29 deletions mirror-registry/quay_haproxy.service

This file was deleted.

5 changes: 4 additions & 1 deletion plans/kcli_plan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@
path: /root/ocp/auth/kubeconfig
{% endif %}
- agent-config.yaml
- install-config.yaml
- install-config.yaml
{% if disconnected or disconnected_url != None %}
- mirror-config.yaml
{% endif %}
{% if motd != None %}
- path: /etc/motd
origin: {{ motd }}
Expand Down
8 changes: 4 additions & 4 deletions plans/kcli_plan_default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ info: |
api_ip and ingress_ip need to be set along with ctlplanes and workers array to specify your nodes.
Nfs can be set to true to deploy nfs provisioner using a share on the installer vm
default network type is OVNKubernetes but you can also specify OpenShiftSDN
You can also use ca and imagecontentsources to customize your environments or drop specific manifests in the manifests directory
You can also use ca or drop specific manifests in the manifests directory
If using virtual ctlplanes, the ctlplanes array can be omitted.
For virtual hub, You can force the mac of your ctlplanes and workers
version can be set to stable, nightly, candidate or ci, along with tag, to gather the binary from public sources.
Expand Down Expand Up @@ -50,6 +50,7 @@ registry_image: quay.io/karmab/registry:amd64
disconnected_user: dummy
disconnected_password: dummy
disconnected_url:
disconnected_update: false
disconnected_operators: []
disconnected_certified_operators: []
disconnected_community_operators: []
Expand All @@ -60,18 +61,16 @@ disconnected_community_operators_version:
disconnected_marketplace_operators_version:
disconnected_extra_images: []
disconnected_extra_catalogs: []
disconnected_extra_releases: []
disconnected_extra_release:
disconnected_clean_pull_secret: false
prega: false
nfs: false
imageregistry: false
go_version: 1.13.8
prs: []
imagecontentsources: []
fips: false
cas: []
dns: false
nbde: false
ntp: false
ntp_server: 0.rhel.pool.ntp.org
apps: []
Expand All @@ -90,6 +89,7 @@ wait_for_workers_number:
wait_for_workers_timeout: 3600
manifests_dir: manifests
workflow_installer: false
OPENSHIFT_TAG: 4.17

acm: true
gitops_user: dummy
Expand Down
3 changes: 1 addition & 2 deletions scripts/02_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
set -euo pipefail

dnf -y copr enable karmab/kcli
dnf -y copr enable karmab/aicli
dnf -y install libvirt-libs libvirt-client mkisofs tmux make git bash-completion vim-enhanced nmstate python3 podman skopeo httpd bind-utils kcli aicli net-tools
dnf -y install libvirt-libs libvirt-client mkisofs tmux make git bash-completion vim-enhanced nmstate python3 podman skopeo httpd bind-utils kcli net-tools

systemctl enable --now httpd

Expand Down
91 changes: 0 additions & 91 deletions scripts/04_disconnected_mirror.sh

This file was deleted.

Loading

0 comments on commit b00dfde

Please sign in to comment.