From be3cf49129e81a9088283c4f01f58bc16a248b52 Mon Sep 17 00:00:00 2001 From: ByeonJungHun Date: Tue, 5 Sep 2023 15:11:46 +0900 Subject: [PATCH] Add images registry change --- .../02-base/base/charts/cortex/values.yaml | 8 ++-- .../02-base/base/charts/rabbitmq/values.yaml | 4 +- .../02-base/base/charts/redis/values.yaml | 10 ++-- .../files/02-base/base/values.yaml | 4 +- .../cmoa_install/tasks/01-storage-install.yml | 14 +++--- roles/cmoa_install/tasks/02-base-install.yml | 28 +++++++---- .../tasks/04-keycloak-install.yml | 46 ++++++++++--------- roles/cmoa_install/tasks/05-imxc-install.yml | 10 ++-- .../cmoa_install/tasks/06-imxc-ui-install.yml | 10 ++-- 9 files changed, 72 insertions(+), 62 deletions(-) diff --git a/roles/cmoa_install/files/02-base/base/charts/cortex/values.yaml b/roles/cmoa_install/files/02-base/base/charts/cortex/values.yaml index 4a0f8c8..1695d69 100644 --- a/roles/cmoa_install/files/02-base/base/charts/cortex/values.yaml +++ b/roles/cmoa_install/files/02-base/base/charts/cortex/values.yaml @@ -1,6 +1,6 @@ image: #repository: quay.io/cortexproject/cortex - repository: 10.10.31.243:5000/cmoa3/cortex + repository: 0.0.0.0/cmoa3/cortex # -- Allows you to override the cortex version in this chart. Use at your own risk. #tag: "" tag: v1.11.0 @@ -334,7 +334,7 @@ alertmanager: # -- Sidecars that collect the configmaps with specified label and stores the included files them into the respective folders sidecar: image: - repository: 10.10.31.243:5000/cmoa3/k8s-sidecar + repository: 0.0.0.0/cmoa3/k8s-sidecar tag: 1.10.7 sha: "" imagePullPolicy: IfNotPresent @@ -701,7 +701,7 @@ ruler: # -- Sidecars that collect the configmaps with specified label and stores the included files them into the respective folders sidecar: image: - repository: 10.10.31.243:5000/cmoa3/k8s-sidecar + repository: 0.0.0.0/cmoa3/k8s-sidecar tag: 1.10.7 sha: "" imagePullPolicy: IfNotPresent @@ -1126,7 +1126,7 @@ nginx: basicAuthSecretName: "" image: - repository: 10.10.31.243:5000/cmoa3/nginx + repository: 0.0.0.0/cmoa3/nginx tag: 1.21 pullPolicy: IfNotPresent diff --git a/roles/cmoa_install/files/02-base/base/charts/rabbitmq/values.yaml b/roles/cmoa_install/files/02-base/base/charts/rabbitmq/values.yaml index 5b74e6c..27705b1 100644 --- a/roles/cmoa_install/files/02-base/base/charts/rabbitmq/values.yaml +++ b/roles/cmoa_install/files/02-base/base/charts/rabbitmq/values.yaml @@ -18,7 +18,7 @@ ## @param image.debug Set to true if you would like to see extra information on logs ## image: - registry: 10.10.31.243:5000/cmoa3 + registry: 0.0.0.0/cmoa3 repository: rabbitmq tag: v1.0.0 # {{ .Values.global.RABBITMQ_VERSION }} @@ -1113,7 +1113,7 @@ volumePermissions: ## @param volumePermissions.image.pullSecrets Specify docker-registry secret names as an array ## image: - registry: 10.10.31.243:5000/cmoa3 # docker.io + registry: 0.0.0.0/cmoa3 # docker.io repository: bitnami-shell # bitnami/bitnami-shell tag: 10-debian-10-r175 ## Specify a imagePullPolicy diff --git a/roles/cmoa_install/files/02-base/base/charts/redis/values.yaml b/roles/cmoa_install/files/02-base/base/charts/redis/values.yaml index fcd8710..98a42c7 100644 --- a/roles/cmoa_install/files/02-base/base/charts/redis/values.yaml +++ b/roles/cmoa_install/files/02-base/base/charts/redis/values.yaml @@ -13,7 +13,7 @@ global: ## ref: https://hub.docker.com/r/bitnami/redis/tags/ ## image: - registry: 10.10.31.243:5000/cmoa3 + registry: 0.0.0.0/cmoa3 repository: redis ## Bitnami Redis(TM) image tag ## ref: https://github.com/bitnami/bitnami-docker-redis#supported-tags-and-respective-dockerfile-links @@ -60,7 +60,7 @@ sentinel: ## image: #registry: docker.io - registry: 10.10.31.243:5000 + registry: 0.0.0.0 repository: bitnami/redis-sentinel ## Bitnami Redis(TM) image tag ## ref: https://github.com/bitnami/bitnami-docker-redis-sentinel#supported-tags-and-respective-dockerfile-links @@ -726,7 +726,7 @@ metrics: # enabled: true image: - registry: 10.10.31.243:5000 # registry.cloud.intermax:5000 + registry: 0.0.0.0 # registry.cloud.intermax:5000 repository: redis/redis-exporter #tag: 1.15.1-debian-10-r2 tag: latest @@ -855,7 +855,7 @@ metrics: volumePermissions: enabled: false image: - registry: 10.10.31.243:5000 # docker.io + registry: 0.0.0.0 # docker.io repository: minideb # bitnami/minideb tag: buster pullPolicy: Always @@ -898,7 +898,7 @@ configmap: |- sysctlImage: enabled: false command: [] - registry: 10.10.31.243:5000 # docker.io + registry: 0.0.0.0 # docker.io repository: minideb # bitnami/minideb tag: buster pullPolicy: Always diff --git a/roles/cmoa_install/files/02-base/base/values.yaml b/roles/cmoa_install/files/02-base/base/values.yaml index e2ad288..efee8d9 100644 --- a/roles/cmoa_install/files/02-base/base/values.yaml +++ b/roles/cmoa_install/files/02-base/base/values.yaml @@ -65,9 +65,9 @@ global: #CONSUL_VERSION: 0.7.1 # 레지스트리 변수화 (Public Cloud 대비 / 아래 값 적절히 수정해서 사용할 것) - IMXC_IN_REGISTRY: 10.10.31.243:5000/cmoa3 + IMXC_IN_REGISTRY: 10.10.43.230:5000/cmoa3 rabbitmq: image: - registry: 10.10.31.243:5000/cmoa3 # {{ .Values.global.IMXC_REGISTRY }} + registry: 10.10.43.230:5000/cmoa3 # {{ .Values.global.IMXC_REGISTRY }} tag: v1.0.0 # {{ .Values.global.RABBITMQ_VERSION }} diff --git a/roles/cmoa_install/tasks/01-storage-install.yml b/roles/cmoa_install/tasks/01-storage-install.yml index d63452f..7c34969 100644 --- a/roles/cmoa_install/tasks/01-storage-install.yml +++ b/roles/cmoa_install/tasks/01-storage-install.yml @@ -18,13 +18,13 @@ release_state: present values_files: - "{{ role_path }}/files/01-storage/{{item}}/values.yaml" - #values: - # image: - # repository: "{{ REGISTRY }}/cmoa3/minio" - # imagePullSecrets: - # - name: "{{ PullSecret }}" - # mcImage: - # repository: "{{ REGISTRY }}/cmoa3/mc" + values: + image: + repository: "{{ REGISTRY }}/cmoa3/minio" + imagePullSecrets: + - name: "{{ PullSecret }}" + mcImage: + repository: "{{ REGISTRY }}/cmoa3/mc" with_items: - minio diff --git a/roles/cmoa_install/tasks/02-base-install.yml b/roles/cmoa_install/tasks/02-base-install.yml index bb48d29..11515c0 100644 --- a/roles/cmoa_install/tasks/02-base-install.yml +++ b/roles/cmoa_install/tasks/02-base-install.yml @@ -17,7 +17,14 @@ with_items: - 01-coredns.yaml -- name: 3. helmchart install (base) +- name: 3. Change Registry Address + command: "sed -i 's/0.0.0.0/{{ REGISTRY }}/g' {{ role_path }}/files/02-base/base/charts/{{ item }}/values.yaml" + with_items: + - cortex + - rabbitmq + - redis + +- name: 4. helmchart install (base) kubernetes.core.helm: name: "{{item}}" release_name: "{{item}}" @@ -27,19 +34,13 @@ release_state: present values_files: - "{{ role_path }}/files/02-base/{{item}}/values.yaml" - #values: - # global: - # IMXC_IN_REGISTRY: "{{ REGISTRY }}/cmoa3" - # rabbitmq: - # image: - # registry: "{{ REGISTRY }}/cmoa3" with_items: - base -- name: 4. Check Kubernetes Pods (base) +- name: 5. Check Kubernetes Pods (base) command: "{{ role_path }}/files/k8s_status {{ cmoa_namespace }} alertmanage" -- name: 5. Change a Elasticsearch Service (NodePort=elasticsearch_nodePort) +- name: 6. Change a Elasticsearch Service (NodePort=elasticsearch_nodePort) kubernetes.core.k8s: state: present definition: @@ -56,7 +57,7 @@ nodePort: "{{ elasticsearch_nodePort }}" apply: yes -- name: 6. Change a Postgres Service (NodePort=postgres_nodePort) +- name: 7. Change a Postgres Service (NodePort=postgres_nodePort) kubernetes.core.k8s: state: present definition: @@ -72,3 +73,10 @@ port: "{{ postgres_service_port }}" nodePort: "{{ postgres_nodePort }}" apply: yes + +- name: 8. Change Registry Address - origin + command: "sed -i 's/{{ REGISTRY }}/0.0.0.0/g' {{ role_path }}/files/02-base/base/charts/{{ item }}/values.yaml" + with_items: + - cortex + - rabbitmq + - redis diff --git a/roles/cmoa_install/tasks/04-keycloak-install.yml b/roles/cmoa_install/tasks/04-keycloak-install.yml index 95fbef0..2d12338 100644 --- a/roles/cmoa_install/tasks/04-keycloak-install.yml +++ b/roles/cmoa_install/tasks/04-keycloak-install.yml @@ -9,28 +9,30 @@ release_state: present values_files: - "{{ role_path }}/files/04-keycloak/values.yaml" - #values: - # image: - # repository: "{{ REGISTRY }}/cmoa3/keycloak" - # imagePullSecrets: - # - name: "{{ PullSecret }}" - # extraInitContainers: | - # - name: theme-provider - # image: "{{ REGISTRY }}/cmoa3/theme-provider:latest" - # imagePullPolicy: IfNotPresent - # command: - # - sh - # args: - # - -c - # - | - # echo "Copying theme ..." - # cp -R /mytheme/* /theme - # pgchecker: - # image: - # repository: "{{ REGISTRY }}/cmoa3/busybox" - #volumeMounts: - # - name: theme - # mountPath: /theme + values: + image: + repository: "{{ REGISTRY }}/cmoa3/keycloak" + imagePullSecrets: + - name: "{{ PullSecret }}" + extraInitContainers: | + - name: theme-provider + image: "{{ REGISTRY }}/cmoa3/theme-provider:latest" + imagePullPolicy: IfNotPresent + command: + - sh + args: + - -c + - | + echo "Copying theme ..." + cp -R /mytheme/* /theme + volumeMounts: + - name: theme + mountPath: /theme + pgchecker: + image: + repository: "{{ REGISTRY }}/cmoa3/busybox" + tag: 1.32 + pullPolicy: Always with_items: - keycloak diff --git a/roles/cmoa_install/tasks/05-imxc-install.yml b/roles/cmoa_install/tasks/05-imxc-install.yml index af16c29..fd8f835 100644 --- a/roles/cmoa_install/tasks/05-imxc-install.yml +++ b/roles/cmoa_install/tasks/05-imxc-install.yml @@ -9,11 +9,11 @@ release_state: present values_files: - "{{ role_path }}/files/05-imxc/values.yaml" - #values: - # image: - # repository: "{{ REGISTRY }}/cmoa3/nginx" - # global: - # IMXC_IN_REGISTRY: "{{ REGISTRY }}/cmoa3" + values: + image: + repository: "{{ REGISTRY }}/cmoa3/nginx" + global: + IMXC_IN_REGISTRY: "{{ REGISTRY }}/cmoa3" with_items: - imxc diff --git a/roles/cmoa_install/tasks/06-imxc-ui-install.yml b/roles/cmoa_install/tasks/06-imxc-ui-install.yml index 9a2f4cd..52c1cdf 100644 --- a/roles/cmoa_install/tasks/06-imxc-ui-install.yml +++ b/roles/cmoa_install/tasks/06-imxc-ui-install.yml @@ -9,11 +9,11 @@ release_state: present values_files: - "{{ role_path }}/files/06-imxc-ui/{{ item }}/values.yaml" - #values: - # image: - # repository: "{{ REGISTRY }}/cmoa3/nginx" - # global: - # IMXC_IN_REGISTRY: "{{ REGISTRY }}/cmoa3" + values: + image: + repository: "{{ REGISTRY }}/cmoa3/nginx" + global: + IMXC_IN_REGISTRY: "{{ REGISTRY }}/cmoa3" with_items: - imxc-ui ignore_errors: true