diff --git a/config/argocd-cloudpaks/cp-shared/Chart.yaml b/config/argocd-cloudpaks/cp-shared/Chart.yaml index 2548b17e..18e03c9b 100644 --- a/config/argocd-cloudpaks/cp-shared/Chart.yaml +++ b/config/argocd-cloudpaks/cp-shared/Chart.yaml @@ -16,7 +16,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.0 +version: 0.3.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/config/argocd-cloudpaks/cp-shared/templates/00-presync-common-config-map.yaml b/config/argocd-cloudpaks/cp-shared/templates/00-presync-common-config-map.yaml index 9c552c7a..33dddbc2 100644 --- a/config/argocd-cloudpaks/cp-shared/templates/00-presync-common-config-map.yaml +++ b/config/argocd-cloudpaks/cp-shared/templates/00-presync-common-config-map.yaml @@ -12,6 +12,7 @@ spec: containers: - name: config image: quay.io/openshift/origin-cli:latest + imagePullPolicy: IfNotPresent resources: requests: memory: "64Mi" diff --git a/config/argocd-cloudpaks/cp-shared/templates/00-presync-cp4a-config-map.yaml b/config/argocd-cloudpaks/cp-shared/templates/00-presync-cp4a-config-map.yaml index b8cecfd3..1c75374b 100644 --- a/config/argocd-cloudpaks/cp-shared/templates/00-presync-cp4a-config-map.yaml +++ b/config/argocd-cloudpaks/cp-shared/templates/00-presync-cp4a-config-map.yaml @@ -12,6 +12,7 @@ spec: containers: - name: config image: quay.io/openshift/origin-cli:latest + imagePullPolicy: IfNotPresent resources: requests: memory: "64Mi" diff --git a/config/argocd-cloudpaks/cp-shared/templates/cp-shared-app.yaml b/config/argocd-cloudpaks/cp-shared/templates/cp-shared-app.yaml index 87e36e69..79e42aef 100644 --- a/config/argocd-cloudpaks/cp-shared/templates/cp-shared-app.yaml +++ b/config/argocd-cloudpaks/cp-shared/templates/cp-shared-app.yaml @@ -9,12 +9,13 @@ metadata: argocd.argoproj.io/sync-wave: "100" spec: destination: - namespace: ibm-cloudpaks + namespace: {{.Values.argocd_app_namespace}} server: https://kubernetes.default.svc ignoreDifferences: - group: argoproj.io jsonPointers: - /spec/source/repoURL + - /spec/source/targetRevision - /status kind: Application project: default diff --git a/config/argocd-cloudpaks/cp-shared/templates/cp-shared-operators-app.yaml b/config/argocd-cloudpaks/cp-shared/templates/cp-shared-operators-app.yaml index f90a2966..c4d1ecd2 100644 --- a/config/argocd-cloudpaks/cp-shared/templates/cp-shared-operators-app.yaml +++ b/config/argocd-cloudpaks/cp-shared/templates/cp-shared-operators-app.yaml @@ -9,12 +9,13 @@ metadata: argocd.argoproj.io/sync-wave: "100" spec: destination: - namespace: ibm-cloudpaks + namespace: {{.Values.argocd_app_namespace}} server: https://kubernetes.default.svc ignoreDifferences: - group: argoproj.io jsonPointers: - /spec/source/repoURL + - /spec/source/targetRevision - /status kind: Application project: default diff --git a/config/argocd-cloudpaks/cp4a/Chart.yaml b/config/argocd-cloudpaks/cp4a/Chart.yaml index 88e7b549..e06c5b88 100644 --- a/config/argocd-cloudpaks/cp4a/Chart.yaml +++ b/config/argocd-cloudpaks/cp4a/Chart.yaml @@ -16,7 +16,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.0 +version: 0.3.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/config/argocd-cloudpaks/cp4a/templates/00-presync-adjust-cluster-route.yaml b/config/argocd-cloudpaks/cp4a/templates/00-presync-adjust-cluster-route.yaml index 5a7ac96d..23ff1383 100644 --- a/config/argocd-cloudpaks/cp4a/templates/00-presync-adjust-cluster-route.yaml +++ b/config/argocd-cloudpaks/cp4a/templates/00-presync-adjust-cluster-route.yaml @@ -12,13 +12,14 @@ spec: containers: - name: config image: quay.io/openshift/origin-cli:latest + imagePullPolicy: IfNotPresent resources: requests: memory: "64Mi" cpu: "250m" limits: - memory: "128Mi" - cpu: "500m" + memory: "96Mi" + cpu: "300m" env: - name: ARGOCD_APP_NAME value: cp4a-app diff --git a/config/argocd-cloudpaks/cp4a/templates/00-presync-adjust-ocp-platform.yaml b/config/argocd-cloudpaks/cp4a/templates/00-presync-adjust-ocp-platform.yaml index edf12ded..f8d0247b 100644 --- a/config/argocd-cloudpaks/cp4a/templates/00-presync-adjust-ocp-platform.yaml +++ b/config/argocd-cloudpaks/cp4a/templates/00-presync-adjust-ocp-platform.yaml @@ -12,13 +12,14 @@ spec: containers: - name: config image: quay.io/openshift/origin-cli:latest + imagePullPolicy: IfNotPresent resources: requests: memory: "64Mi" cpu: "250m" limits: memory: "128Mi" - cpu: "500m" + cpu: "300m" env: - name: ARGOCD_APP_NAME value: cp4a-app diff --git a/config/argocd-cloudpaks/cp4a/templates/00-presync-adjust-storage-classes.yaml b/config/argocd-cloudpaks/cp4a/templates/00-presync-adjust-storage-classes.yaml index 9f5b53f0..816177eb 100644 --- a/config/argocd-cloudpaks/cp4a/templates/00-presync-adjust-storage-classes.yaml +++ b/config/argocd-cloudpaks/cp4a/templates/00-presync-adjust-storage-classes.yaml @@ -12,13 +12,14 @@ spec: containers: - name: config image: quay.io/openshift/origin-cli:latest + imagePullPolicy: IfNotPresent resources: requests: memory: "64Mi" cpu: "250m" limits: - memory: "128Mi" - cpu: "500m" + memory: "96Mi" + cpu: "300m" env: - name: ARGOCD_APP_NAME value: cp4a-app diff --git a/config/argocd-cloudpaks/cp4a/templates/cp4a-app.yaml b/config/argocd-cloudpaks/cp4a/templates/cp4a-app.yaml index 09e3adf6..f5d131b9 100644 --- a/config/argocd-cloudpaks/cp4a/templates/cp4a-app.yaml +++ b/config/argocd-cloudpaks/cp4a/templates/cp4a-app.yaml @@ -15,6 +15,7 @@ spec: - group: argoproj.io jsonPointers: - /spec/source/repoURL + - /spec/source/targetRevision - /status kind: Application project: default diff --git a/config/argocd-cloudpaks/cp4a/templates/cp4a-operator-app.yaml b/config/argocd-cloudpaks/cp4a/templates/cp4a-operator-app.yaml index 1467eb81..d17245af 100644 --- a/config/argocd-cloudpaks/cp4a/templates/cp4a-operator-app.yaml +++ b/config/argocd-cloudpaks/cp4a/templates/cp4a-operator-app.yaml @@ -14,8 +14,9 @@ spec: ignoreDifferences: - group: argoproj.io jsonPointers: - - /status - /spec/source/repoURL + - /spec/source/targetRevision + - /status kind: Application project: default source: diff --git a/config/argocd-cloudpaks/cp4a/templates/cp4a-resources-app.yaml b/config/argocd-cloudpaks/cp4a/templates/cp4a-resources-app.yaml index 33ad6cfd..5adb15f2 100644 --- a/config/argocd-cloudpaks/cp4a/templates/cp4a-resources-app.yaml +++ b/config/argocd-cloudpaks/cp4a/templates/cp4a-resources-app.yaml @@ -14,8 +14,9 @@ spec: ignoreDifferences: - group: argoproj.io jsonPointers: - - /status - /spec/source/repoURL + - /spec/source/targetRevision + - /status kind: Application - group: icp4a.ibm.com jsonPointers: diff --git a/config/argocd-cloudpaks/cp4aiops/Chart.yaml b/config/argocd-cloudpaks/cp4aiops/Chart.yaml index 245988b0..0d0d0f27 100644 --- a/config/argocd-cloudpaks/cp4aiops/Chart.yaml +++ b/config/argocd-cloudpaks/cp4aiops/Chart.yaml @@ -16,7 +16,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.0 +version: 0.3.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/config/argocd-cloudpaks/cp4aiops/templates/00-presync-adjust-storage-classes.yaml b/config/argocd-cloudpaks/cp4aiops/templates/00-presync-adjust-storage-classes.yaml deleted file mode 100644 index c72b2cfa..00000000 --- a/config/argocd-cloudpaks/cp4aiops/templates/00-presync-adjust-storage-classes.yaml +++ /dev/null @@ -1,90 +0,0 @@ ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: cp4aiops-storage-classes - annotations: - argocd.argoproj.io/hook: PreSync - namespace: openshift-gitops -spec: - template: - spec: - containers: - - name: config - image: quay.io/openshift/origin-cli:latest - resources: - requests: - memory: "64Mi" - cpu: "150m" - limits: - memory: "128Mi" - cpu: "200m" - env: - - name: ARGOCD_APP_NAME - value: "cp4aiops-app" - - name: ARGOCD_NAMESPACE - value: "openshift-gitops" - command: - - /bin/sh - - -c - - | - set -eo pipefail - set -x - - storage_class_rwo="$(oc get configmap argocd-cp4aiops-config \ - --namespace "${ARGOCD_NAMESPACE}" -o jsonpath='{.data.storageclass\.rwo}')" - storage_class_rwx="$(oc get configmap argocd-cp4aiops-config \ - --namespace "${ARGOCD_NAMESPACE}" -o jsonpath='{.data.storageclass\.rwx}')" - - if [ -z "${storage_class_rwo}" ] || [ -z "${storage_class_rwx}" ] ; then - echo "ERROR: Did not find storage classes for target platform." - exit 1 - fi - - echo "INFO: Patching application ${ARGOCD_APP_NAME}." - helm_params=$(oc get Application "${ARGOCD_APP_NAME}" --namespace "${ARGOCD_NAMESPACE}" -o yaml -o jsonpath={.spec.source.helm.parameters}) - if [[ ! ${helm_params} == *${storage_class_rwo}* ]] || - [[ ! ${helm_params} == *${storage_class_rwx}* ]]; then - app_patch=/tmp/patch.json - cat< "${app_patch}" - [ - { - "op": "add", - "path": "/spec/source/helm/parameters/0", - "value": { - "forceString": true, - "name": "storageclass.rwo", - "value": "${storage_class_rwo}" - } - }, - { - "op": "add", - "path": "/spec/source/helm/parameters/0", - "value": { - "forceString": true, - "name": "storageclass.rwx", - "value": "${storage_class_rwx}" - } - } - - ] - EOF - - oc patch Application "${ARGOCD_APP_NAME}" \ - --namespace "${ARGOCD_NAMESPACE}" \ - -o yaml \ - --type=json \ - --patch-file "${app_patch}" \ - && echo "INFO: Patched application ${ARGOCD_APP_NAME}." \ - || echo "ERROR: Failed to patch application ${ARGOCD_APP_NAME}." - else - echo "INFO: Application ${ARGOCD_APP_NAME} was already patched." - fi - echo "INFO: Application ${ARGOCD_APP_NAME} current helm parameters:" - oc get Application "${ARGOCD_APP_NAME}" \ - --namespace "${ARGOCD_NAMESPACE}" \ - -o jsonpath={.spec.source.helm.parameters} - - restartPolicy: Never - serviceAccountName: {{.Values.serviceaccount.argocd_application_controller}} - backoffLimit: 2 diff --git a/config/argocd-cloudpaks/cp4aiops/templates/cp4aiops-app.yaml b/config/argocd-cloudpaks/cp4aiops/templates/cp4aiops-app.yaml index a301114d..f686888c 100644 --- a/config/argocd-cloudpaks/cp4aiops/templates/cp4aiops-app.yaml +++ b/config/argocd-cloudpaks/cp4aiops/templates/cp4aiops-app.yaml @@ -14,7 +14,9 @@ spec: ignoreDifferences: - group: argoproj.io jsonPointers: + - /spec/source/helm/parameters - /spec/source/repoURL + - /spec/source/targetRevision - /status kind: Application project: default @@ -25,6 +27,10 @@ spec: value: ${ARGOCD_APP_NAME} - name: argocd_app_namespace value: ${ARGOCD_APP_NAMESPACE} + - name: automation_base_instance_name + value: "{{.Values.automation_base_instance_name}}" + - name: automation_ui_config_instance_name + value: "{{.Values.automation_ui_config_instance_name}}" - name: metadata.argocd_app_namespace value: {{.Values.metadata.argocd_app_namespace}} - name: repoURL diff --git a/config/argocd-cloudpaks/cp4aiops/templates/cp4aiops-operator-app.yaml b/config/argocd-cloudpaks/cp4aiops/templates/cp4aiops-operator-app.yaml index 0fa81bf0..8a4ba0a6 100644 --- a/config/argocd-cloudpaks/cp4aiops/templates/cp4aiops-operator-app.yaml +++ b/config/argocd-cloudpaks/cp4aiops/templates/cp4aiops-operator-app.yaml @@ -15,8 +15,13 @@ spec: - group: argoproj.io jsonPointers: - /spec/source/repoURL + - /spec/source/targetRevision - /status kind: Application + - group: v1 + jsonPointers: + - /metadata/labels + kind: Namespace project: default source: helm: diff --git a/config/argocd-cloudpaks/cp4aiops/templates/cp4aiops-resources-app.yaml b/config/argocd-cloudpaks/cp4aiops/templates/cp4aiops-resources-app.yaml index 3fd31483..745c706c 100644 --- a/config/argocd-cloudpaks/cp4aiops/templates/cp4aiops-resources-app.yaml +++ b/config/argocd-cloudpaks/cp4aiops/templates/cp4aiops-resources-app.yaml @@ -15,6 +15,7 @@ spec: - group: argoproj.io jsonPointers: - /spec/source/repoURL + - /spec/source/targetRevision - /status kind: Application project: default @@ -25,6 +26,10 @@ spec: value: ${ARGOCD_APP_NAME} - name: argocd_app_namespace value: ${ARGOCD_APP_NAMESPACE} + - name: automation_base_instance_name + value: "{{.Values.automation_base_instance_name}}" + - name: automation_ui_config_instance_name + value: "{{.Values.automation_ui_config_instance_name}}" - name: metadata.argocd_app_namespace value: {{.Values.metadata.argocd_app_namespace}} - name: repoURL diff --git a/config/argocd-cloudpaks/cp4aiops/values.yaml b/config/argocd-cloudpaks/cp4aiops/values.yaml index ced19135..e9c3dc49 100644 --- a/config/argocd-cloudpaks/cp4aiops/values.yaml +++ b/config/argocd-cloudpaks/cp4aiops/values.yaml @@ -1,6 +1,8 @@ --- repoURL: https://github.com/IBM/cloudpak-gitops targetRevision: main +automation_base_instance_name: "" +automation_ui_config_instance_name: "" serviceaccount: argocd_application_controller: openshift-gitops-argocd-application-controller metadata: diff --git a/config/argocd-cloudpaks/cp4i/Chart.yaml b/config/argocd-cloudpaks/cp4i/Chart.yaml index db8cd32e..17a358c5 100644 --- a/config/argocd-cloudpaks/cp4i/Chart.yaml +++ b/config/argocd-cloudpaks/cp4i/Chart.yaml @@ -16,7 +16,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.0 +version: 0.3.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/config/argocd-cloudpaks/cp4i/templates/00-presync-adjust-storage-classes.yaml b/config/argocd-cloudpaks/cp4i/templates/00-presync-adjust-storage-classes.yaml index 124f9069..d04075ad 100644 --- a/config/argocd-cloudpaks/cp4i/templates/00-presync-adjust-storage-classes.yaml +++ b/config/argocd-cloudpaks/cp4i/templates/00-presync-adjust-storage-classes.yaml @@ -12,6 +12,7 @@ spec: containers: - name: config image: quay.io/openshift/origin-cli:latest + imagePullPolicy: IfNotPresent resources: requests: memory: "64Mi" diff --git a/config/argocd-cloudpaks/cp4i/templates/cp4i-app.yaml b/config/argocd-cloudpaks/cp4i/templates/cp4i-app.yaml index 41748e8b..04dc03ba 100644 --- a/config/argocd-cloudpaks/cp4i/templates/cp4i-app.yaml +++ b/config/argocd-cloudpaks/cp4i/templates/cp4i-app.yaml @@ -15,6 +15,7 @@ spec: - group: argoproj.io jsonPointers: - /spec/source/repoURL + - /spec/source/targetRevision - /status kind: Application - group: route.openshift.io diff --git a/config/argocd-cloudpaks/cp4i/templates/cp4i-client-app.yaml b/config/argocd-cloudpaks/cp4i/templates/cp4i-client-app.yaml index 853a54d2..38616713 100644 --- a/config/argocd-cloudpaks/cp4i/templates/cp4i-client-app.yaml +++ b/config/argocd-cloudpaks/cp4i/templates/cp4i-client-app.yaml @@ -14,8 +14,9 @@ spec: ignoreDifferences: - group: argoproj.io jsonPointers: - - /status - /spec/source/repoURL + - /spec/source/targetRevision + - /status kind: Application project: default source: diff --git a/config/argocd-cloudpaks/cp4i/templates/cp4i-operator-app.yaml b/config/argocd-cloudpaks/cp4i/templates/cp4i-operator-app.yaml index 95ace34c..9ad1e52d 100644 --- a/config/argocd-cloudpaks/cp4i/templates/cp4i-operator-app.yaml +++ b/config/argocd-cloudpaks/cp4i/templates/cp4i-operator-app.yaml @@ -14,8 +14,9 @@ spec: ignoreDifferences: - group: argoproj.io jsonPointers: - - /status - /spec/source/repoURL + - /spec/source/targetRevision + - /status kind: Application project: default source: diff --git a/config/argocd-cloudpaks/cp4i/templates/cp4i-resources-app.yaml b/config/argocd-cloudpaks/cp4i/templates/cp4i-resources-app.yaml index cc09c2aa..cac6ad4f 100644 --- a/config/argocd-cloudpaks/cp4i/templates/cp4i-resources-app.yaml +++ b/config/argocd-cloudpaks/cp4i/templates/cp4i-resources-app.yaml @@ -14,8 +14,9 @@ spec: ignoreDifferences: - group: argoproj.io jsonPointers: - - /status - /spec/source/repoURL + - /spec/source/targetRevision + - /status kind: Application - group: datapower.ibm.com jsonPointers: diff --git a/config/argocd-rhacm/templates/rhacm-cloudpaks-app.yaml b/config/argocd-rhacm/templates/rhacm-cloudpaks-app.yaml index b814df36..ffd0b6a3 100644 --- a/config/argocd-rhacm/templates/rhacm-cloudpaks-app.yaml +++ b/config/argocd-rhacm/templates/rhacm-cloudpaks-app.yaml @@ -17,6 +17,11 @@ spec: - /spec/syncPolicy - /status kind: Application + - group: v1 + # Due to serverless prereqs modifying annotations + jsonPointers: + - /metadata/annotations + kind: Namespace project: default source: helm: diff --git a/config/argocd/Chart.yaml b/config/argocd/Chart.yaml index c7494f4a..97c96a3f 100644 --- a/config/argocd/Chart.yaml +++ b/config/argocd/Chart.yaml @@ -1,6 +1,6 @@ --- apiVersion: v2 -name: argo-app +name: argocd description: Argo application # A chart can be either an 'application' or a 'library' chart. diff --git a/config/cicd/base/01-namespaces/cicd-environment.yaml b/config/cicd/base/01-namespaces/cicd-environment.yaml index b1ce5eed..b0c3c5fd 100644 --- a/config/cicd/base/01-namespaces/cicd-environment.yaml +++ b/config/cicd/base/01-namespaces/cicd-environment.yaml @@ -4,7 +4,6 @@ kind: Namespace metadata: annotations: app.openshift.io/vcs-uri: https://github.com/IBM/cloudpak-gitops.git?ref=main - argocd.argoproj.io/sync-wave: "0" creationTimestamp: null name: cicd spec: {} diff --git a/config/cloudpaks/cp-shared/operators/Chart.yaml b/config/cloudpaks/cp-shared/operators/Chart.yaml index 82c4119b..1e5e7cea 100644 --- a/config/cloudpaks/cp-shared/operators/Chart.yaml +++ b/config/cloudpaks/cp-shared/operators/Chart.yaml @@ -16,7 +16,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.0 +version: 0.3.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/config/cloudpaks/cp-shared/operators/templates/0000-namespace.yaml b/config/cloudpaks/cp-shared/operators/templates/0000-namespace.yaml new file mode 100644 index 00000000..9040b580 --- /dev/null +++ b/config/cloudpaks/cp-shared/operators/templates/0000-namespace.yaml @@ -0,0 +1,15 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: ibm-cloudpaks +spec: {} +status: {} +--- +apiVersion: v1 +kind: Namespace +metadata: + creationTimestamp: null + name: ibm-common-services +spec: {} +status: {} diff --git a/config/cloudpaks/cp4i/resources/templates/02-rolebindings/argocd-common-services.yaml b/config/cloudpaks/cp-shared/operators/templates/0010-role-binding-argocd-common-services.yaml similarity index 100% rename from config/cloudpaks/cp4i/resources/templates/02-rolebindings/argocd-common-services.yaml rename to config/cloudpaks/cp-shared/operators/templates/0010-role-binding-argocd-common-services.yaml diff --git a/config/cloudpaks/cp-shared/operators/templates/catalogsource-ibm.yaml b/config/cloudpaks/cp-shared/operators/templates/0050-catalogsource-ibm.yaml similarity index 100% rename from config/cloudpaks/cp-shared/operators/templates/catalogsource-ibm.yaml rename to config/cloudpaks/cp-shared/operators/templates/0050-catalogsource-ibm.yaml diff --git a/config/cloudpaks/cp-shared/operators/templates/operator-group.yaml b/config/cloudpaks/cp-shared/operators/templates/0100-operator-group.yaml similarity index 100% rename from config/cloudpaks/cp-shared/operators/templates/operator-group.yaml rename to config/cloudpaks/cp-shared/operators/templates/0100-operator-group.yaml diff --git a/config/cloudpaks/cp-shared/operators/templates/namespace.yaml b/config/cloudpaks/cp-shared/operators/templates/namespace.yaml deleted file mode 100644 index f4ba13f0..00000000 --- a/config/cloudpaks/cp-shared/operators/templates/namespace.yaml +++ /dev/null @@ -1,9 +0,0 @@ ---- -apiVersion: v1 -kind: Namespace -metadata: - annotations: - argocd.argoproj.io/sync-wave: "0" - name: ibm-cloudpaks -spec: {} -status: {} diff --git a/config/cloudpaks/cp-shared/operators/values.yaml b/config/cloudpaks/cp-shared/operators/values.yaml index 89bc9b53..ca14b43f 100644 --- a/config/cloudpaks/cp-shared/operators/values.yaml +++ b/config/cloudpaks/cp-shared/operators/values.yaml @@ -1,3 +1,5 @@ --- metadata: argocd_namespace: openshift-gitops +serviceaccount: + argocd_application_controller: openshift-gitops-argocd-application-controller diff --git a/config/cloudpaks/cp4a/operators/Chart.yaml b/config/cloudpaks/cp4a/operators/Chart.yaml index 0a19f4f9..ca54289f 100644 --- a/config/cloudpaks/cp4a/operators/Chart.yaml +++ b/config/cloudpaks/cp4a/operators/Chart.yaml @@ -16,7 +16,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.0 +version: 0.3.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/config/cloudpaks/cp4a/operators/templates/01-namespaces/individual.yaml b/config/cloudpaks/cp4a/operators/templates/01-namespaces/individual.yaml index bb658695..8f880e45 100644 --- a/config/cloudpaks/cp4a/operators/templates/01-namespaces/individual.yaml +++ b/config/cloudpaks/cp4a/operators/templates/01-namespaces/individual.yaml @@ -2,8 +2,6 @@ apiVersion: v1 kind: Namespace metadata: - annotations: - argocd.argoproj.io/sync-wave: "0" creationTimestamp: null name: {{.Values.metadata.individual_namespace}} spec: {} diff --git a/config/cloudpaks/cp4a/operators/templates/07-operators/99-postsync-check-all-csvs.yaml b/config/cloudpaks/cp4a/operators/templates/07-operators/99-postsync-check-all-csvs.yaml index e2c0c235..1f13f29e 100644 --- a/config/cloudpaks/cp4a/operators/templates/07-operators/99-postsync-check-all-csvs.yaml +++ b/config/cloudpaks/cp4a/operators/templates/07-operators/99-postsync-check-all-csvs.yaml @@ -13,13 +13,14 @@ spec: containers: - name: config image: quay.io/openshift/origin-cli:latest + imagePullPolicy: IfNotPresent resources: requests: memory: "64Mi" cpu: "250m" limits: - memory: "128Mi" - cpu: "500m" + memory: "96Mi" + cpu: "300m" env: - name: TARGET_NAMESPACE value: "{{.Values.argocd_app_namespace}}" @@ -38,10 +39,12 @@ spec: operation_limit_seconds=$(( $(date +%s) + 2400 )) csv_installing=0 while [ ${current_seconds} -lt ${operation_limit_seconds} ]; do - if [ $(oc get csv -n "${TARGET_NAMESPACE}" | grep -vc Succeeded) -gt 1 ] || \ - [ $(oc get csv -n ibm-common-services | grep -vc Succeeded) -gt 1 ]; then + if [ $(oc get csv -n ibm-common-services | grep -vc Succeeded) -gt 1 ] || \ + [ $(oc get csv -n ${TARGET_NAMESPACE} | grep -vc Succeeded) -gt 1 ]; then csv_installing=1 echo "INFO: CSVs still installing." + oc get csv -n ibm-common-services | grep -vc Succeeded + oc get csv -n ${TARGET_NAMESPACE} | grep -vc Succeeded sleep 60 else csv_installing=0 diff --git a/config/cloudpaks/cp4a/operators/values.yaml b/config/cloudpaks/cp4a/operators/values.yaml index 6d067cb8..a7fecec5 100644 --- a/config/cloudpaks/cp4a/operators/values.yaml +++ b/config/cloudpaks/cp4a/operators/values.yaml @@ -3,3 +3,7 @@ metadata: individual_namespace: cp4a serviceaccount: argocd_application_controller: openshift-gitops-argocd-application-controller +storageclass: + gold: cp4a-file-retain-gold-gid + silver: cp4a-file-retain-silver-gid + bronze: cp4a-file-retain-bronze-gid diff --git a/config/cloudpaks/cp4a/resources/Chart.yaml b/config/cloudpaks/cp4a/resources/Chart.yaml index 8905ef3d..25157592 100644 --- a/config/cloudpaks/cp4a/resources/Chart.yaml +++ b/config/cloudpaks/cp4a/resources/Chart.yaml @@ -16,7 +16,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.0 +version: 0.3.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/config/cloudpaks/cp4a/resources/templates/patch-db2-sts.yaml b/config/cloudpaks/cp4a/resources/templates/patch-db2-sts.yaml index 1c0471ff..f7c84a12 100644 --- a/config/cloudpaks/cp4a/resources/templates/patch-db2-sts.yaml +++ b/config/cloudpaks/cp4a/resources/templates/patch-db2-sts.yaml @@ -22,13 +22,14 @@ spec: containers: - name: config image: quay.io/openshift/origin-cli:latest + imagePullPolicy: IfNotPresent resources: requests: memory: "64Mi" cpu: "250m" limits: - memory: "128Mi" - cpu: "500m" + memory: "96Mi" + cpu: "300m" env: - name: TARGET_NAMESPACE value: "{{.Values.metadata.argocd_app_namespace}}" diff --git a/config/cloudpaks/cp4aiops/operators/Chart.yaml b/config/cloudpaks/cp4aiops/operators/Chart.yaml index b347aa1f..0ae6baf0 100644 --- a/config/cloudpaks/cp4aiops/operators/Chart.yaml +++ b/config/cloudpaks/cp4aiops/operators/Chart.yaml @@ -16,7 +16,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.0 +version: 0.3.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/config/cloudpaks/cp4aiops/operators/templates/00-prereqs/0000-argocd-admin-common-services.yaml b/config/cloudpaks/cp4aiops/operators/templates/00-prereqs/0000-argocd-admin-common-services.yaml deleted file mode 100644 index 391b2c07..00000000 --- a/config/cloudpaks/cp4aiops/operators/templates/00-prereqs/0000-argocd-admin-common-services.yaml +++ /dev/null @@ -1,36 +0,0 @@ ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - annotations: - argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true - argocd.argoproj.io/sync-wave: "1" - creationTimestamp: null - name: argocd-admin-cs - namespace: ibm-common-services -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: admin -subjects: - - kind: ServiceAccount - name: argocd-cluster-argocd-application-controller - namespace: openshift-gitops ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - annotations: - argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true - argocd.argoproj.io/sync-wave: "1" - creationTimestamp: null - name: openshift-gitops-admin-cs - namespace: ibm-common-services -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: admin -subjects: - - kind: ServiceAccount - name: openshift-gitops-argocd-application-controller - namespace: openshift-gitops diff --git a/config/cloudpaks/cp4aiops/operators/templates/00-prereqs/0000-namespaces.yaml b/config/cloudpaks/cp4aiops/operators/templates/00-prereqs/0000-namespaces.yaml index c751d1ff..0cb2e3ff 100644 --- a/config/cloudpaks/cp4aiops/operators/templates/00-prereqs/0000-namespaces.yaml +++ b/config/cloudpaks/cp4aiops/operators/templates/00-prereqs/0000-namespaces.yaml @@ -2,19 +2,8 @@ apiVersion: v1 kind: Namespace metadata: - annotations: - argocd.argoproj.io/sync-wave: "0" - creationTimestamp: null - name: ibm-common-services -spec: {} -status: {} ---- -apiVersion: v1 -kind: Namespace -metadata: - annotations: - argocd.argoproj.io/sync-wave: "0" creationTimestamp: null + labels: {} name: knative-eventing spec: {} status: {} @@ -22,8 +11,6 @@ status: {} apiVersion: v1 kind: Namespace metadata: - annotations: - argocd.argoproj.io/sync-wave: "0" creationTimestamp: null name: knative-serving spec: {} @@ -32,8 +19,6 @@ status: {} apiVersion: v1 kind: Namespace metadata: - annotations: - argocd.argoproj.io/sync-wave: "0" creationTimestamp: null name: openshift-serverless spec: {} diff --git a/config/cloudpaks/cp4aiops/operators/templates/00-prereqs/9999-configure-network-policy.yaml b/config/cloudpaks/cp4aiops/operators/templates/00-prereqs/9999-configure-network-policy.yaml index 3d05f1d8..9d5e1a9e 100644 --- a/config/cloudpaks/cp4aiops/operators/templates/00-prereqs/9999-configure-network-policy.yaml +++ b/config/cloudpaks/cp4aiops/operators/templates/00-prereqs/9999-configure-network-policy.yaml @@ -17,13 +17,14 @@ spec: containers: - name: config image: quay.io/openshift/origin-cli:latest + imagePullPolicy: IfNotPresent resources: requests: memory: "64Mi" cpu: "250m" limits: - memory: "128Mi" - cpu: "500m" + memory: "96Mi" + cpu: "300m" command: - /bin/sh - -c diff --git a/config/cloudpaks/cp4aiops/operators/templates/00-prereqs/9999-postsync-close-route.yaml b/config/cloudpaks/cp4aiops/operators/templates/00-prereqs/9999-postsync-close-route.yaml index 43168a38..66588295 100644 --- a/config/cloudpaks/cp4aiops/operators/templates/00-prereqs/9999-postsync-close-route.yaml +++ b/config/cloudpaks/cp4aiops/operators/templates/00-prereqs/9999-postsync-close-route.yaml @@ -12,13 +12,14 @@ spec: containers: - name: config image: quay.io/openshift/origin-cli:latest + imagePullPolicy: IfNotPresent resources: requests: memory: "64Mi" cpu: "250m" limits: - memory: "128Mi" - cpu: "500m" + memory: "96Mi" + cpu: "300m" command: - /bin/sh - -c diff --git a/config/cloudpaks/cp4aiops/operators/templates/07-operators/99-postsync-check-all-csvs.yaml b/config/cloudpaks/cp4aiops/operators/templates/07-operators/99-postsync-check-all-csvs.yaml index 0eeca700..ef277d95 100644 --- a/config/cloudpaks/cp4aiops/operators/templates/07-operators/99-postsync-check-all-csvs.yaml +++ b/config/cloudpaks/cp4aiops/operators/templates/07-operators/99-postsync-check-all-csvs.yaml @@ -13,13 +13,14 @@ spec: containers: - name: config image: quay.io/openshift/origin-cli:latest + imagePullPolicy: IfNotPresent resources: requests: memory: "64Mi" cpu: "250m" limits: - memory: "128Mi" - cpu: "500m" + memory: "96Mi" + cpu: "300m" env: - name: TARGET_NAMESPACE value: "{{.Values.metadata.argocd_app_namespace}}" @@ -38,9 +39,12 @@ spec: operation_limit_seconds=$(( $(date +%s) + 2400 )) csv_installing=0 while [ ${current_seconds} -lt ${operation_limit_seconds} ]; do - if [ $(oc get csv -A | grep -vc Succeeded) -gt 1 ]; then + if [ $(oc get csv -n ibm-common-services | grep -vc Succeeded) -gt 1 ] || \ + [ $(oc get csv -n ${TARGET_NAMESPACE} | grep -vc Succeeded) -gt 1 ]; then csv_installing=1 echo "INFO: CSVs still installing." + oc get csv -n ibm-common-services | grep -vc Succeeded + oc get csv -n ${TARGET_NAMESPACE} | grep -vc Succeeded sleep 60 else csv_installing=0 diff --git a/config/cloudpaks/cp4aiops/resources/Chart.yaml b/config/cloudpaks/cp4aiops/resources/Chart.yaml index 090b37a4..b753da0b 100644 --- a/config/cloudpaks/cp4aiops/resources/Chart.yaml +++ b/config/cloudpaks/cp4aiops/resources/Chart.yaml @@ -16,7 +16,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.1 +version: 0.3.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/config/cloudpaks/cp4aiops/resources/templates/00-presync-adjust-parameters.yaml b/config/cloudpaks/cp4aiops/resources/templates/00-presync-adjust-parameters.yaml new file mode 100644 index 00000000..e2ad83c2 --- /dev/null +++ b/config/cloudpaks/cp4aiops/resources/templates/00-presync-adjust-parameters.yaml @@ -0,0 +1,110 @@ +--- +apiVersion: batch/v1 +kind: Job +metadata: + annotations: + argocd.argoproj.io/sync-wave: "11" + argocd.argoproj.io/hook: PreSync + name: cp4aiops-adjust-parameters + namespace: openshift-gitops +spec: + template: + spec: + containers: + - name: config + image: quay.io/openshift/origin-cli:latest + imagePullPolicy: IfNotPresent + resources: + requests: + memory: "64Mi" + cpu: "150m" + limits: + memory: "128Mi" + cpu: "200m" + env: + - name: ARGOCD_NAMESPACE + value: "openshift-gitops" + - name: TARGET_NAMESPACE + value: "{{.Values.metadata.argocd_app_namespace}}" + command: + - /bin/sh + - -c + - | + set -eo pipefail + set -x + + storage_class_rwo="$(oc get configmap argocd-cp4aiops-config \ + --namespace "${ARGOCD_NAMESPACE}" -o jsonpath='{.data.storageclass\.rwo}')" + storage_class_rwx="$(oc get configmap argocd-cp4aiops-config \ + --namespace "${ARGOCD_NAMESPACE}" -o jsonpath='{.data.storageclass\.rwx}')" + + if [ -z "${storage_class_rwo}" ] || [ -z "${storage_class_rwx}" ] ; then + echo "ERROR: Did not find storage classes for target platform." + exit 1 + fi + + automation_base_instance_name="$(oc get AutomationBase.base.automation.ibm.com --namespace "${TARGET_NAMESPACE}" -o jsonpath='{.items[].metadata.name}' 2> /dev/null)" \ + && reuse_iaf_ab=1 \ + || reuse_iaf_ab=0 + + automation_ui_config_instance_name="$(oc get AutomationUIConfig.core.automation.ibm.com --namespace "${TARGET_NAMESPACE}" -o jsonpath='{.items[].metadata.name}' 2> /dev/null)" \ + && reuse_iaf_ui=1 \ + || reuse_iaf_ui=0 + + echo "INFO: Install Argo CLI." + # Install it from cluster, not from Internet, so airgap scenarios still work + argo_route=openshift-gitops-server + argo_secret=openshift-gitops-cluster + if [ {{.Values.serviceaccount.argocd_application_controller}} == argocd-cluster-argocd-application-controller ]; then + argo_route=argocd-cluster-server + argo_secret=argocd-cluster-cluster + fi + + export HOME=/tmp + argo_cmd="${HOME}/argocd" + result=0 + + argo_url=$(oc get route ${argo_route} -n ${ARGOCD_NAMESPACE} -ojsonpath='{.spec.host}') \ + && curl -skL "${argo_url}/download/argocd-linux-amd64" -o "${argo_cmd}" \ + && chmod 755 "${argo_cmd}" \ + && argo_pwd=$(oc get secret ${argo_secret} -n ${ARGOCD_NAMESPACE} -ojsonpath='{.data.admin\.password}' | base64 -d ; echo ) \ + && "${argo_cmd}" login "${argo_url}" --username admin --password "${argo_pwd}" --insecure \ + || result=1 + + if [ ${result} -eq 0 ]; then + for app_name in cp4aiops-app cp4aiops-resources; do + if [ -n "${storage_class_rwo}" ] && [ -n "${storage_class_rwx}" ]; then + echo "INFO: Patching storage for ${app_name}." \ + && "${argo_cmd}" app set "${app_name}" \ + --helm-set-string storageclass.rwo="${storage_class_rwo}" \ + --helm-set-string storageclass.rwx="${storage_class_rwx}" \ + && echo "INFO: ${app_name} successfully updated storage classes." \ + || result=1 + fi + if [ "${reuse_iaf_ab}" -eq 1 ] && [ -n "${automation_base_instance_name}" ]; then + echo "INFO: Patching IAF instances for ${app_name}." \ + && "${argo_cmd}" app set "${app_name}" \ + --helm-set-string automation_base_instance_name="${automation_base_instance_name}" \ + && echo "INFO: ${app_name} successfully updated IAF AutomationBase instance names." \ + || result=1 + fi + if [ "${reuse_iaf_ui}" -eq 1 ] && [ -n "${automation_ui_config_instance_name}" ]; then + echo "INFO: Patching IAF instances for ${app_name}." \ + && "${argo_cmd}" app set "${app_name}" \ + --helm-set-string automation_ui_config_instance_name="${automation_ui_config_instance_name}" \ + && echo "INFO: ${app_name} successfully updated IAF instance names." \ + || result=1 + fi + done + fi + + for app_name in cp4aiops-app cp4aiops-resources; do + echo "INFO: Application ${app_name} current parameters:" + "${argo_cmd}" app get "${app_name}" --show-params + done + + exit ${result} + + restartPolicy: Never + serviceAccountName: {{.Values.serviceaccount.argocd_application_controller}} + backoffLimit: 2 diff --git a/config/cloudpaks/cp4aiops/resources/templates/00-presync-patch-iaf.yaml b/config/cloudpaks/cp4aiops/resources/templates/00-presync-patch-iaf.yaml new file mode 100644 index 00000000..2d7ef4c0 --- /dev/null +++ b/config/cloudpaks/cp4aiops/resources/templates/00-presync-patch-iaf.yaml @@ -0,0 +1,96 @@ +--- +apiVersion: batch/v1 +kind: Job +metadata: + annotations: + argocd.argoproj.io/sync-wave: "11" + argocd.argoproj.io/hook: PreSync + name: cp4aiops-patch-shared-iaf + namespace: openshift-gitops +spec: + template: + spec: + containers: + - name: config + image: quay.io/openshift/origin-cli:latest + imagePullPolicy: IfNotPresent + resources: + requests: + memory: "64Mi" + cpu: "150m" + limits: + memory: "128Mi" + cpu: "200m" + env: + - name: ARGOCD_NAMESPACE + value: "openshift-gitops" + - name: TARGET_NAMESPACE + value: "{{.Values.metadata.argocd_app_namespace}}" + command: + - /bin/sh + - -c + - | + set -eo pipefail + set -x + + automation_base_instance_name="$(oc get AutomationBase --namespace "${TARGET_NAMESPACE}" -o jsonpath='{.items[].metadata.name}')" \ + && reuse_iaf_ab=1 \ + || reuse_iaf_ab=0 + + storage_class_rwx="$(oc get configmap argocd-cp4aiops-config \ + --namespace "${ARGOCD_NAMESPACE}" -o jsonpath='{.data.storageclass\.rwx}')" + + result=0 + if [ "${reuse_iaf_ab}" -eq 0 ]; then + echo "INFO: Did not find an existing instance of AutomationBase in the namespace." + else + echo "INFO: Found an existing instance of AutomationBase in the namespace." + abase_params=$(oc get AutomationBase "${automation_base_instance_name}" --namespace ${TARGET_NAMESPACE} -o jsonpath='{.spec}') + if [[ ! ${abase_params} == *aiops* ]]; then + echo "INFO: Patching it with AIOps requirements." + app_patch=/tmp/patch.json + cat< "${app_patch}" + [ + { + "op": "add", + "path": "/spec/elasticsearch/nodegroupspecs/0", + "value": { + "config": [ + { + "key": "node.master", + "value": "true" + }, + { + "key": "node.data", + "value": "true" + } + ], + "name": "aiops", + "replicas": 3, + "storage": { + "class": "${storage_class_rwx}", + } + } + }, + { + "op": "replace", + "path": "/spec/zen", + "value": true + } + ] + EOF + + oc patch AutomationBase "${automation_base_instance_name}" \ + --namespace "${TARGET_NAMESPACE}" \ + --output yaml \ + --patch-file "${app_patch}" \ + --type=json \ + || result=0 + fi + fi + + exit ${result} + + restartPolicy: Never + serviceAccountName: {{.Values.serviceaccount.argocd_application_controller}} + backoffLimit: 2 diff --git a/config/cloudpaks/cp4aiops/resources/templates/04-common-service.yaml b/config/cloudpaks/cp4aiops/resources/templates/04-common-service.yaml deleted file mode 100644 index cd070da5..00000000 --- a/config/cloudpaks/cp4aiops/resources/templates/04-common-service.yaml +++ /dev/null @@ -1,431 +0,0 @@ ---- -# https://www.ibm.com/docs/en/cpfs?topic=templates-linux-x86-64-clusters -apiVersion: operator.ibm.com/v3 -kind: CommonService -metadata: - annotations: - argocd.argoproj.io/sync-wave: "3" - creationTimestamp: null - name: common-service - namespace: ibm-common-services -spec: - size: small - storageClass: {{.Values.storageclass.rwx}} - services: - # https://github.ibm.com/IBMPrivateCloud/roadmap/issues/48099 - - name: ibm-cert-manager-operator - spec: - certManager: - certManagerCAInjector: - resources: - limits: - cpu: 200m - memory: 2Gi - requests: - cpu: 100m - memory: 1512Mi - certManagerController: - resources: - limits: - cpu: 200m - memory: 2Gi - requests: - cpu: 160m - memory: 1512Mi - certManagerWebhook: - resources: - limits: - cpu: 300m - memory: 100Mi - requests: - cpu: 150m - memory: 40Mi - configMapWatcher: - resources: - limits: - cpu: 30m - memory: 60Mi - requests: - cpu: 30m - memory: 30Mi - - name: ibm-mongodb-operator - spec: - mongoDB: - replicas: 3 - resources: - limits: - cpu: 1000m - memory: 640Mi - requests: - cpu: 500m - memory: 640Mi - - name: ibm-iam-operator - spec: - authentication: - replicas: 1 - auditService: - resources: - limits: - cpu: 1000m - memory: 50Mi - requests: - cpu: 10m - memory: 40Mi - authService: - resources: - limits: - cpu: 1000m - memory: 1090Mi - requests: - cpu: 600m - memory: 650Mi - clientRegistration: - resources: - limits: - cpu: 1000m - memory: 50Mi - requests: - cpu: 20m - memory: 50Mi - identityManager: - resources: - limits: - cpu: 1000m - memory: 410Mi - requests: - cpu: 260m - memory: 240Mi - identityProvider: - resources: - limits: - cpu: 1000m - memory: 420Mi - requests: - cpu: 570m - memory: 250Mi - oidcclientwatcher: - replicas: 1 - resources: - limits: - cpu: 1000m - memory: 256Mi - requests: - cpu: 20m - memory: 34Mi - pap: - auditService: - resources: - limits: - cpu: 1000m - memory: 50Mi - requests: - cpu: 10m - memory: 20Mi - papService: - resources: - limits: - cpu: 1000m - memory: 380Mi - requests: - cpu: 30m - memory: 190Mi - replicas: 1 - policycontroller: - replicas: 1 - resources: - limits: - cpu: 1000m - memory: 60Mi - requests: - cpu: 20m - memory: 30Mi - policydecision: - auditService: - resources: - limits: - cpu: 1000m - memory: 40Mi - requests: - cpu: 10m - memory: 20Mi - resources: - limits: - cpu: 1000m - memory: 50Mi - requests: - cpu: 70m - memory: 30Mi - replicas: 1 - secretwatcher: - replicas: 1 - resources: - limits: - cpu: 1000m - memory: 400Mi - requests: - cpu: 20m - memory: 200Mi - securityonboarding: - replicas: 1 - resources: - limits: - cpu: 1000m - memory: 50Mi - requests: - cpu: 20m - memory: 50Mi - iamOnboarding: - resources: - limits: - cpu: 1000m - memory: 1024Mi - requests: - cpu: 20m - memory: 64Mi - - name: ibm-management-ingress-operator - spec: - managementIngress: - replicas: 1 - resources: - requests: - cpu: 70m - memory: 70Mi - limits: - cpu: 1000m - memory: 170Mi - - name: ibm-ingress-nginx-operator - spec: - nginxIngress: - ingress: - replicas: 1 - resources: - requests: - cpu: 100m - memory: 110Mi - limits: - cpu: 1000m - memory: 350Mi - defaultBackend: - replicas: 1 - resources: - requests: - cpu: 10m - memory: 20Mi - limits: - cpu: 20m - memory: 50Mi - kubectl: - resources: - requests: - memory: 150Mi - cpu: 30m - limits: - memory: 150Mi - cpu: 30m - - name: ibm-licensing-operator - spec: - IBMLicensing: - resources: - requests: - cpu: 100m - memory: 850Mi - limits: - cpu: 200m - memory: 1Gi - IBMLicenseServiceReporter: - databaseContainer: - resources: - requests: - cpu: 200m - memory: 256Mi - limits: - cpu: 300m - memory: 300Mi - receiverContainer: - resources: - requests: - cpu: 200m - memory: 256Mi - limits: - cpu: 300m - memory: 384Mi - - name: ibm-commonui-operator - spec: - commonWebUI: - replicas: 1 - resources: - requests: - memory: 256Mi - cpu: 130m - limits: - memory: 440Mi - cpu: 1000m - commonWebUIConfig: - dashboardData: - resources: - limits: - cpu: 3000m - memory: 460Mi - requests: - cpu: 310m - memory: 190Mi - - name: ibm-platform-api-operator - spec: - platformApi: - auditService: - resources: - limits: - cpu: 25m - memory: 50Mi - requests: - cpu: 20m - memory: 30Mi - platformApi: - resources: - limits: - cpu: 200m - memory: 512Mi - requests: - cpu: 50m - memory: 128Mi - - name: ibm-healthcheck-operator - spec: - healthService: - memcached: - replicas: 1 - resources: - requests: - memory: 50Mi - cpu: 20m - limits: - memory: 100Mi - cpu: 200m - healthService: - replicas: 1 - resources: - requests: - memory: 100Mi - cpu: 20m - limits: - memory: 100Mi - cpu: 200m - - name: ibm-auditlogging-operator - spec: - auditLogging: - fluentd: - resources: - requests: - cpu: 20m - memory: 20Mi - limits: - cpu: 50m - memory: 150Mi - - name: ibm-monitoring-exporters-operator - spec: - exporter: - collectd: - resource: - requests: - cpu: 20m - memory: 20Mi - limits: - cpu: 30m - memory: 50Mi - routerResource: - limits: - cpu: 25m - memory: 50Mi - requests: - cpu: 10m - memory: 20Mi - nodeExporter: - resource: - requests: - cpu: 20m - memory: 30Mi - limits: - cpu: 20m - memory: 40Mi - routerResource: - requests: - cpu: 10m - memory: 20Mi - limits: - cpu: 100m - memory: 256Mi - kubeStateMetrics: - resource: - requests: - cpu: 360m - memory: 180Mi - limits: - cpu: 540m - memory: 350Mi - routerResource: - limits: - cpu: 25m - memory: 50Mi - requests: - cpu: 10m - memory: 20Mi - - name: ibm-monitoring-grafana-operator - spec: - grafana: - grafanaConfig: - resources: - requests: - cpu: 20m - memory: 40Mi - limits: - cpu: 150m - memory: 120Mi - dashboardConfig: - resources: - requests: - cpu: 20m - memory: 30Mi - limits: - cpu: 20m - memory: 80Mi - routerConfig: - resources: - requests: - cpu: 20m - memory: 20Mi - limits: - cpu: 50m - memory: 50Mi - - name: ibm-monitoring-prometheusext-operator - spec: - prometheusExt: - prometheusConfig: - routerResource: - requests: - cpu: 20m - memory: 20Mi - limits: - cpu: 75m - memory: 50Mi - resource: - requests: - cpu: 110m - memory: 3650Mi - limits: - cpu: 130m - memory: 4990Mi - alertManagerConfig: - resource: - requests: - cpu: 20m - memory: 30Mi - limits: - cpu: 30m - memory: 50Mi - mcmMonitor: - resource: - requests: - cpu: 10m - memory: 20Mi - limits: - cpu: 30m - memory: 120Mi diff --git a/config/cloudpaks/cp4aiops/resources/templates/05-installation.yaml b/config/cloudpaks/cp4aiops/resources/templates/05-installation.yaml index 6a1c70d2..baab8dcb 100644 --- a/config/cloudpaks/cp4aiops/resources/templates/05-installation.yaml +++ b/config/cloudpaks/cp4aiops/resources/templates/05-installation.yaml @@ -7,6 +7,15 @@ metadata: name: ibm-cp-watson-aiops namespace: {{.Values.metadata.argocd_app_namespace}} spec: +{{ if or (not ( eq ( default "" .Values.automation_base_instance_name ) "" )) (not ( eq ( default "" .Values.automation_ui_config_instance_name ) "" )) }} + automationFoundation: + {{ if not ( eq ( default "" .Values.automation_base_instance_name ) "" ) }} + automationBase: {{.Values.automation_base_instance_name}} + {{ end }} + {{ if not ( eq ( default "" .Values.automation_ui_config_instance_name ) "" ) }} + automationUIConfig: {{.Values.automation_ui_config_instance_name}} + {{ end }} +{{ end }} license: accept: true pakModules: diff --git a/config/cloudpaks/cp4aiops/resources/templates/99-postsync-check-evt-group.yaml b/config/cloudpaks/cp4aiops/resources/templates/99-postsync-check-evt-group.yaml index dc22ca16..52d0d39c 100644 --- a/config/cloudpaks/cp4aiops/resources/templates/99-postsync-check-evt-group.yaml +++ b/config/cloudpaks/cp4aiops/resources/templates/99-postsync-check-evt-group.yaml @@ -13,13 +13,14 @@ spec: containers: - name: config image: quay.io/openshift/origin-cli:latest + imagePullPolicy: IfNotPresent resources: requests: memory: "64Mi" cpu: "250m" limits: - memory: "128Mi" - cpu: "500m" + memory: "96Mi" + cpu: "300m" env: - name: TARGET_NAMESPACE value: "{{.Values.metadata.argocd_app_namespace}}" diff --git a/config/cloudpaks/cp4aiops/resources/values.yaml b/config/cloudpaks/cp4aiops/resources/values.yaml index 2b740553..93b8c90a 100644 --- a/config/cloudpaks/cp4aiops/resources/values.yaml +++ b/config/cloudpaks/cp4aiops/resources/values.yaml @@ -1,4 +1,6 @@ --- +automation_base_instance_name: "" +automation_ui_config_instance_name: "" serviceaccount: argocd_application_controller: openshift-gitops-argocd-application-controller metadata: diff --git a/config/cloudpaks/cp4i/operators/templates/01-namespaces/individual.yaml b/config/cloudpaks/cp4i/operators/templates/01-namespaces/individual.yaml index bb658695..8f880e45 100644 --- a/config/cloudpaks/cp4i/operators/templates/01-namespaces/individual.yaml +++ b/config/cloudpaks/cp4i/operators/templates/01-namespaces/individual.yaml @@ -2,8 +2,6 @@ apiVersion: v1 kind: Namespace metadata: - annotations: - argocd.argoproj.io/sync-wave: "0" creationTimestamp: null name: {{.Values.metadata.individual_namespace}} spec: {} diff --git a/config/cloudpaks/cp4i/operators/templates/04-operators/00-prereqs/9999-configure-network-policy.yaml b/config/cloudpaks/cp4i/operators/templates/04-operators/00-prereqs/9999-configure-network-policy.yaml index 83aaf677..3912e8bc 100644 --- a/config/cloudpaks/cp4i/operators/templates/04-operators/00-prereqs/9999-configure-network-policy.yaml +++ b/config/cloudpaks/cp4i/operators/templates/04-operators/00-prereqs/9999-configure-network-policy.yaml @@ -17,13 +17,14 @@ spec: containers: - name: config image: quay.io/openshift/origin-cli:latest + imagePullPolicy: IfNotPresent resources: requests: memory: "64Mi" cpu: "250m" limits: - memory: "128Mi" - cpu: "500m" + memory: "96Mi" + cpu: "300m" command: - /bin/sh - -c diff --git a/config/cloudpaks/cp4i/operators/templates/04-operators/99-postsync-check-all-csvs.yaml b/config/cloudpaks/cp4i/operators/templates/04-operators/99-postsync-check-all-csvs.yaml index 60cbbd96..fbfbc2c1 100644 --- a/config/cloudpaks/cp4i/operators/templates/04-operators/99-postsync-check-all-csvs.yaml +++ b/config/cloudpaks/cp4i/operators/templates/04-operators/99-postsync-check-all-csvs.yaml @@ -13,13 +13,14 @@ spec: containers: - name: config image: quay.io/openshift/origin-cli:latest + imagePullPolicy: IfNotPresent resources: requests: memory: "64Mi" cpu: "250m" limits: - memory: "128Mi" - cpu: "500m" + memory: "96Mi" + cpu: "300m" env: - name: TARGET_NAMESPACE value: "{{.Values.argocd_app_namespace}}" diff --git a/config/cloudpaks/cp4i/resources/Chart.yaml b/config/cloudpaks/cp4i/resources/Chart.yaml index bc8c5e68..1a00b26e 100644 --- a/config/cloudpaks/cp4i/resources/Chart.yaml +++ b/config/cloudpaks/cp4i/resources/Chart.yaml @@ -16,7 +16,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.0 +version: 0.3.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/config/cloudpaks/cp4i/resources/templates/05-crds/common-service.yaml b/config/cloudpaks/cp4i/resources/templates/05-crds/common-service.yaml deleted file mode 100644 index 25ba8841..00000000 --- a/config/cloudpaks/cp4i/resources/templates/05-crds/common-service.yaml +++ /dev/null @@ -1,38 +0,0 @@ ---- -# https://github.ibm.com/IBMPrivateCloud/roadmap/issues/48099 -apiVersion: operator.ibm.com/v3 -kind: CommonService -metadata: - annotations: - argocd.argoproj.io/sync-wave: "209" - creationTimestamp: null - name: common-service - namespace: ibm-common-services -spec: - size: small - storageClass: {{.Values.storageclass.rwx}} - services: - - name: ibm-cert-manager-operator - spec: - certManager: - certManagerCAInjector: - resources: - limits: - cpu: 100m - memory: 512Mi - requests: - cpu: 50m - memory: 256Mi - # https://github.ibm.com/cloudpakbringup/cpbringup/issues/546 - # https://www.ibm.com/docs/en/cpfs?topic=templates-linux-x86-64-clusters - - name: ibm-platform-api-operator - spec: - platformApi: - platformApi: - resources: - limits: - cpu: 200m - memory: 512Mi - requests: - cpu: 50m - memory: 128Mi diff --git a/config/rhacm/cloudpaks/Chart.yaml b/config/rhacm/cloudpaks/Chart.yaml index 1374263a..0c77edf4 100644 --- a/config/rhacm/cloudpaks/Chart.yaml +++ b/config/rhacm/cloudpaks/Chart.yaml @@ -16,7 +16,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 +version: 0.2.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/config/rhacm/cloudpaks/templates/policy-cp-shared.yaml b/config/rhacm/cloudpaks/templates/policy-cp-shared.yaml index 2e8d11f9..f52f313a 100644 --- a/config/rhacm/cloudpaks/templates/policy-cp-shared.yaml +++ b/config/rhacm/cloudpaks/templates/policy-cp-shared.yaml @@ -34,7 +34,6 @@ spec: apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - creationTimestamp: null name: cp-shared-app namespace: openshift-gitops spec: diff --git a/config/rhacm/cloudpaks/templates/policy-cp4a.yaml b/config/rhacm/cloudpaks/templates/policy-cp4a.yaml index ebda6d0a..22b330db 100644 --- a/config/rhacm/cloudpaks/templates/policy-cp4a.yaml +++ b/config/rhacm/cloudpaks/templates/policy-cp4a.yaml @@ -34,7 +34,6 @@ spec: apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - creationTimestamp: null name: cp4a-app namespace: openshift-gitops spec: @@ -70,3 +69,29 @@ spec: path: config/argocd-cloudpaks/cp4a repoURL: {{.Values.repoURL}} targetRevision: '{{ "{{ fromClusterClaim \"gitops-branch\" }}" }}' + syncPolicy: + automated: + prune: true + selfHeal: true + - complianceType: musthave + objectDefinition: + apiVersion: argoproj.io/v1alpha1 + kind: Application + metadata: + name: cp4a-operators + namespace: openshift-gitops + spec: + syncPolicy: + automated: + selfHeal: true + - complianceType: musthave + objectDefinition: + apiVersion: argoproj.io/v1alpha1 + kind: Application + metadata: + name: cp4a-resources + namespace: openshift-gitops + spec: + syncPolicy: + automated: + selfHeal: true diff --git a/config/rhacm/cloudpaks/templates/policy-cp4aiops.yaml b/config/rhacm/cloudpaks/templates/policy-cp4aiops.yaml index b2713f5a..9c0a158d 100644 --- a/config/rhacm/cloudpaks/templates/policy-cp4aiops.yaml +++ b/config/rhacm/cloudpaks/templates/policy-cp4aiops.yaml @@ -34,7 +34,6 @@ spec: apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - creationTimestamp: null name: cp4aiops-app namespace: openshift-gitops spec: @@ -64,3 +63,29 @@ spec: path: config/argocd-cloudpaks/cp4aiops repoURL: {{.Values.repoURL}} targetRevision: '{{ "{{ fromClusterClaim \"gitops-branch\" }}" }}' + syncPolicy: + automated: + prune: true + selfHeal: true + - complianceType: musthave + objectDefinition: + apiVersion: argoproj.io/v1alpha1 + kind: Application + metadata: + name: cp4aiops-operators + namespace: openshift-gitops + spec: + syncPolicy: + automated: + selfHeal: true + - complianceType: musthave + objectDefinition: + apiVersion: argoproj.io/v1alpha1 + kind: Application + metadata: + name: cp4aiops-resources + namespace: openshift-gitops + spec: + syncPolicy: + automated: + selfHeal: true diff --git a/config/rhacm/cloudpaks/templates/policy-cp4i.yaml b/config/rhacm/cloudpaks/templates/policy-cp4i.yaml index b070d79a..f7cd6c66 100644 --- a/config/rhacm/cloudpaks/templates/policy-cp4i.yaml +++ b/config/rhacm/cloudpaks/templates/policy-cp4i.yaml @@ -34,7 +34,6 @@ spec: apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - creationTimestamp: null name: cp4i-app namespace: openshift-gitops spec: @@ -64,3 +63,29 @@ spec: path: config/argocd-cloudpaks/cp4i repoURL: {{.Values.repoURL}} targetRevision: '{{ "{{ fromClusterClaim \"gitops-branch\" }}" }}' + syncPolicy: + automated: + prune: true + selfHeal: true + - complianceType: musthave + objectDefinition: + apiVersion: argoproj.io/v1alpha1 + kind: Application + metadata: + name: cp4i-operators + namespace: openshift-gitops + spec: + syncPolicy: + automated: + selfHeal: true + - complianceType: musthave + objectDefinition: + apiVersion: argoproj.io/v1alpha1 + kind: Application + metadata: + name: cp4i-resources + namespace: openshift-gitops + spec: + syncPolicy: + automated: + selfHeal: true diff --git a/config/rhacm/seeds/Chart.yaml b/config/rhacm/seeds/Chart.yaml index 1c245006..b4314b81 100644 --- a/config/rhacm/seeds/Chart.yaml +++ b/config/rhacm/seeds/Chart.yaml @@ -16,7 +16,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 +version: 0.2.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/docs/install.md b/docs/install.md index a8365189..75c379d3 100644 --- a/docs/install.md +++ b/docs/install.md @@ -136,7 +136,7 @@ After completing the list of activities listed in the previous sections, you hav | Revision | HEAD | | Cluster URL | https://kubernetes.default.svc | -1. Under "Parameters", if using OCP 4.6, replace the value of the field `serviceaccount.argocd_application_controller` with the value `openshift-gitops-argocd-application-controller` +1. Under "Parameters", if using OCP 4.6, replace the value of the field `serviceaccount.argocd_application_controller` with the value `argocd-cluster-argocd-application-controller`. 1. After filling out the form details, click the "Create" button @@ -161,7 +161,7 @@ After completing the list of activities listed in the previous sections, you hav 1. After filling out the form details, click the "Create" button -1. Under "Parameters", if using OCP 4.6, replace the value of the field `serviceaccount.argocd_application_controller` with the value `argocd-cluster-argocd-application-controller` +1. Under "Parameters", if using OCP 4.6, replace the value of the field `serviceaccount.argocd_application_controller` with the value `argocd-cluster-argocd-application-controller`. 1. Still under "Parameters", set the values for the fields `storageclass.rwo` and `storageclass.rwx` with the appropriate storage classes. For OpenShift Container Storage, the values will be `ocs-storagecluster-ceph-rbd` and `ocs-storagecluster-cephfs`, respectively. diff --git a/tests/prebuild/lint.sh b/tests/prebuild/lint.sh index ea10221c..45dbfc9e 100755 --- a/tests/prebuild/lint.sh +++ b/tests/prebuild/lint.sh @@ -13,7 +13,6 @@ function log() { echo "$(date +%Y-%m-%dT%H:%M:%S%z): ${msg}" } - yamllint -v > /dev/null 2>&1 \ || { @@ -21,14 +20,33 @@ yamllint -v > /dev/null 2>&1 \ apt-get update && \ { apt-get install yamllint -y \ - || log "ERROR: yamllint installation failed" + || log "ERROR: yamllint installation failed." } } -result=0 +install_helm_3=0 +helm version --short --client > /dev/null 2>&1 || install_helm_3=1 +helm version --short --client | grep "v2" > /dev/null 2>&1 && install_helm_3=1 + +if [ ${install_helm_3} -eq 1 ]; then + log "INFO: Installing helm 3" + WORKDIR=/tmp + curl -sL https://get.helm.sh/helm-v3.5.2-linux-amd64.tar.gz | tar xzf - -C "${WORKDIR}" \ + && install "${WORKDIR}/linux-amd64/helm" /usr/local/bin/helm \ + || log "ERROR: helm 3 installation failed." +fi log "INFO: Starting yamllint run" -yamllint -c "${scriptdir}/yamllint-config.yaml" config/ || result=1 -log "INFO: Completed yamllint run" +yl_result=0 +yamllint -c "${scriptdir}/yamllint-config.yaml" config/ || yl_result=1 +log "INFO: Completed yamllint run: ${yl_result}" + +log "INFO: Starting helm lint run" +hl_result=0 +find . -name Chart.yaml | sed "s|/Chart.yaml||g" | xargs helm lint || hl_result=1 +log "INFO: Completed helm lint run: ${hl_result}" + +result=$((hl_result+yl_result)) +log "INFO: Global test failures: ${result}" exit "${result}" diff --git a/tests/prebuild/yamllint-config.yaml b/tests/prebuild/yamllint-config.yaml index 4edb68f3..0a3f6a99 100644 --- a/tests/prebuild/yamllint-config.yaml +++ b/tests/prebuild/yamllint-config.yaml @@ -3,6 +3,7 @@ ignore: | config/rhacm/cloudpaks/templates/placement-argocd.yaml config/rhacm/cloudpaks/templates/placement-cloudpaks.yaml config/rhacm/cloudpaks/templates/placement-cp-shared.yaml + config/cloudpaks/cp4aiops/resources/templates/05-installation.yaml rules: yaml-files: