4 Manage the AMC Deployment

The upgrade and maintenance of WKO and AMC can be achieved seamlessly using the Containerized AMC.

You can also migrate non-containerized AMC to Containerized AMC with minimal down time and continuity of services.

Migrate Non-containerized AMC to Containerized AMC

Migration of non-containerized AMC to Containerized AMC involves reusing of existing on-premise AMC database connection with Containerized AMC. In other words, the database connecting to on-premise (non-containerized) AMC is disconnected and connected to Containerized AMC. However, the WebLogic domain configuration of on-premise AMC is not migrated to Containerized AMC.

While migrating from on-premise AMC to Containerized AMC, you can either migrate to same version of AMC or a higher version. However, you cannot migrate to a lower version of AMC.

Note:

When upgrading the Advanced Management Console to version 2.17 or later, and if the Agent Auto Update option is enabled, you must manually replace the signing certificate in the agent machine. For detailed steps, see Automatic Update of Advanced Management Console Agent.
When migrating from on-premise AMC to Containerized AMC, you can plan to either:
  • Reuse On-premise AMC Server Address: The AMC server address is the host name and port number you set during AMC initialization. This address is used by all agents connected to the on-premise AMC. You can retain the same AMC server address for the migrated Containerized AMC. However, to reuse the AMC server address, the server address has to be front ended by an external load balancer.

    OR

  • Change AMC Server Address: Plan the migration by changing the AMC server address.

Reuse On-premise AMC Server Address

Before you begin the migration, ensure that the on-premise AMC is front ended through an external load balancer application.

  1. Stop or un-deploy the running AMC application in your on-premise WebLogic cluster or server. You can also stop the WebLogic server or cluster if its used only for AMC deployment.
  2. Deploy Containerized AMC using the database connection properties that were used by the on-premise AMC.
  3. Identify the service end points (that is, server host name or IP address, and port number) of your Containerized AMC deployment. See Access the Containerized AMC.
  4. Replace the external load balancer backend with Containerized AMC service end points and restart the load balancer application.
  5. If you want to upgrade to higher version of AMC, see Upgrade Containerized AMC deployment.
Following is an example of how an HA Proxy configuration is modified to migrate on-premise AMC to Containerized AMC without changing the AMC Server address:
-------------------------------------------------
 HA Proxy front ending on-premise AMC 
-------------------------------------------------
frontend AMCServer_001
bind *:8189 ssl crt /etc/haproxy/cert/server.pem
reqadd X-Forwarded-Proto:\ https
default_backend AMCServer_001_Back

backend AMCServer_001_Back
cookie JSESSIONID prefix nocache
server AMCServer_001_MS1 <onprem-managed-server1:port> cookie amc-cluster  ssl verify none
server AMCServer_001_MS2 <onprem-managed-server2:port> cookie amc-cluster  ssl verify none

-------------------------------------------------------
 HA Proxy front ending Containerized AMC 
-------------------------------------------------------

frontend AMCServer_001
bind *:8189 ssl crt /etc/haproxy/cert/server.pem
reqadd X-Forwarded-Proto:\ https
default_backend AMCServer_001_Back

backend AMCServer_001_Back
cookie JSESSIONID prefix nocache
server AMCServer_001_MS1 <cont-amc-server-host:port> cookie amc-cluster  ssl verify none

Change AMC Server Address

Migrate on-premise AMC to Containerized AMC by providing different AMC server address (host name or IP address, and port number).

  1. Stop or un-deploy the running AMC application in your on-premise WebLogic cluster or server. You can also stop the WebLogic server or cluster if its used only for AMC deployment.
  2. Deploy Containerized AMC using the database connection properties that were used by on-premise AMC.
  3. Identify the service end points (that is, server host name or IP, and port number) of your Containerized AMC deployment.
  4. Connect to the AMC database from any database client application and update the AMC configuration table using the following SQL statements and commit the changes:
    update config set configvalue = '<cont-amc-service-host>' where configkey = 'hostname';
    update config set configvalue = '<cont-amc-service-port>' where configkey = 'amc_port';
    Example
    update amc2.config set configvalue = '203.0.113.10' where configkey = 'hostname';
    update amc2.config set configvalue = '6503' where configkey = 'amc_port' 
    
  5. On every agent machine, modify the properties server.name and server.port in AMCServer.properties file present in the conf directory of AMC_Agent (%AMC_DIR%\conf\AMCUser.properties). To ensure continuity of managing agents through the new deployment, update the properties for all agents.
    server.name: <cont-amc-service-host>
    server.port: <cont-amc-service-port>
    server.protocol: https
    agentId: 3
    authCookieName: amc_auth
    authCookieValue: c78b2652-1d86-41b6-a673-c4b309d9ec06
  6. Restart all agents after this change:
    • Windows: Restart the AMC system service through the task manager
    • macOS and Linux: Execute - sudo bash ${AMC_DIR}/bin/AMCAgent.sh -restart

Upgrade the Deployments

Run the upgrade command to fetch the latest version of WKO, AMC, and Helm chart values.

Upgrade WKO Deployment

Use the following command to upgrade WKO deployment:
helm upgrade <release-name> weblogic-operator/weblogic-operator \
--set "javaLoggingLevel=FINE" -n <operator-namespace> \
--reuse-values
Example Command:
$ helm upgrade wko weblogic-operator/weblogic-operator \
--set "javaLoggingLevel=FINE" -n wko-ns \
--reuse-values

For detailed steps to upgrade WKO deployment, see Upgrade the operator.

Upgrade Containerized AMC deployment

You can upgrade the Containerized AMC in any of these scenarios:
  • A newer version of AMC container image is available
  • If you need to increase or decrease the number of pods running (Scale-in or Scale-out)
  • Changes in WebLogic domain configuration
  • Switch to a different database, mail server, or LDAP server
To update the configuration values, edit the custom-values.yaml file.
Run the following command to upgrade the Containerized AMC deployment:
helm upgrade <release_name> <path to amc helm package> –-values custom-values.yaml --wait \   
-n <amc-namespace> --reuse-values 
Where:
  • custom-values.yaml are the custom values that overwrite the standard values in the local or remote repository.
  • release_name is the name of the Containerized AMC deployment.
  • path to amc helm package is the local helm package containing the standard AMC values.
  • amc-namespace is the AMC version that is being upgraded.
  • wait pauses the output until all pods and services are in the ready state.
  • reuse-values uses the last release values and merge overrides, if any, while upgrading.
Example Command:
$ helm upgrade amc ./java-amc-1.0.0.tgz --values custom-values.yaml --wait \
   -n amc-ns   --reuse-values

Uninstall Deployments

Uninstall will remove all resources that you have created during deployment. Ensure to uninstall the Containerized AMC before you uninstall WKO.

Use the following commands in the specified order to uninstall AMC and WKO deployments:

Uninstall Containerized AMC Deployment

Delete the ConfigMap:
kubectl delete configmap <configmap-name> -n <amc-namespace>
Delete the secrets created during AMC deployment:
kubectl delete secret <secret-name> -n <amc-namespace>
Remove AMC namespace:
kubectl delete namespace <amc-namespace>
Remove AMC deployment:
helm uninstall <release_name> -n <amc-namespace>

Uninstall WKO Deployment

Delete the Custom Resource Definition object created by the operator:
kubectl delete customresourcedefinition domains.weblogic.oracle -n <operator-namespace>
Remove the operator's namespace:
kubectl delete namespace <operator-namespace>
Remove the operator:
helm unistall <release-name> -n <operator-namespace>
Here is an example bash script that you can use to uninstall AMC and WKO deployments completely.
#!/bin/bash

kubectl delete configmap amc-keystore -n amc-ns
kubectl delete secret  amc-wls-credentials -n amc-ns
kubectl delete secret  amc-ds-credentials -n amc-ns
kubectl delete secret  amc-mail-credentials -n amc-ns
kubectl delete secret  amc-ldap-credentials -n amc-ns
kubectl delete secret  amc-jks-credentials -n amc-ns

helm uninstall amc -n amc-ns
helm uninstall wko -n wko-ns

kubectl delete customresourcedefinition domains.weblogic.oracle -n wko-ns


kubectl delete namespace amc-ns
kubectl delete namespace wko-ns