integration-tests/src/test/java/oracle/kubernetes/operator/utils/TestUtils.java
public static String retrieveClusterIP(String domainUid, String clusterName, String domainNS)
      throws Exception {
    // kubectl get service domainonpvwlst-cluster-cluster-1 | grep ClusterIP | awk '{print $3}'
    StringBuffer cmd = new StringBuffer("kubectl get service ");
    cmd.append(domainUid);
    cmd.append("-cluster-");
    cmd.append(clusterName);
    cmd.append(" -n ").append(domainNS);
    cmd.append(" | grep ClusterIP | awk '{print $3}' ");
    LoggerHelper.getLocal().log(Level.INFO,
        " Get ClusterIP for "
            + clusterName
            + " in namespace "
            + domainNS
            + " with command: '"
            + cmd
            + "'");

    ExecResult result = ExecCommand.exec(cmd.toString());
    String stdout = result.stdout();
    LoggerHelper.getLocal().log(Level.INFO, " ClusterIP for cluster: " + clusterName + " found: ");
    LoggerHelper.getLocal().log(Level.INFO, stdout);
    return stdout;
  }
/**
   * retrieve IP address info for cluster service.
   *
   * @param domainUid   - name of domain.
   * @param clusterName - name Web Logic cluster
   * @param domainNS    - domain namespace
   * @throws Exception - exception will be thrown if kubectl command will fail
   */
retrieve IP address info for cluster service.
@param domainUid   - name of domain.
@param clusterName - name Web Logic cluster
@param domainNS    - domain namespace
@throws Exception - exception will be thrown if kubectl command will fail
retrieve IP address info for cluster service . @param domainUid - name of domain . @param clusterName - name Web Logic cluster @param domainNS - domain namespace @throws Exception - exception will be thrown if kubectl command will fail
public static String retrieveClusterIP(String domainUid, String clusterName, String domainNS)
      throws Exception {
    StringBuffer cmd = new StringBuffer("kubectl get service ");
    cmd.append(domainUid);
    cmd.append("-cluster-");
    cmd.append(clusterName);
    cmd.append(" -n ").append(domainNS);
    cmd.append(" | grep ClusterIP | awk '{print $3}' ");
    LoggerHelper.getLocal().log(Level.INFO,
        " Get ClusterIP for "
            + clusterName
            + " in namespace "
            + domainNS
            + " with command: '"
            + cmd
            + "'");
    ExecResult result = ExecCommand.exec(cmd.toString());
    String stdout = result.stdout();
    LoggerHelper.getLocal().log(Level.INFO, " ClusterIP for cluster: " + clusterName + " found: ");
    LoggerHelper.getLocal().log(Level.INFO, stdout);
    return stdout;
  }
public static String retrieveClusterIP ( String domainUid , String clusterName , String domainNS ) throws Exception { StringBuffer cmd = new StringBuffer ( "kubectl get service " ) ; cmd . append ( domainUid ) ; cmd . append ( "-cluster-" ) ; cmd . append ( clusterName ) ; cmd . append ( " -n " ) . append ( domainNS ) ; cmd . append ( " | grep ClusterIP | awk '{print $3}' " ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , " Get ClusterIP for " + clusterName + " in namespace " + domainNS + " with command: '" + cmd + "'" ) ; ExecResult result = ExecCommand . exec ( cmd . toString ( ) ) ; String stdout = result . stdout ( ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , " ClusterIP for cluster: " + clusterName + " found: " ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , stdout ) ; return stdout ; }
retrieve IP address info for cluster service.
retrieve IP address info for cluster service .
// kubectl get service domainonpvwlst-cluster-cluster-1 | grep ClusterIP | awk '{print $3}'