diff --git a/README.md b/README.md index eb4f846d..600f8948 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ This repository consists of additional ansible playbooks for the following: 1. Run e2e tests against an existing OCP4 cluster -1. Deploy Common Services 1. Run scale tests against an existing OCP4 cluster 1. Expose OCP internal image registry 1. Run alerts configuration diff --git a/examples/all.yaml b/examples/all.yaml index d8902bad..c367aa55 100644 --- a/examples/all.yaml +++ b/examples/all.yaml @@ -104,18 +104,6 @@ e2e_upgrade_image: "" golang_tarball: "https://dl.google.com/go/go1.12.17.linux-ppc64le.tar.gz" github_token: "" -## ocp-cs vars -cs_install: false -cs_setup_dir: ~/setup-files/cs-setup -cs_operator_name: ibm-common-service-operator -cs_operand_namespace: ibm-common-services -cs_operator_project_name: common-service -cs_subscription_channel: stable-v1 -cs_subscription_strategy: Automatic -cs_operator_catalog_image: "quay.io/opencloudio/ibm-common-service-catalog:latest" -cs_operand_list: ["ibm-cert-manager-operator","ibm-mongodb-operator","ibm-iam-operator","ibm-monitoring-exporters-operator","ibm-monitoring-prometheusext-operator","ibm-monitoring-grafana-operator","ibm-healthcheck-operator","ibm-management-ingress-operator","ibm-metering-operator","ibm-commonui-operator","ibm-ingress-nginx-operator","ibm-platform-api-operator"] -storageclass_name: nfs-storage-provisioner - ## ocp-scale vars scale_test_enabled: false scale_test_git: "https://github.com/RobertKrawitz/OpenShift4-tools.git" diff --git a/examples/cs_vars.yaml b/examples/cs_vars.yaml deleted file mode 100644 index a8413ff8..00000000 --- a/examples/cs_vars.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -#ocp-cs vars -cs_install: false #Set to true to enable Common Services playbook -cs_setup_dir: ~/setup-files/cs-setup #Setup directory path -cs_operator_name: ibm-common-service-operator #Name for operator subscription -cs_operand_namespace: ibm-common-services #Namespace for Common Services oprands -cs_operator_project_name: common-service #Namespace for installing Common Services operators -cs_subscription_channel: stable-v1 #Update channel for operator subscription -cs_subscription_strategy: Automatic #Approval stragergy for operator subscription -cs_operator_catalog_image: "quay.io/opencloudio/ibm-common-service-catalog:latest" #Catalog source image for IBM Common Services operators - -#List of Common Services Operators to install -cs_operand_list: ["ibm-cert-manager-operator","ibm-mongodb-operator","ibm-iam-operator","ibm-monitoring-exporters-operator","ibm-monitoring-prometheusext-operator","ibm-monitoring-grafana-operator","ibm-healthcheck-operator","ibm-management-ingress-operator","ibm-metering-operator","ibm-commonui-operator","ibm-ingress-nginx-operator","ibm-platform-api-operator"] -storageclass_name: nfs-storage-provisioner #StorageClass name - diff --git a/group_vars/all.yml b/group_vars/all.yml index 94b82fa9..d52c1857 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -4,9 +4,6 @@ e2e_tests_enabled: false e2e_upgrade_image: "" -## ocp-cs required vars -cs_install: false - ## ocp-scale required vars scale_test_enabled: false diff --git a/playbooks/main.yml b/playbooks/main.yml index 2fe7456c..eb04989b 100644 --- a/playbooks/main.yml +++ b/playbooks/main.yml @@ -1,7 +1,4 @@ --- -- import_playbook: ocp-cs.yml - when: cs_install - - import_playbook: ocp-scale.yml when: scale_test_enabled diff --git a/playbooks/ocp-cs.yml b/playbooks/ocp-cs.yml deleted file mode 100644 index f3aa9f28..00000000 --- a/playbooks/ocp-cs.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- name: Install common services - hosts: bastion - roles: - - ocp-cs - diff --git a/playbooks/roles/ocp-cs/README.md b/playbooks/roles/ocp-cs/README.md deleted file mode 100644 index 2d27cba4..00000000 --- a/playbooks/roles/ocp-cs/README.md +++ /dev/null @@ -1,48 +0,0 @@ -ocp-cs: Common Services on OCP -========= - -This module will install Common Services on OCP. Supported versions starting with 3.4 and above. - -Requirements ------------- - - - Running OCP 4.x cluster is needed. - -Role Variables --------------- - -| Variable | Required | Default | Comments | -|---------------------------|----------|------------------------------------|-----------------------------------------------------------| -| cs_setup_dir | no | ~/setup-files/cs-setup | Place for config generation of Common Services files | -| cs_operator_name | no | ibm-common-service-operator | Name for operator subscription | -| cs_operand_namespace | no | ibm-common-services | Namespace for Common Services oprands | -| cs_operator_project_name | no | common-service | Namespace to use for installing Common Services operators | -| cs_operator_catalog_image | no | quay.io/opencloudio/ibm-common-service-catalog:latest | Catalog source image for IBM Common Services operators | -| cs_subscription_channel | no | stable-v1 | Update channel for operator subscription | -| cs_subscription_strategy | no | Automatic | Approval stragergy for operator subscription | -| cs_operand_list | no | ["ibm-cert-manager-operator","ibm-mongodb-operator","ibm-iam-operator","ibm-monitoring-exporters-operator","ibm-monitoring-prometheusext-operator","ibm-monitoring-grafana-operator","ibm-healthcheck-operator","ibm-management-ingress-operator","ibm-metering-operator","ibm-commonui-operator","ibm-ingress-nginx-operator","ibm-platform-api-operator"] | List of Common Services Operators to install | -| storageclass_name | no | nfs-storage-provisioner | StorageClass name | - -Dependencies ------------- - - - None - -Example Playbook ----------------- - - - name: Install common services - hosts: bastion - roles: - - ocp-cs - -License -------- - -See LICENCE.txt - -Author Information ------------------- - -Prajyot Parab (prajyot.parab@ibm.com) - diff --git a/playbooks/roles/ocp-cs/defaults/main.yml b/playbooks/roles/ocp-cs/defaults/main.yml deleted file mode 100644 index 314364ab..00000000 --- a/playbooks/roles/ocp-cs/defaults/main.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- - -cs_setup_dir: ~/setup-files/cs-setup -cs_operator_name: ibm-common-service-operator -cs_operand_namespace: ibm-common-services -cs_operator_project_name: common-service -cs_subscription_channel: stable-v1 -cs_subscription_strategy: Automatic -cs_operator_catalog_image: "quay.io/opencloudio/ibm-common-service-catalog:latest" -cs_operand_list: ["ibm-cert-manager-operator","ibm-mongodb-operator","ibm-iam-operator","ibm-monitoring-exporters-operator","ibm-monitoring-prometheusext-operator","ibm-monitoring-grafana-operator","ibm-healthcheck-operator","ibm-management-ingress-operator","ibm-metering-operator","ibm-commonui-operator","ibm-ingress-nginx-operator","ibm-platform-api-operator"] -storageclass_name: nfs-storage-provisioner - diff --git a/playbooks/roles/ocp-cs/tasks/main.yml b/playbooks/roles/ocp-cs/tasks/main.yml deleted file mode 100644 index 80b5b9fc..00000000 --- a/playbooks/roles/ocp-cs/tasks/main.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -# tasks file for ocp4 common services - -- name: Create setup directory - file: - path: "{{ cs_setup_dir }}" - state: "{{ item }}" - mode: '0755' - with_items: - - absent - - directory - -- name: Generate config yaml files - template: - src: "{{ item }}.yaml.j2" - dest: "{{ cs_setup_dir }}/{{ item }}.yaml" - with_items: - - cs-group - - cs-request - - cs-sub - - catalog-source - -- name: Retrieve default StorageClass - shell: | - oc get storageclass | grep "(default)" | awk '{print $1}' - register: default_sc - -- name: Reset default StorageClass - when: default_sc.stdout|length|int > 0 - shell: | - oc patch storageclass {{ default_sc.stdout }} -p '{"metadata": {"annotations": {"storageclass.kubernetes.io/is-default-class": "false"}}}' - -- name: Making user specified StorageClass as default - shell: | - oc patch storageclass {{ storageclass_name }} -p '{"metadata": {"annotations": {"storageclass.kubernetes.io/is-default-class": "true"}}}' - -- name: Apply the CRDs - shell: | - oc apply -f catalog-source.yaml - oc new-project {{ cs_operator_project_name }} - oc -n {{ cs_operator_project_name }} apply -f cs-group.yaml - oc -n {{ cs_operator_project_name }} apply -f cs-sub.yaml - args: - chdir: "{{ cs_setup_dir }}" - -# The Operand Deployment Lifecycle Manager is not always available immediately -- name: Waiting for Operand Deployment Lifecycle Manager to complete - shell: "oc -n {{ cs_operator_project_name }} get csv --no-headers | grep operand-deployment-lifecycle-manager | grep Succeeded | wc -l" - register: operand_count - until: operand_count.stdout|int != 0 - retries: 10 - delay: 30 - -- name: Making sure CRD OperandRegistry is present - shell: "oc -n {{ cs_operand_namespace }} get operandregistry --no-headers | grep common-service | wc -l" - register: crdc_count - until: crdc_count.stdout|int == 1 - retries: 10 - delay: 30 - -- name: Deploy list of operands requested - shell: | - oc project {{ cs_operand_namespace }} - oc -n {{ cs_operand_namespace }} apply -f cs-request.yaml - args: - chdir: "{{ cs_setup_dir }}" - -- name: Waiting for all ClusterServiceVersion to initialize - shell: | - oc -n {{ cs_operand_namespace }} get csv --no-headers | grep -v 'operand-deployment-lifecycle-manager*' | wc -l - register: csvi_count - until: csvi_count.stdout|int >= cs_operand_list|unique|length|int - retries: 15 - delay: 30 - -- name: Waiting for all ClusterServiceVersion to complete - shell: "oc -n {{ cs_operand_namespace }} get csv --no-headers | grep -v Succeeded | wc -l" - register: csvc_count - until: csvc_count.stdout|int == 0 - retries: 15 - delay: 60 - diff --git a/playbooks/roles/ocp-cs/templates/catalog-source.yaml.j2 b/playbooks/roles/ocp-cs/templates/catalog-source.yaml.j2 deleted file mode 100644 index 6ff353bd..00000000 --- a/playbooks/roles/ocp-cs/templates/catalog-source.yaml.j2 +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: operators.coreos.com/v1alpha1 -kind: CatalogSource -metadata: - name: opencloud-operators - namespace: openshift-marketplace -spec: - displayName: IBMCS Operators - publisher: IBM - sourceType: grpc - image: {{ cs_operator_catalog_image }} - updateStrategy: - registryPoll: - interval: 60m - diff --git a/playbooks/roles/ocp-cs/templates/cs-group.yaml.j2 b/playbooks/roles/ocp-cs/templates/cs-group.yaml.j2 deleted file mode 100644 index e4f9981c..00000000 --- a/playbooks/roles/ocp-cs/templates/cs-group.yaml.j2 +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: operators.coreos.com/v1 -kind: OperatorGroup -metadata: - name: {{ cs_operator_project_name }} - namespace: {{ cs_operator_project_name }} -spec: - targetNamespaces: - - {{ cs_operator_project_name }} - diff --git a/playbooks/roles/ocp-cs/templates/cs-request.yaml.j2 b/playbooks/roles/ocp-cs/templates/cs-request.yaml.j2 deleted file mode 100644 index 11ebe683..00000000 --- a/playbooks/roles/ocp-cs/templates/cs-request.yaml.j2 +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: operator.ibm.com/v1alpha1 -kind: OperandRequest -metadata: - name: common-service - namespace: {{ cs_operand_namespace }} -spec: - requests: - - operands: -{% for o in cs_operand_list %} - - name: {{ o }} -{% endfor %} - registry: common-service - diff --git a/playbooks/roles/ocp-cs/templates/cs-sub.yaml.j2 b/playbooks/roles/ocp-cs/templates/cs-sub.yaml.j2 deleted file mode 100644 index 9dced1a9..00000000 --- a/playbooks/roles/ocp-cs/templates/cs-sub.yaml.j2 +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: operators.coreos.com/v1alpha1 -kind: Subscription -metadata: - name: {{ cs_operator_name }} - namespace: {{ cs_operator_project_name }} -spec: - channel: {{ cs_subscription_channel }} - installPlanApproval: {{ cs_subscription_strategy }} - name: {{ cs_operator_name }} - source: opencloud-operators - sourceNamespace: openshift-marketplace -