Skip to content

Commit 83eb278

Browse files
authored
IDM MAA bug fixes (#182)
1 parent 76a0eb6 commit 83eb278

File tree

11 files changed

+42
-18
lines changed

11 files changed

+42
-18
lines changed

FMWKubernetesMAA/OracleEnterpriseDeploymentAutomation/OracleIdentityManagement/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ These can include registry prefixes if you use a registry. Use the `local/` pref
323323
|**OAA\_MGT\_IMAGE** | `$REGISTRY/oracle/oaa-mgmt` | The OAA Management container image.|
324324
|**KUBECTL\_REPO** | `bitnami/kubectl` | The kubectl image used by OUD.|
325325
|**BUSYBOX\_REPO** | `docker.io/busybox` | The busybox image used by OUD.|
326+
|**PROM\_REPO** | | If you are using your own container registry and have staged the Prometheus and Grafana images in this registry then set this variable to the location of your registry. Leave blank if you wish to obtain the images from the public repositories.|
326327
|**OPER\_VER** | `4.0.4` | The version of the WebLogic Kubernetes Operator.|
327328
|**OUD\_VER** | `12.2.1.4.0-8-ol7-210715.1921` | The OUD version.|
328329
|**OUDSM\_VER** | `12.2.1.4.0-8-ol7-210721.0755` | The OUDSM version.|
@@ -503,7 +504,7 @@ These parameters determine how OAM is deployed and configured.
503504
|**OAM\_OAP\_HOST** | `k8worker1.example.com` | The name of one of the Kubernetes worker nodes used for OAP calls.|
504505
|**OAM\_OAP\_PORT** | `5575` | The internal Kubernetes port used for OAM requests.|
505506
|**OAMSERVER\_JAVA\_PARAMS** | "`-Xms2048m -Xmx8192m`" | The internal Kubernetes port used for OAM requests.|
506-
|**COPY\_WG\_FILES** | "`true`" | Set to true if you wish the deployment to copy the Webate Artifacts to your Oracle HTTP Server(s)|
507+
|**COPY\_WG\_FILES** | `true` | Set to true if you wish the deployment to copy the WebGate Artifacts to your Oracle HTTP Server(s)|
507508

508509
### OIG Parameters
509510
These parameters determine how OIG is provisioned and configured.
@@ -596,7 +597,7 @@ These parameters determine how OAA is provisioned and configured.
596597
|**OAANS** |`oaans`| The Kubernetes namespace used to hold the OAA objects.|
597598
|**OAA\_DEPLOYMENT** |`edg`| A name for your OAA deployment. Do not use the name `oaa` because this is reserved for internal use.|
598599
|**OAA\_DOMAIN** |`OAADomain`| The name of the OAM OAuth domain you want to create.|
599-
|**OAA\_VAULT\_TYPE** |`file|oci`| The type of vault to use: file system or OCI.|
600+
|**OAA\_VAULT\_TYPE** |`file or oci`| The type of vault to use: file system or OCI.|
600601
|**OAA\_CREATE\_OHS** |`true`| Set to `false` if you are installing OAA standalone front ended by Ingress. |
601602
|**OAA\_CONFIG\_SHARE** |`$IAM_PVS/oaaconfigpv`| The mount point on NFS where OAA config persistent volume is exported.|
602603
|**OAA\_CRED\_SHARE** |`$IAM_PVS/oaacredpv`| The mount point on NFS where OAA credentials persistent volume is exported.|

FMWKubernetesMAA/OracleEnterpriseDeploymentAutomation/OracleIdentityManagement/common/oam_functions.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,10 @@ enable_monitor()
891891
ENC_WEBLOGIC_PWD=`encode_pwd $OAM_WEBLOGIC_PWD`
892892

893893

894+
PROM_REL=$(kubectl get prometheuses.monitoring.coreos.com --all-namespaces -o jsonpath="{.items[*].spec.serviceMonitorSelector}" | tr '"{}' ' ' | cut -f3 -d: | sed 's/ //g ')
895+
896+
cp $WORKDIR/samples/monitoring-service/manifests/wls-exporter-ServiceMonitor.yaml.template $WORKDIR/samples/monitoring-service/manifests/wls-exporter-ServiceMonitor.yaml
897+
replace_value2 release $PROM_REL $WORKDIR/samples/monitoring-service/manifests/wls-exporter-ServiceMonitor.yaml
894898
replace_value2 domainName $OAM_DOMAIN_NAME $WORKDIR/samples/monitoring-service/manifests/wls-exporter-ServiceMonitor.yaml
895899
replace_value2 namespace $OAMNS $WORKDIR/samples/monitoring-service/manifests/wls-exporter-ServiceMonitor.yaml
896900
sed -i "/namespaceSelector/,/-/{s/-.*/- $OAMNS/}" $WORKDIR/samples/monitoring-service/manifests/wls-exporter-ServiceMonitor.yaml

FMWKubernetesMAA/OracleEnterpriseDeploymentAutomation/OracleIdentityManagement/common/oig_functions.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,10 @@ enable_monitor()
10821082
ENC_WEBLOGIC_USER=`encode_pwd $OIG_WEBLOGIC_USER`
10831083
ENC_WEBLOGIC_PWD=`encode_pwd $OIG_WEBLOGIC_PWD`
10841084

1085+
PROM_REL=$(kubectl get prometheuses.monitoring.coreos.com --all-namespaces -o jsonpath="{.items[*].spec.serviceMonitorSelector}" | tr '"{}' ' ' | cut -f3 -d: | sed 's/ //g ')
10851086

1087+
cp $WORKDIR/samples/monitoring-service/manifests/wls-exporter-ServiceMonitor.yaml.template $WORKDIR/samples/monitoring-service/manifests/wls-exporter-ServiceMonitor.yaml
1088+
replace_value2 release $PROM_REL $WORKDIR/samples/monitoring-service/manifests/wls-exporter-ServiceMonitor.yaml
10861089
replace_value2 domainName $OIG_DOMAIN_NAME $WORKDIR/samples/monitoring-service/manifests/wls-exporter-ServiceMonitor.yaml
10871090
replace_value2 namespace $OIGNS $WORKDIR/samples/monitoring-service/manifests/wls-exporter-ServiceMonitor.yaml
10881091
sed -i "/namespaceSelector/,/-/{s/-.*/- $OIGNS/}" $WORKDIR/samples/monitoring-service/manifests/wls-exporter-ServiceMonitor.yaml

FMWKubernetesMAA/OracleEnterpriseDeploymentAutomation/OracleIdentityManagement/common/prom_functions.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright (c) 2022, Oracle and/or its affiliates.
2+
# Copyright (c) 2022, 2023, Oracle and/or its affiliates.
33
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
#
55
# This is an example of Prometheus functions and procedures used by the provisioning and deletion scripts
@@ -47,12 +47,15 @@ create_override()
4747
update_variable "<PROM_K8>" $PROM_K8 $filename
4848
update_variable "<PROM_GRAF_K8>" $PROM_GRAF_K8 $filename
4949
update_variable "<OHS_HOST1>" $OHS_HOST1 $filename
50+
if [ ! "$PROM_REPO" = "" ]
51+
then
52+
sed -i "/^alert/i global:\n imageRegistry: $PROM_REPO\n imagePullSecrets:\n - name: regcred\n" $filename
53+
fi
5054
if [ ! "$OHS_HOST2" = "" ]
5155
then
5256
update_variable "<OHS_HOST2>" $OHS_HOST2 $filename
5357
fi
5458
update_variable "<PROM_ADMIN_PWD>" $PROM_ADMIN_PWD $filename
55-
5659
print_status $?
5760

5861
ET=`date +%s`
@@ -68,7 +71,12 @@ deploy_prometheus()
6871
print_msg "Deploying Prometheus"
6972

7073
cd $WORKDIR
71-
helm install -n $PROMNS kube-prometheus prometheus-community/kube-prometheus-stack -f $WORKDIR/override_prom.yaml > $LOGDIR/deploy.log 2>&1
74+
if [ "$PROM_REPO" = "" ]
75+
then
76+
helm install -n $PROMNS kube-prometheus prometheus-community/kube-prometheus-stack -f $WORKDIR/override_prom.yaml > $LOGDIR/deploy.log 2>&1
77+
else
78+
helm install -n $PROMNS --set grafana.image.repository=$PROM_REPO/grafana/grafana kube-prometheus prometheus-community/kube-prometheus-stack -f $WORKDIR/override_prom.yaml > $LOGDIR/deploy.log 2>&1
79+
fi
7280
print_status $? $LOGDIR/deploy.log
7381

7482
ET=`date +%s`

FMWKubernetesMAA/OracleEnterpriseDeploymentAutomation/OracleIdentityManagement/oke_utils/common/oci_create_functions.sh

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ createBastion() {
192192
if [[ $STEPNO -gt $PROGRESS ]]; then
193193
ST=`date +%s`
194194
print_msg begin "Copying the ssh keyfile '$SSH_ID_KEYFILE' to the Bastion Node..."
195-
id=$(cat $RESOURCE_OCID_FILE | grep $BASTION_INSTANCE_DISPLAY_NAME | cut -d: -f2)
195+
id=$(cat $RESOURCE_OCID_FILE | grep $BASTION_INSTANCE_DISPLAY_NAME: | cut -d: -f2)
196196
ip=$(oci compute instance list-vnics --region $REGION --compartment-id $COMPARTMENT_ID --instance-id $id \
197197
--query 'data[0]."public-ip"' --raw-output)
198198
cmd="scp -q -o \"StrictHostKeyChecking no\" -i $SSH_ID_KEYFILE $SSH_ID_KEYFILE opc@$ip:~/.ssh/id_rsa"

FMWKubernetesMAA/OracleEnterpriseDeploymentAutomation/OracleIdentityManagement/oke_utils/common/oci_util_functions.sh

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ formatShapeConfig() {
209209

210210
# Retrieve the IP address of the bastion host given its ocid
211211
get_bastion_ip() {
212-
id=$(cat $RESOURCE_OCID_FILE | grep $BASTION_INSTANCE_DISPLAY_NAME | cut -d: -f2)
212+
id=$(cat $RESOURCE_OCID_FILE | grep $BASTION_INSTANCE_DISPLAY_NAME: | cut -d: -f2)
213213
BASTIONIP=$(oci compute instance list-vnics --region $REGION --compartment-id $COMPARTMENT_ID --instance-id $id \
214214
--query 'data[0]."public-ip"' --raw-output)
215215
if [[ "$?" != "0" ]]; then

FMWKubernetesMAA/OracleEnterpriseDeploymentAutomation/OracleIdentityManagement/oke_utils/provision_oke.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ print_msg screen "\n\nCreation of the OCI resources defined in chapter 9 of the
134134
print_msg screen "in $total_time."
135135
print_msg screen "\nReview the log file at $LOGDIR/$LOGFILE for full details."
136136

137-
id=$(cat $RESOURCE_OCID_FILE | grep $BASTION_INSTANCE_DISPLAY_NAME | cut -d: -f2)
137+
id=$(cat $RESOURCE_OCID_FILE | grep $BASTION_INSTANCE_DISPLAY_NAME: | cut -d: -f2)
138138
ip=$(oci compute instance list-vnics --compartment-id $COMPARTMENT_ID --instance-id $id \
139139
--query 'data[0]."public-ip"' --raw-output)
140140
print_msg screen "Use the following command to connect to the bastion host:"

FMWKubernetesMAA/OracleEnterpriseDeploymentAutomation/OracleIdentityManagement/provision_prom.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,21 @@ then
9292
update_progress
9393
fi
9494

95+
# Create a Container Registry Secret if requested
96+
#
97+
if [ ! "$PROM_REPO" = "" ]
98+
then
99+
new_step
100+
if [ $STEPNO -gt $PROGRESS ]
101+
then
102+
if [ "$CREATE_REGSECRET" = "true" ]
103+
then
104+
create_registry_secret $REGISTRY $REG_USER $REG_PWD $PROMNS
105+
fi
106+
update_progress
107+
fi
108+
fi
109+
95110
new_step
96111
if [ $STEPNO -gt $PROGRESS ]
97112
then

FMWKubernetesMAA/OracleEnterpriseDeploymentAutomation/OracleIdentityManagement/templates/oud/oud_dr.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#
99

1010
COPIES=3
11-
EXCLUDE_LIST="--exclude=\".snapshot\" "
11+
EXCLUDE_LIST="--exclude=\".snapshot\" --exclude=\"backups\" --exclude=\"backup_running\" --exclude=\"dr_scripts\" "
1212

1313

1414
create_oci_snapshot()

FMWKubernetesMAA/OracleEnterpriseDeploymentAutomation/OracleIdentityManagement/templates/prometheus/override_prom.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2022, Oracle and/or its affiliates.
1+
# Copyright (c) 2022, 2023, Oracle and/or its affiliates.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33
#
44
# This is an example of a helm override file to deploy Prometheus
@@ -7,6 +7,7 @@
77
#
88
# Usage: Used and Input to Helm command
99
#
10+
1011
alertmanager:
1112
service:
1213
nodePort: <PROM_ALERT_K8>
@@ -30,4 +31,3 @@ grafana:
3031
type: NodePort
3132

3233
adminPassword: <PROM_ADMIN_PWD>
33-

0 commit comments

Comments
 (0)