管理対象サーバーのT3/T3Sの公開

リスニング・ポートlisten_portおよびペア・パブリック・ポートpublic_portを使用して、すべての管理対象サーバー用のカスタムT3/T3Sチャネルを作成するには:

  1. 次の内容でt3_ms_config.pyを作成します:
    admin_pod_name = sys.argv[1]
    admin_port = sys.argv[2]
    user_name = sys.argv[3]
    password = sys.argv[4]
    listen_port = sys.argv[5]
    public_port = sys.argv[6]
    public_address = sys.argv[7]
    managedNameBase = sys.argv[8]
    ms_count = sys.argv[9]
    channelType = sys.argv[10]
    print('custom host : [%s]' % admin_pod_name);
    print('custom port : [%s]' % admin_port);
    print('custom user_name : [%s]' % user_name);
    print('custom password : ********');
    print('public address : [%s]' % public_address);
    print('channel listen port : [%s]' % listen_port);
    print('channel public listen port : [%s]' % public_port);
    
    connect(user_name, password, 't3://' + admin_pod_name + ':' + admin_port)
    
    edit()
    startEdit()
    for index in range(0, int(ms_count)):
      cd('/')
      msIndex = index+1
      cd('/')
      name = '%s%s' % (managedNameBase, msIndex)
      cd('Servers/%s/' % name )
      if channelType == 't3':
        create('T3Channel_MS','NetworkAccessPoint')
        cd('NetworkAccessPoints/T3Channel_MS')
        set('Protocol','t3')
        set('ListenPort',int(listen_port))
        set('PublicPort',int(public_port))
        set('PublicAddress', public_address)
        print('Channel T3Channel_MS added ...for ' + name)
      elif channelType == 't3s':	  
        create('T3SChannel_MS','NetworkAccessPoint')
        cd('NetworkAccessPoints/T3SChannel_MS')
        set('Protocol','t3s')
        set('ListenPort',int(listen_port))
        set('PublicPort',int(public_port))
        set('PublicAddress', public_address)
        set('HttpEnabledForThisProtocol', true)
        set('OutboundEnabled', false)
        set('Enabled', true)
        set('TwoWaySSLEnabled', true)
        set('ClientCertificateEnforced', false)
        print('Channel T3SChannel_MS added ...for ' + name)
      else:
        print('Protocol [%s] not supported' % channelType)  	
    activate()
    disconnect()
    
  2. t3_ms_config.pyを管理サーバー・ポッド(たとえば、soansネームスペースのsoainfra-adminserver)のドメイン・ホーム(たとえば、/u01/oracle/user_projects/domains/soainfra)にコピーします。
    kubectl cp t3_ms_config.py soans/soainfra-adminserver:/u01/oracle/user_projects/domains/soainfra
    
  3. 次のパラメータを使用し、管理サーバー・ポッドに対するexecでwlst.sh t3_ms_config.pyを実行します:
    • admin_pod_name: soainfra-adminserver # 管理サーバー・ポッド
    • admin_port: 7001
    • user_name: weblogic
    • password: Welcome1 # weblogicパスワード
    • listen_port: 30016 # T3管理対象サーバーの新規ポート
    • public_port: 30016 # 外部でT3ポートを公開するために使用されるKubernetes NodePort
    • public_address:
    • managedNameBase: soa_server # 管理対象サーバーのベース名の指定。osb_clusterの場合、これはosb_serverになります
    • ms_count: 5 # 構成済管理対象サーバー数
    • channelType: t3 # channelTypeはt3またはt3sです
    admin_pod_name: soainfra-adminserver # Administration Server pod admin_port:  7001 user_name: weblogic password: Welcome1 # weblogic password listen_port: 30016 # New port for T3 Managed Serverspublic_port: 30016 # Kubernetes NodePort which will be used to expose T3 port
              externallypublic_address: managedNameBase: soa_server # Give Managed Server base name. For osb_cluster this will
              be osb_serverms_count: 5 # Number of configured Managed ServerschannelType: t3 # channelType is t3 or t3s

    例:

    kubectl exec -it soainfra-adminserver -n soans -- /u01/oracle/oracle_common/common/bin/wlst.sh /u01/oracle/user_projects/domains/soainfra/t3_ms_config.py soainfra-adminserver  7001 weblogic Welcome1 30016 30016 xxx.xxx.xxx.xxx soa_server 5 t3
    
  4. 次の内容でt3_ms_svc.yamlを作成し、domainNameおよびdomainUIDをsoainfra、SOAクラスタのclusterNameをsoa_clusterとして管理対象サーバー・ポート30016でT3を公開します。同様に、Oracle Service BusクラスタのclusterNameにosb_clusterを使用して、Kubernetesサービスを作成できます:

    ノート:

    T3Sの場合は、前のステップでwlst.shを使用してT3Sチャネルを作成する際にpublic_portで使用した適切な値でNodePort 30016を置き換えます。
    apiVersion: v1
    kind: Service
    metadata:
       name: soainfra-soa-cluster-t3-external
       namespace: soans
       labels:
         weblogic.clusterName: soa_cluster
         weblogic.domainName: soainfra
         weblogic.domainUID: soainfra
    spec:
      type: NodePort
      selector:
        weblogic.domainName: soainfra
        weblogic.domainUID: soainfra
        weblogic.clusterName: soa_cluster
      ports:
      - name: t3soaport
        protocol: TCP
        port: 30016
        targetPort: 30016
        nodePort: 30016
    
  5. ポート30016のNodePortサービスを作成します:
    kubectl create -f t3_ms_svc.yaml
    
  6. 次のURLを使用して、管理対象サーバーのT3にアクセスできることを確認します:
    t3://<master_ip>:30016
    
  7. 同様に、次のようにT3Sにアクセスできます:
    1. まず、クライアントから保護された(t3s)接続に使用する証明書を管理サーバーから取得します。wlstコマンドを使用して、管理サーバーから証明書をエクスポートできます。デフォルトのdemoidentityをエクスポートするコマンドの例:

      ノート:

      カスタムSSL証明書を使用している場合は、それに応じてステップを置き換えます
      kubectl exec -it soainfra-adminserver -n soans -- bash
      /u01/oracle/oracle_common/common/bin/wlst.sh
      connect('weblogic','Welcome1','t3://soainfra-adminserver:7001')
      svc = getOpssService(name='KeyStoreService')
      svc.exportKeyStoreCertificate(appStripe='system', name='demoidentity', password='DemoIdentityKeyStorePassPhrase', alias='DemoIdentity', type='Certificate', filepath='/tmp/cert.txt/')
      

      前述のステップでは、/tmp/cert.txtで証明書をダウンロードします。

    2. クライアント側から同じ証明書を使用し、t3sを使用して接続します。例:
      export JAVA_HOME=/u01/jdk
      keytool -import -v -trustcacerts -alias soadomain -file cert.txt -keystore $JAVA_HOME/lib/security/cacerts -keypass changeit -storepass changeit
      export WLST_PROPERTIES="-Dweblogic.security.SSL.ignoreHostnameVerification=true"
      cd $ORACLE_HOME/oracle_common/common/bin
      ./wlst.sh
        Initializing WebLogic Scripting Tool (WLST) ...
        Welcome to WebLogic Server Administration Scripting Shell
        Type help() for help on available commands
      wls:/offline> connect('weblogic','Welcome1','t3s://<Master IP address>:30016')