Browse Source

Refactor various components to utilize oreg_url

This commit converts more components to use oreg_url
by default.
Michael Gugino 6 năm trước cách đây
mục cha
commit
8e02233b0c

+ 0 - 6
inventory/hosts.example

@@ -659,12 +659,6 @@ debug_level=2
 # Configure the number of elastic search nodes, unless you're using dynamic provisioning
 # this value must be 1
 #openshift_logging_es_cluster_size=1
-# Configure the prefix and version for the component images
-#openshift_logging_image_prefix=docker.io/openshift/origin-
-#openshift_logging_image_version=v3.9.0
-# when openshift_deployment_type=='openshift-enterprise'
-#openshift_logging_image_prefix=registry.access.redhat.com/openshift3/
-#openshift_logging_image_version=3.9.0
 
 # Prometheus deployment
 #

+ 7 - 3
roles/openshift_descheduler/defaults/main.yaml

@@ -7,15 +7,19 @@ openshift_descheduler_delete_config: true
 # descheduler image setup
 openshift_descheduler_image_dict:
   origin:
-    prefix: "docker.io/openshift/"
+    search: "origin-${version}"
     version: v0.5.0
   openshift-enterprise:
-    prefix: "registry.access.redhat.com/openshift3/ose-"
+    search: "${version}"
     version: "{{ openshift_image_tag }}"
 
-openshift_descheduler_image_prefix: "{{ openshift_descheduler_image_dict[openshift_deployment_type]['prefix'] }}"
+l_os_descheduler_image_search: "{{ openshift_descheduler_image_dict[openshift_deployment_type]['search'] }}"
 openshift_descheduler_image_version: "{{ openshift_descheduler_image_dict[openshift_deployment_type]['version'] }}"
 
+l_os_non_standard_reg_url: "{{ oreg_url | default(l_osm_registry_url_default) }}"
+l_os_descheduler_image: "{{ l_os_non_standard_reg_url | regex_replace('${version}' | regex_escape, l_os_logging_proxy_image_version) }}"
+openshift_descheduler_image: "{{ l_os_descheduler_image | regex_replace(l_os_descheduler_image_search | regex_escape, 'descheduler') }}"
+
 # descheduler service account setup
 openshift_descheduler_service_account: descheduler-sa
 

+ 1 - 1
roles/openshift_descheduler/templates/descheduler-cronjob.yaml.j2

@@ -15,7 +15,7 @@ spec:
         spec:
           containers:
           - name: descheduler
-            image: "{{ openshift_descheduler_image_prefix }}descheduler:{{ openshift_descheduler_image_version }}"
+            image: "{{ openshift_descheduler_image }}"
             volumeMounts:
             - mountPath: /policy-dir
               name: policy-volume

+ 9 - 8
roles/openshift_docker_gc/defaults/main.yml

@@ -3,12 +3,13 @@ r_enable_docker_gc: "{{ openshift_crio_enable_docker_gc | default(True) }}"
 r_docker_gc_node_selectors: "{{ openshift_crio_docker_gc_node_selector | default({'runtime': 'cri-o'}) }}"
 
 openshift_docker_gc_image_dict:
-  origin:
-    image: "openshift/origin"
-    version: "{{ openshift_image_tag }}"
-  openshift-enterprise:
-    image: "openshift3/ose"
-    version: "{{ openshift_image_tag }}"
+  origin: "origin"
+  openshift-enterprise: "ose"
 
-openshift_docker_gc_image: "{{ openshift_docker_gc_image_dict[openshift_deployment_type]['image'] }}"
-openshift_docker_gc_version: "{{ openshift_docker_gc_image_dict[openshift_deployment_type]['version'] }}"
+l_os_dockergc_reg_search_dict:
+  origin: "origin-${component}"
+  openshift-enterprise: "ose-${component}"
+l_os_dockergc_reg_search: "{{ l_os_dockergc_reg_search_dict[openshift_deployment_type] }}"
+l_os_dockergc_replace: "{{ openshift_docker_gc_image_dict[openshift_deployment_type] }}"
+
+openshift_docker_gc_image: "{{ l_os_registry_url | regex_replace(l_openshift_logging_search | regex_escape, l_os_dockergc_replace) }}"

+ 1 - 1
roles/openshift_docker_gc/templates/dockergc-ds.yaml.j2

@@ -28,7 +28,7 @@ items:
 
         serviceAccountName: dockergc
         containers:
-        - image: {{ openshift_docker_gc_image }}:{{ openshift_docker_gc_version }}
+        - image: {{ openshift_docker_gc_image }}
           command:
           - "/usr/bin/oc"
           args: