Skip to content

Commit

Permalink
Merge pull request #1200 from timflannagan1/use-ansible-2.9.5-max
Browse files Browse the repository at this point in the history
Bug 1829836: Fix performance issues when deploying Metering on Ansible 2.9.6+ versions.
  • Loading branch information
openshift-merge-robot committed May 1, 2020
2 parents 6a1c07d + f578925 commit 6f2470e
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 19 deletions.
3 changes: 1 addition & 2 deletions Dockerfile.metering-ansible-operator
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ RUN ln -f -s /tini /usr/bin/tini
# 1. botocore and boto3 are used by the aws-related modules (aws_s3)
# 2. netaddr is needed to use the ipv4/ipv6 jinja filter
# 3. cryptography is used by the openssl_* modules for TLS/authentication purposes
RUN pip install --no-cache-dir --upgrade openshift botocore boto3 cryptography netaddr
RUN pip install --upgrade ansible==2.8
RUN pip install --no-cache-dir --upgrade ansible~=2.9 openshift botocore boto3 cryptography netaddr

ENV HOME /opt/ansible
ENV HELM_CHART_PATH ${HOME}/charts/openshift-metering
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.metering-ansible-operator.rhel
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM openshift/ose-metering-helm:latest as helm
# final image needs kubectl, so we copy `oc` from cli image to use as kubectl.
FROM openshift/ose-cli:latest as cli
# real base
FROM openshift/ose-ansible-operator:latest
FROM openshift/ose-ansible-operator:4.5

USER root
RUN set -x; INSTALL_PKGS="curl bash ca-certificates less which inotify-tools tini python-netaddr python2-botocore python2-boto3 python2-openshift python2-cryptography openssl" \
Expand All @@ -16,7 +16,7 @@ COPY --from=helm /usr/local/bin/helm /usr/local/bin/helm
COPY --from=cli /usr/bin/oc /usr/bin/oc
RUN ln -f -s /usr/bin/oc /usr/bin/kubectl

RUN yum -y update python2-openshift python2-cryptography
RUN yum -y update python2-openshift python2-cryptography ansible~=2.9

ENV HOME /opt/ansible
ENV HELM_CHART_PATH ${HOME}/charts/openshift-metering
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
- name: Check for the existence of Hive TLS-related secrets
block:
- name: Check for the existence of the Hive Metastore TLS secret
k8s_facts:
k8s_info:
api_version: v1
kind: Secret
name: "{{ meteringconfig_spec.hive.spec.metastore.config.tls.secretName }}"
Expand All @@ -22,7 +22,7 @@
register: hive_metastore_tls_buf

- name: Check for the existence of the Hive Server Metastore TLS secret
k8s_facts:
k8s_info:
api_version: v1
kind: Secret
name: "{{ meteringconfig_spec.hive.spec.server.config.metastoreTLS.secretName }}"
Expand All @@ -31,7 +31,7 @@
register: hive_server_client_tls_buf

- name: Check for the existence of the Hive Server TLS secret
k8s_facts:
k8s_info:
api_version: v1
kind: Secret
name: "{{ meteringconfig_spec.hive.spec.server.config.tls.secretName }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Get the Openshift cluster's networking config object
- name: Check the IP version infrastructure provisioned
k8s_facts:
k8s_info:
api_version: "config.openshift.io/v1"
kind: Network
name: cluster
Expand Down Expand Up @@ -31,7 +31,7 @@
# Cluster Proxy Configuration
#
- name: Check if the cluster-wide Proxy configured
k8s_facts:
k8s_info:
api_version: "config.openshift.io/v1"
kind: Proxy
name: cluster
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
- name: Check for the existence of Presto TLS-related secrets
block:
- name: Check for the existence of the Presto TLS secret
k8s_facts:
k8s_info:
api_version: v1
kind: Secret
name: "{{ meteringconfig_spec.presto.spec.config.tls.secretName }}"
Expand All @@ -22,7 +22,7 @@
register: presto_secret_tls_buf

- name: Check for the existence of the Presto Auth secret
k8s_facts:
k8s_info:
api_version: v1
kind: Secret
name: "{{ meteringconfig_spec.presto.spec.config.auth.secretName }}"
Expand All @@ -31,7 +31,7 @@
register: presto_secret_auth_buf

- name: Check for the existence of the Presto-Hive client TLS secret
k8s_facts:
k8s_info:
api_version: v1
kind: Secret
name: "{{ meteringconfig_spec.presto.spec.config.connectors.hive.tls.secretName }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- name: Check for the existence of the reporting-operator Presto TLS-related secrets
block:
- name: Check for the existence of the reporting-operator Presto client auth secret
k8s_facts:
k8s_info:
api_version: v1
kind: Secret
name: "{{ meteringconfig_spec['reporting-operator'].spec.config.presto.auth.secretName }}"
Expand Down Expand Up @@ -52,7 +52,7 @@
- name: Check for the existence of reporting-operator Hive TLS-related secrets
block:
- name: Check for the existence of the reporting-operator Hive client auth secret
k8s_facts:
k8s_info:
api_version: v1
kind: Secret
name: "{{ meteringconfig_spec['reporting-operator'].spec.config.hive.auth.secretName }}"
Expand Down Expand Up @@ -92,7 +92,7 @@
- name: Check for the existence of reporting-operator authProxy-related secret data
block:
- name: Check for the existence of the reporting-operator authProxy cookie seed secret
k8s_facts:
k8s_info:
api_version: v1
kind: Secret
name: "{{ meteringconfig_spec['reporting-operator'].spec.authProxy.cookie.secretName }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- name: Check for the existence of the Metering Root CA secret
block:
- name: Check if Root CA secret already exists
k8s_facts:
k8s_info:
api_version: v1
kind: Secret
name: "{{ meteringconfig_spec.tls.secretName }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
when: meteringconfig_storage_s3_create_bucket

- name: Attempt to obtain the AWS credentials secret in the "{{ meta.namespace}}" namespace
k8s_facts:
k8s_info:
api_version: v1
kind: Secret
name: "{{ meteringconfig_storage_s3_aws_credentials_secret_name }}"
Expand Down Expand Up @@ -114,7 +114,7 @@
- name: Get azure storage account name
block:
- name: Get Azure storage credentials secret
k8s_facts:
k8s_info:
api_version: v1
kind: Secret
name: "{{ meteringconfig_spec.storage.hive.azure.secretName }}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---

- name: Query for {{ resource.apis | map(attribute='kind') | join(', ') }} resources with selector {{ label_selector }} to delete
k8s_facts:
k8s_info:
api_version: "{{ to_delete_item.api_version | default(omit) }}"
kind: "{{ to_delete_item.kind }}"
namespace: "{{ namespace }}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
---

- name: Finalize the set of meteringconfig default values
set_fact:
meteringconfig_default_values: "{{ meteringconfig_default_values }}"

- name: Validate Configurations
include_tasks: validate.yml

Expand Down

0 comments on commit 6f2470e

Please sign in to comment.