Personnaliser le plan de migration pour les charges de travail WebSphere

Avant de commencer

Ce document suppose que vous avez déjà créé une migration et que vous disposez du fichier de plan de migration.

Modifier le plan de migration

Une fois le système de fichiers copié et analysé, vous trouverez le plan de migration dans le nouveau répertoire qui est créé dans le chemin de sortie spécifié : ANALYSIS_OUTPUT_PATH/config.yaml.

Modifiez le plan de migration si nécessaire et enregistrez les modifications.

Passez en revue les détails de votre plan de migration et les commentaires d'orientation, et ajoutez des informations si nécessaire.

Vous pouvez plus précisément envisager des modifications telles qu'elles sont décrites dans les sections suivantes.

Structure du plan de migration

Le plan de migration des charges de travail WebSphere présente la structure suivante que vous pouvez personnaliser, comme décrit dans les sections suivantes.

# List of discovered WebSphere application servers and how to migrate their
# hosted applications to containers.
webSphereApplicationServers:
# The application server installation path.
- home: /opt/ibm/wlp
  applicationServerInfo:
    name: WebSphere Application Server
    profile: Liberty
    version: 23.0.0.4
    edition: Base
    # List of Java installations available to the application server.
    javaDevelopmentKits:
    - home: /opt/ibm/java
      vendor: IBM Corporation
      version:
        jdk: java version 1.8.0_361
        jre: Java(TM) SE Runtime Environment
        jvm: IBM J9 VM
  # List of hosted applications and how to migrate them to containers.
  applications:
  - path: /opt/ibm/wlp/usr/servers/defaultServer/apps/app.war
    # Application archives to be migrated into the target container.
    archives:
    - /opt/ibm/wlp/usr/servers/defaultServer/apps/app.war
    # Application configuration files to be migrated into the target container.
    configurations:
      serverXML: /opt/ibm/wlp/usr/servers/defaultServer/server.xml
      serverEnv:
      - /opt/ibm/wlp/usr/servers/defaultServer/server.env
      bootstrapProperties:
      - /opt/ibm/wlp/usr/servers/defaultServer/bootstrap.properties
      variableProperties:
      - /opt/ibm/wlp/usr/servers/defaultServer/variables/variable.properties
      jvmOptions:
      - /opt/ibm/wlp/usr/servers/defaultServer/jvm.options
    # Application resource files to be migrated into the target container.
    resources:
      locations:
      - /opt/ibm/wlp/usr/servers/defaultServer/resources/ports.xml
      libraries:
      - /opt/ibm/wlp/usr/servers/defaultServer/resources/postgresql.jar
      keystores:
      - /opt/ibm/wlp/output/defaultServer/resources/security/key.p12
      sharedResources:
        - /opt/ibm/wlp/usr/shared/resources/jdbc.jar
      additionalResources:
      - /opt/ibm/wlp/output/defaultServer/resources/mongodb.jar
    javaRuntime:
      se: SE8
      ee: EE7
      vendor: IBM Corporation
    targetJavaRuntime:
      se: SE8
      ee: EE7
      vendor: IBM Corporation
    targetApplicationServer:
      profile: Liberty
      version: 23.0.0.4
      edition: Base
    targetContainer:
      # The target container base image name.
      baseImage: ibmcom/websphere-liberty:full-java8-ibmjava-ubi
      # The application server installation path within the target container
      # base image.
      home: /opt/ibm/wlp
      # The application server default server name.
      server: defaultServer
      # The UID or name of the user configured within the target container
      # base image. Defaults to 1001 for Liberty profile.
      user: "1001"
      # The GID or name of the group configured within the target container
      # base image. Defaults to 0 for Liberty profile.
      group: "0"
      # Application ports to be exposed in Kubernetes artifacts.
      ports:
      - name: http-tcp-9080
        port: 9080
        protocol: TCP
      - name: https-tcp-9443
        port: 9443
        protocol: TCP
      # Specify whether discovered keystores are automatically converted to
      # Kubernetes secrets. Defaults to true.
      enableSecrets: true

Exclure des applications

Pour exclure des applications de la migration, supprimez-les de la liste applications.

  applications:
  # Exclude app1.war:
  # - path: app1.war
  #  ...
  - path: app2.war

Contrôler les fichiers d'application

Pour contrôler quels fichiers d'application sont inclus ou exclus de la migration, mettez à jour les champs configurations et resources.

  applications:
  - path: app.war
    resources:
      keystores:
      # Exclude key1.p12:
      # - key1.p12
      # Include key2.p12:
      - key2.p12
      additionalResources:
      # Exclude resource1.xml:
      # - resource1.xml
      # Include resource2.xml:
      - resource2.xml

Personnaliser l'environnement d'exécution Java cible

Pour personnaliser l'environnement d'exécution Java cible de l'application, mettez à jour le champ targetJavaRuntime.

  applications:
  - path: app.war
    targetJavaRuntime:
      se: SE
      ee: EE
      vendor: VENDOR

Remplacez les éléments suivants :

  • SE : version de Java SE Format : [SE8|SE11|SE17]
  • EE : version de Java EE ou Jakarta Format : [EE7|EE8|EE9|EE10]
  • VENDOR : fournisseur Java Format : [IBM Corporation|Oracle Corporation]

Personnaliser le serveur d'applications cible

Pour personnaliser le serveur d'applications cible pour l'application, mettez à jour le champ targetApplicationServer.

  applications:
  - path: app.war
    targetApplicationServer:
      profile: PROFILE
      version: VERSION
      edition: EDITION

Remplacez les éléments suivants :

  • PROFILE : profil WebSphere Format : [Liberty|Traditionnel]
  • TARGET_VERSION : version de WebSphere
  • TARGET_EDITION : édition WebSphere Format : [Base|Core|Ouvrir|ND]

Personnaliser le conteneur cible

Pour personnaliser le conteneur cible à utiliser pour l'application, mettez à jour le champ targetContainer.

  applications:
  - path: app.war
    targetContainer:
      baseImage: BASE_IMAGE
      home: HOME
      server: SERVER
      user: USER
      group: GROUP

Personnaliser les secrets Kubernetes

Par défaut, les fichiers répertoriés dans le champ keystores sont migrés vers les secrets Kubernetes. Pour migrer ces fichiers tels quels, vous pouvez désactiver cette fonctionnalité.

  applications:
  - path: app.war
    resources:
      keystores:
      - key.p12
    targetContainer:
      # Do not migrate keystores to Kubernetes secrets:
      enableSecrets: false

Personnaliser les ports Kubernetes

Pour contrôler les ports exposés par les pods et services Kubernetes, mettez à jour le champ ports.

  applications:
  - path: app.war
    targetContainer:
      ports:
      # Exclude http-tcp-9080:
      # - name: http-tcp-9080
      #   port: 9080
      #   protocol: TCP
      # Include https-tcp-9443:
      - name: https-tcp-9443
        port: 9443
        protocol: TCP

Étapes suivantes