Skip to content

Commit

Permalink
chore: Upgrade version of AIOps from 3.2.1 to 3.3 (#139)
Browse files Browse the repository at this point in the history
* chore: Upgrade to AIManager 3.3
  • Loading branch information
nastacio authored Apr 11, 2022
1 parent 91e250b commit 0189860
Show file tree
Hide file tree
Showing 22 changed files with 108 additions and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ kind: Role
metadata:
annotations:
argocd.argoproj.io/sync-wave: "20"
argocd.argoproj.io/sync-options: "Replace=true"
creationTimestamp: null
name: ibm-aiops-aimgr-role
namespace: "{{.Values.metadata.argocd_app_namespace}}"
Expand All @@ -19,9 +20,9 @@ rules:
- apiGroups: [""]
resources: ["serviceaccounts"]
verbs: ["get", "list", "create", "update", "patch"]
- apiGroups: ["base.automation.ibm.com"]
resources: ["automationbases"]
verbs: ["get", "list"]
- apiGroups: ["ai-manager.watson-aiops.ibm.com", "ai.ir.aiops.ibm.com", "asm.ibm.com", "base.automation.ibm.com", "connectors.aiops.ibm.com", "consoleui.aiops.ibm.com", "core.ir.aiops.ibm.com", "lifecycle.ir.aiops.ibm.com","orchestrator.aiops.ibm.com"]
resources: ["*"]
verbs: ["get", "list", "watch"]
- apiGroups: ["core.automation.ibm.com"]
resources: ["automationuiconfigs"]
verbs: ["get", "list", "patch"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
annotations:
argocd.argoproj.io/sync-options: "Replace=true"
argocd.argoproj.io/sync-wave: "20"
creationTimestamp: null
name: ibm-aiops-emgr-role
Expand All @@ -13,6 +14,9 @@ rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list", "create", "update", "patch", "delete"]
- apiGroups: [""]
resources: ["serviceaccounts"]
verbs: ["get", "list", "create", "update", "patch", "delete"]
- apiGroups: ["cem.ibm.com"]
resources: ["cemformations"]
verbs: ["get"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ kind: RoleBinding
metadata:
annotations:
argocd.argoproj.io/sync-wave: "21"
argocd.argoproj.io/sync-options: "Replace=true"
creationTimestamp: null
name: ibm-aiops-emgr-binding
namespace: "{{.Values.metadata.argocd_app_namespace}}-emgr"
Expand Down
4 changes: 2 additions & 2 deletions config/argocd/templates/0200-argocd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: argoproj.io/v1alpha1
kind: ArgoCD
metadata:
annotations:
argocd.argoproj.io/sync-options: "Replace=true"
argocd.argoproj.io/sync-wave: "200"
creationTimestamp: null
finalizers:
Expand Down Expand Up @@ -328,9 +329,8 @@ spec:
hs.message = obj.status.phase
if obj.status.phase == "OK" then
hs.status = "Healthy"
elseif obj.status.phase == "Failed" then
elseif obj.status.phase == "Error" then
hs.status = "Degraded"
hs.message = obj.status.failureMessage
else
hs.status = "Progressing"
end
Expand Down
4 changes: 2 additions & 2 deletions config/cloudpaks/cp4aiops/install-aimgr/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ 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.7.1
version: 0.7.2

# 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
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: "3.2.1"
appVersion: "3.3.0"
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ spec:
- 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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ spec:
- 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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ spec:
- name: config
image: quay.io/openshift/origin-cli:latest
imagePullPolicy: IfNotPresent
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "96Mi"
cpu: "300m"
env:
- name: TARGET_NAMESPACE
value: "{{.Values.metadata.argocd_app_namespace}}"
Expand All @@ -40,9 +33,9 @@ spec:
operation_limit_seconds=$(( $(date +%s) + 7200 ))
pods_found=0
while [ ${current_seconds} -lt ${operation_limit_seconds} ]; do
if oc get pods \
-l app.kubernetes.io/managed-by=ibm-elastic-operator \
-n "${TARGET_NAMESPACE}" &&
if oc get AIOpsAnalyticsOrchestrator \
-l app.kubernetes.io/instance=aiops \
-n "${TARGET_NAMESPACE}" &&
oc get route -n "${TARGET_NAMESPACE}" cpd; then
pods_found=1
else
Expand All @@ -59,23 +52,34 @@ spec:
done
echo "INFO: Checking AI Manager resources."
oc wait pods \
-l app.kubernetes.io/managed-by=ibm-elastic-operator \
oc wait AIOpsAnalyticsOrchestrator \
-l app.kubernetes.io/instance=aiops \
-n "${TARGET_NAMESPACE}" \
--for=condition=Ready=true \
--for condition=Ready=true \
--timeout="${WAIT_TIME}" \
|| result=1
if [ ${result} -eq 0 ]; then
echo "INFO: All AI Manager resources are ready."
else
echo "ERROR: AI Manager resources not ready after specified period."
oc get pods \
-l app.kubernetes.io/managed-by=ibm-elastic-operator \
-n "${TARGET_NAMESPACE}" || result=1
oc describe route -n "${TARGET_NAMESPACE}" cpd || result=1
oc get AIOpsAnalyticsOrchestrator \
-l app.kubernetes.io/instance=aiops \
-n "${TARGET_NAMESPACE}" || result=1
oc get route -n "${TARGET_NAMESPACE}" cpd || result=1
fi
echo "INFO: Verification steps from the guide: https://www.ibm.com/docs/en/cloud-paks/cloud-pak-watson-aiops/3.3.0?topic=installation-online-cli#verify"
oc get installations.orchestrator.aiops.ibm.com -n "${TARGET_NAMESPACE}" \
&& echo "" \
&& oc get ircore,AIOpsAnalyticsOrchestrator -n "${TARGET_NAMESPACE}" -o custom-columns="KIND:kind,NAMESPACE:metadata.namespace,NAME:metadata.name,STATUS:status.conditions[?(@.type==\"Ready\")].reason" \
&& echo "" \
&& oc get lifecycleservice -n "${TARGET_NAMESPACE}" -o custom-columns="KIND:kind,NAMESPACE:metadata.namespace,NAME:metadata.name,STATUS:status.conditions[?(@.type==\"Lifecycle Service Ready\")].reason" \
&& echo "" \
&& oc get BaseUI -n "${TARGET_NAMESPACE}" -o custom-columns="KIND:kind,NAMESPACE:metadata.namespace,NAME:metadata.name,STATUS:status.conditions[?(@.type==\"Ready\")].reason" \
&& echo "" \
&& oc get AIManager,aiopsedge,asm -n "${TARGET_NAMESPACE}" -o custom-columns="KIND:kind,NAMESPACE:metadata.namespace,NAME:metadata.name,STATUS:status.phase"
exit "${result}"
restartPolicy: Never
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ spec:
- name: config
image: quay.io/openshift/origin-cli:latest
imagePullPolicy: IfNotPresent
resources:
requests:
memory: "384Mi"
cpu: "200m"
limits:
memory: "384Mi"
cpu: "200m"
env:
- name: ARGOCD_NAMESPACE
value: "openshift-gitops"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ spec:
- name: config
image: quay.io/openshift/origin-cli:latest
imagePullPolicy: IfNotPresent
resources:
requests:
memory: "256Mi"
cpu: "200m"
limits:
memory: "256Mi"
cpu: "250m"
env:
- name: ARGOCD_NAMESPACE
value: openshift-gitops
Expand Down Expand Up @@ -57,7 +50,7 @@ spec:
fi \
|| result=1
oc get ServiceAccount aiops-topology-service-account --namespace "{{.Values.metadata.argocd_app_namespace}}" -o yaml 2> /dev/null \
oc get ServiceAccount aiops-topology-service-account --namespace "${TARGET_NAMESPACE}" -o yaml 2> /dev/null \
&& echo "INFO: Topology service account exists." \
|| {
echo "INFO: Create the topology service account with the entitlement key pull secret."
Expand All @@ -66,13 +59,13 @@ spec:
kind: ServiceAccount
metadata:
name: aiops-topology-service-account
namespace: "{{.Values.metadata.argocd_app_namespace}}"
namespace: "${TARGET_NAMESPACE}"
labels:
managedByUser: "true"
imagePullSecrets:
- name: ibm-entitlement-key
EOF
oc apply -n "{{.Values.metadata.argocd_app_namespace}}" -f /tmp/sa.yaml \
oc apply -n "${TARGET_NAMESPACE}" -f /tmp/sa.yaml \
&& echo "INFO: Create the topology service account with the entitlement key pull secret." \
|| result=1
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
name: ibm-aiops-orchestrator
namespace: "{{.Values.metadata.argocd_app_namespace}}"
spec:
channel: v3.2
channel: v3.3
installPlanApproval: Automatic
name: ibm-aiops-orchestrator
source: ibm-operator-catalog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ spec:
- name: config
image: quay.io/openshift/origin-cli:latest
imagePullPolicy: IfNotPresent
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "96Mi"
cpu: "300m"
env:
- name: TARGET_NAMESPACE
value: "{{.Values.metadata.argocd_app_namespace}}"
Expand Down
4 changes: 2 additions & 2 deletions config/cloudpaks/cp4aiops/install-emgr/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ 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.7.1
version: 0.7.2

# 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
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: "3.2.1"
appVersion: "3.3.0"
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ spec:
openstack: false
vmwarensx: false
netDisco: false
version: 1.6.3.2
version: {{.Values.spec.version}}
entitlementSecret: noi-registry-secret
clusterDomain: {{.Values.cluster_domain}}
integrations:
Expand Down Expand Up @@ -116,4 +116,6 @@ spec:
storageSizeImpactGUI: 5Gi
storageSizeElastic: 75Gi
storageClassNCOBackup: {{.Values.storageclass.rwo}}
deploymentType: trial
helmValuesNOI:
"global.rbac.createSCC": false
deploymentType: {{.Values.spec.deployment_type}}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ kind: Role
metadata:
annotations:
argocd.argoproj.io/sync-wave: "20"
argocd.argoproj.io/sync-options: "Replace=true"
creationTimestamp: null
name: argocd-cp4aiops-emgr-role
namespace: "{{.Values.metadata.argocd_app_namespace}}"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations:
argocd.argoproj.io/sync-wave: "20"
argocd.argoproj.io/sync-options: "Replace=true"
creationTimestamp: null
name: ibm-aiops-emgr-cluster-role
namespace: "{{.Values.metadata.argocd_app_namespace}}-emgr"
rules:
- apiGroups: ["rbac.authorization.k8s.io"]
resources: ["clusterrolebindings"]
verbs: ["get", "create"]
- apiGroups: ["security.openshift.io"]
resources: ["securitycontextconstraints"]
verbs: ["get", "use"]
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ kind: RoleBinding
metadata:
annotations:
argocd.argoproj.io/sync-wave: "21"
argocd.argoproj.io/sync-options: "Replace=true"
creationTimestamp: null
name: argocd-cp4aiops-emgr-binding
namespace: "{{.Values.metadata.argocd_app_namespace}}"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
annotations:
argocd.argoproj.io/sync-wave: "21"
argocd.argoproj.io/sync-options: "Replace=true"
creationTimestamp: null
name: ibm-aiops-emgr-cluster-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: ibm-aiops-emgr-cluster-role
subjects:
- kind: ServiceAccount
name: "{{.Values.serviceaccount.ibm_cloudpaks_installer}}"
namespace: "{{.Values.metadata.argocd_namespace}}"
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ spec:
- name: config
image: quay.io/openshift/origin-cli:latest
imagePullPolicy: IfNotPresent
resources:
requests:
memory: "64Mi"
cpu: "200m"
limits:
memory: "64Mi"
cpu: "250m"
env:
- name: ARGOCD_NAMESPACE
value: openshift-gitops
Expand All @@ -35,6 +28,7 @@ spec:
set -eo pipefail
set -x
result=0
# https://www.ibm.com/docs/en/cloud-paks/cloud-pak-watson-aiops/3.2.0?topic=em-starter-installation
oc extract secret/"${IBM_ENTITLEMENT_SECRET}" \
--namespace "${ARGOCD_NAMESPACE}" \
Expand All @@ -55,11 +49,32 @@ spec:
oc patch namespace default --type=json -p '[{"op":"add","path":"/metadata/labels","value":{"network.openshift.io/policy-group":"ingress"}}]'
fi \
&& echo "INFO: Event Manager prereq configuration successful." \
|| result=1
# https://www.ibm.com/docs/en/noi/1.6.4?topic=preparing-your-cluster
oc get ServiceAccount noi-service-account --namespace "${TARGET_NAMESPACE}" -o yaml 2> /dev/null \
&& echo "INFO: NOI service account exists." \
|| {
echo "ERROR: Event Manager prereq configuration failed."
exit 1
echo "INFO: Create the NOI service account with the entitlement key pull secret."
oc create serviceaccount noi-service-account -n "${TARGET_NAMESPACE}" \
&& oc adm policy add-scc-to-user privileged system:serviceaccount:${TARGET_NAMESPACE}:noi-service-account \
&& oc patch serviceaccount noi-service-account -p '{"imagePullSecrets": [{"name": "noi-registry-secret"}]}' -n "${TARGET_NAMESPACE}" \
&& oc get sa noi-service-account -n "${TARGET_NAMESPACE}" \
|| result=1
if [ ! ${result} -eq 0 ]; then
oc delete ServiceAccount noi-service-account --namespace "${TARGET_NAMESPACE}"
fi
}
if [ ${result} -eq 0 ]; then
echo "INFO: Event Manager prereq configuration successful."
else
echo "ERROR: Event Manager prereq configuration failed."
fi
exit ${result}
restartPolicy: Never
serviceAccountName: {{.Values.serviceaccount.ibm_cloudpaks_installer}}
backoffLimit: 1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
name: noi
namespace: "{{.Values.metadata.argocd_app_namespace}}"
spec:
channel: v1.5
channel: v1.7
installPlanApproval: Automatic
name: noi
source: ibm-operator-catalog
Expand Down
Loading

0 comments on commit 0189860

Please sign in to comment.