Skip to content

Commit

Permalink
Merge branch 'master' into sls-rr
Browse files Browse the repository at this point in the history
  • Loading branch information
rawa-resul authored Jan 24, 2025
2 parents 858e681 + 651a422 commit 3a79cde
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 24 deletions.
12 changes: 11 additions & 1 deletion .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
"hashed_secret": "b2817467154949a61f8e9ad31d1eeaf03221cbfa",
"is_secret": false,
"is_verified": false,
"line_number": 395,
"line_number": 403,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down Expand Up @@ -399,6 +399,16 @@
"verified_result": null
}
],
"image/cli/mascli/templates/gitops/appset-configs/cluster/cluster-logging-operator.yaml.j2": [
{
"hashed_secret": "fee2d55ad9a49a95fc89abe8f414dad66704ebfd",
"is_secret": false,
"is_verified": false,
"line_number": 5,
"type": "Secret Keyword",
"verified_result": null
}
],
"image/cli/mascli/templates/gitops/appset-configs/cluster/falcon-operator.yaml.j2": [
{
"hashed_secret": "fee2d55ad9a49a95fc89abe8f414dad66704ebfd",
Expand Down
8 changes: 6 additions & 2 deletions docs/catalogs/v9-250109-amd64.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,13 @@ IBM Maximo Application Suite will run anywhere that you can run a supported Open
<td>Compatible</td>
</tr>
<tr>
<td class="firstColumn"><a href="https://aws.amazon.com/rosa/">Red Hat OpenShift Service on AWS</a></td>
<td class="firstColumn"><a href="https://aws.amazon.com/rosa/">Red Hat OpenShift Service on AWS (Classic)</a></td>
<td>Certified</td>
</tr>
<tr>
<td class="firstColumn"><a href="https://aws.amazon.com/rosa/">Red Hat OpenShift Service on AWS (HCP)</a></td>
<td>Compatible</td>
</tr>
<tr>
<td class="firstColumn"><a href="https://azure.microsoft.com/en-gb/services/openshift/">Azure Red Hat OpenShift</a></td>
<td>Compatible</td>
Expand Down Expand Up @@ -687,4 +691,4 @@ Package Manifest
### Eclipse Amlen
| Package | Default Channel | Channel | Latest Version |
|------------------------|-------------------|-----------|---------------------------------------------------|
| eclipse-amlen-operator | 1.x | 1.x | [1.1.2](packages/eclipse-amlen-operator/1.1.2.md) |
| eclipse-amlen-operator | 1.x | 1.x | [1.1.2](packages/eclipse-amlen-operator/1.1.2.md) |
30 changes: 30 additions & 0 deletions image/cli/mascli/functions/gitops_cluster
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ IBM RBAC (Optional):
CrowdStrike Falcon Operator (Optional):
--install-falcon-operator ${COLOR_YELLOW}INSTALL_FALCON_OPERATOR${TEXT_RESET} Install the CrowdStrike Falcon Operator
Cluster Logging Operator (Optional):
--install-cluster-logging-operator ${COLOR_YELLOW}CLUSTER_LOGGING_OPERATOR_INSTALL${TEXT_RESET} Install the Cluster Logging Operator
Other Commands:
-h, --help Show this help message
EOM
Expand Down Expand Up @@ -276,6 +279,11 @@ function gitops_cluster_noninteractive() {
export INSTALL_FALCON_OPERATOR=true
;;

# Cluster Logging Operator
--install-cluster-logging-operator)
export CLUSTER_LOGGING_OPERATOR_INSTALL=true
;;

# Other Commands
-h|--help)
gitops_cluster_help
Expand Down Expand Up @@ -467,6 +475,12 @@ function gitops_cluster() {
echo_reset_dim "Install the CrowdStrike Falcon Operator ........... ${COLOR_MAGENTA}${INSTALL_FALCON_OPERATOR}"
reset_colors

echo "${TEXT_DIM}"
echo_h2 "Cluster Logging Operator" " "
echo_reset_dim "Install the Cluster Logging Operator ........... ${COLOR_MAGENTA}${CLUSTER_LOGGING_OPERATOR_INSTALL}"
echo_reset_dim "Use Syslog Forwarder ........... ${COLOR_MAGENTA}${CLUSTER_LOGGING_OPERATOR_USE_SYSLOG_FORWARDER}"
reset_colors

# Set up secrets
# ---------------------------------------------------------------------------
echo
Expand All @@ -491,6 +505,10 @@ function gitops_cluster() {
export SECRET_KEY_FALCON_CLIENT_ID=${SECRET_NAME_FALCON_CLIENT}#client_id
export SECRET_KEY_FALCON_CLIENT_SECRET=${SECRET_NAME_FALCON_CLIENT}#client_secret

export SECRET_NAME_CLOUDWATCH=${ACCOUNT_ID}${SM_DELIM}${CLUSTER_ID}${SM_DELIM}cloudwatch
export SECRET_KEY_CLOUDWATCH_AWS_SECRET_ACCESS_KEY=${SECRET_NAME_CLOUDWATCH}#aws_secret_access_key
export SECRET_KEY_CLOUDWATCH_AWS_ACCESS_KEY_ID=${SECRET_NAME_CLOUDWATCH}#aws_access_key_id

if [ -n "$DEVOPS_MONGO_URI" ];then
echo "- Update DEVOPS_MONGO_URI secret"
TAGS="[{\"Key\": \"source\", \"Value\": \"gitops_cluster\"}, {\"Key\": \"account\", \"Value\": \"${ACCOUNT_ID}\"}, {\"Key\": \"cluster\", \"Value\": \"${CLUSTER_ID}\"}]"
Expand All @@ -509,6 +527,12 @@ function gitops_cluster() {
sm_update_secret $SECRET_NAME_FALCON_CLIENT "{\"client_id\": \"${FALCON_CLIENT_ID}\", \"client_secret\": \"${FALCON_CLIENT_SECRET}\"}" "${TAGS}"
fi

if [ -n "$CLOUDWATCH_AWS_SECRET_ACCESS_KEY" ] && [ -n "$CLOUDWATCH_AWS_ACCESS_KEY_ID" ]; then
echo "- Update CLOUDWATCH_AWS_SECRET_ACCESS_KEY and CLOUDWATCH_AWS_ACCESS_KEY_ID secrets"
TAGS="[{\"Key\": \"source\", \"Value\": \"gitops_cluster\"}, {\"Key\": \"account\", \"Value\": \"${ACCOUNT_ID}\"}, {\"Key\": \"cluster\", \"Value\": \"${CLUSTER_ID}\"}]"
sm_update_secret $SECRET_NAME_CLOUDWATCH "{\"aws_secret_access_key\": \"${CLOUDWATCH_AWS_SECRET_ACCESS_KEY}\", \"aws_access_key_id\": \"${CLOUDWATCH_AWS_ACCESS_KEY_ID}\"}" "${TAGS}"
fi

if [ -z $GIT_SSH ]; then
export GIT_SSH="false"
fi
Expand Down Expand Up @@ -621,6 +645,12 @@ function gitops_cluster() {
jinja -X .+ $CLI_DIR/templates/gitops/appset-configs/cluster/falcon-operator.yaml.j2 -o ${GITOPS_CLUSTER_DIR}/falcon-operator.yaml
fi

if [[ -n "$CLUSTER_LOGGING_OPERATOR_INSTALL" ]]; then
echo "- Cluster Logging Operator"
sm_verify_secret_exists $SECRET_NAME_CLOUDWATCH "aws_access_key_id,aws_secret_access_key"
jinja -X .+ $CLI_DIR/templates/gitops/appset-configs/cluster/cluster-logging-operator.yaml.j2 -o ${GITOPS_CLUSTER_DIR}/cluster-logging-operator.yaml
fi

# Commit and push to github target repo
# ---------------------------------------------------------------------------
if [ "$GITHUB_PUSH" == "true" ]; then
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
merge-key: "{{ ACCOUNT_ID }}/{{ CLUSTER_ID }}"

cluster_logging_operator:
install: "{{ CLUSTER_LOGGING_OPERATOR_INSTALL }}"
aws_secret_access_key: "<path:{{ SECRETS_PATH }}:{{ SECRET_KEY_CLOUDWATCH_AWS_SECRET_ACCESS_KEY }}>"
aws_access_key_id: "<path:{{ SECRETS_PATH }}:{{ SECRET_KEY_CLOUDWATCH_AWS_ACCESS_KEY_ID }}>"
use_syslog_forwarder: "{{ CLUSTER_LOGGING_OPERATOR_USE_SYSLOG_FORWARDER }}"
59 changes: 38 additions & 21 deletions python/src/mas/cli/install/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,23 +165,29 @@ def formatRelease(self, release: str) -> str:
@logMethodCall
def processCatalogChoice(self) -> list:
self.catalogDigest = self.chosenCatalog["catalog_digest"]
self.catalogCp4dVersion = self.chosenCatalog["cpd_product_version_default"]
self.catalogMongoDbVersion = self.chosenCatalog["mongo_extras_version_default"]
if self.architecture != "s390x":
self.catalogCp4dVersion = self.chosenCatalog["cpd_product_version_default"]

applications = {
"Core": "mas_core_version",
"Manage": "mas_manage_version",
"IoT": "mas_iot_version",
"Monitor": "mas_monitor_version",
"Assist": "mas_assist_version",
"Optimizer": "mas_optimizer_version",
"Predict": "mas_predict_version",
"Inspection": "mas_visualinspection_version",
}
else:
applications = {
"Core": "mas_core_version",
"Manage": "mas_manage_version",
}

self.catalogReleases = []
self.catalogTable = []

applications = {
"Core": "mas_core_version",
"Manage": "mas_manage_version",
"IoT": "mas_iot_version",
"Monitor": "mas_monitor_version",
"Assist": "mas_assist_version",
"Optimizer": "mas_optimizer_version",
"Predict": "mas_predict_version",
"Inspection": "mas_visualinspection_version",
}

# Dynamically fetch the channels from the chosen catalog
# based on mas core
for channel in self.chosenCatalog["mas_core_version"]:
Expand All @@ -191,15 +197,26 @@ def processCatalogChoice(self) -> list:
for application, key in applications.items():
self.catalogTable.append({"": application} | self.chosenCatalog[key])

summary = [
"",
"<u>Catalog Details</u>",
f"Catalog Image: icr.io/cpopen/ibm-maximo-operator-catalog:{self.getParam('mas_catalog_version')}",
f"Catalog Digest: {self.catalogDigest}",
f"MAS Releases: {', '.join(self.catalogReleases)}",
f"Cloud Pak for Data: {self.catalogCp4dVersion}",
f"MongoDb: {self.catalogMongoDbVersion}",
]
if self.architecture == "s390x":
summary = [
"",
"<u>Catalog Details</u>",
f"Catalog Image: icr.io/cpopen/ibm-maximo-operator-catalog:{self.getParam('mas_catalog_version')}",
f"Catalog Digest: {self.catalogDigest}",
f"MAS Releases: {', '.join(self.catalogReleases)}",
f"MongoDb: {self.catalogMongoDbVersion}",
]
else:
summary = [
"",
"<u>Catalog Details</u>",
f"Catalog Image: icr.io/cpopen/ibm-maximo-operator-catalog:{self.getParam('mas_catalog_version')}",
f"Catalog Digest: {self.catalogDigest}",
f"MAS Releases: {', '.join(self.catalogReleases)}",
f"Cloud Pak for Data: {self.catalogCp4dVersion}",
f"MongoDb: {self.catalogMongoDbVersion}",
]

return summary

@logMethodCall
Expand Down
14 changes: 14 additions & 0 deletions tekton/src/pipelines/gitops/gitops-mas-cluster.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,14 @@ spec:
- name: falcon_operator_node_sensor
type: string
default: ''

- name: cluster_logging_operator_install
type: string
default: 'false'
- name: cluster_logging_operator_use_syslog_forwarder
type: string
default: 'true'

tasks:
- name: gitops-cluster
params:
Expand Down Expand Up @@ -257,6 +265,12 @@ spec:
value: $(params.falcon_operator_cloud_region)
- name: falcon_operator_node_sensor
value: $(params.falcon_operator_node_sensor)

- name: cluster_logging_operator_install
value: $(params.cluster_logging_operator_install)
- name: cluster_logging_operator_use_syslog_forwarder
value: $(params.cluster_logging_operator_use_syslog_forwarder)

taskRef:
kind: Task
name: gitops-cluster
Expand Down
12 changes: 12 additions & 0 deletions tekton/src/tasks/gitops/gitops-cluster.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ spec:
type: string
default: ''

- name: cluster_logging_operator_install
type: string
default: 'false'
- name: cluster_logging_operator_use_syslog_forwarder
type: string
default: 'true'

stepTemplate:
name: gitops-cluster
env:
Expand Down Expand Up @@ -195,6 +202,11 @@ spec:
- name: FALCON_OPERATOR_NODE_SENSOR
value: $(params.falcon_operator_node_sensor)

- name: CLUSTER_LOGGING_OPERATOR_INSTALL
value: $(params.cluster_logging_operator_install)
- name: CLUSTER_LOGGING_OPERATOR_USE_SYSLOG_FORWARDER
value: $(params.cluster_logging_operator_use_syslog_forwarder)

envFrom:
- configMapRef:
name: environment-properties
Expand Down

0 comments on commit 3a79cde

Please sign in to comment.