Delete the OAM domain home

Sometimes in production, but most likely in testing environments, you might want to remove the domain home that is generated using the create-domain.sh script.

  1. Run the following command to delete the jobs, domain, and configmaps:

     $ kubectl delete jobs <domain_job> -n <domain_namespace>
     $ kubectl delete domain <domain_uid> -n <domain_namespace>
     $ kubectl delete configmaps <domain_job>-cm -n <domain_namespace>
    

    For example:

    $ kubectl delete jobs accessdomain-create-oam-infra-domain-job -n oamns
    $ kubectl delete domain accessdomain -n oamns
    $ kubectl delete configmaps accessdomain-create-oam-infra-domain-job-cm -n oamns
    
  2. Drop the RCU schemas as follows:

    $ kubectl exec -it helper -n <domain_namespace> -- /bin/bash
    [oracle@helper ~]$
    [oracle@helper ~]$ export CONNECTION_STRING=<db_host.domain>:<db_port>/<service_name>
    [oracle@helper ~]$ export RCUPREFIX=<rcu_schema_prefix>
       
    /u01/oracle/oracle_common/bin/rcu -silent -dropRepository -databaseType ORACLE -connectString $CONNECTION_STRING \
    -dbUser sys -dbRole sysdba -selectDependentsForComponents true -schemaPrefix $RCUPREFIX \
    -component MDS -component IAU -component IAU_APPEND -component IAU_VIEWER -component OPSS \
    -component WLS -component STB -component OAM -f < /tmp/pwd.txt
    

    For example:

    $ kubectl exec -it helper -n oamns -- /bin/bash
    [oracle@helper ~]$ export CONNECTION_STRING=mydatabasehost.example.com:1521/orcl.example.com
    [oracle@helper ~]$ export RCUPREFIX=OAMK8S
    /u01/oracle/oracle_common/bin/rcu -silent -dropRepository -databaseType ORACLE -connectString $CONNECTION_STRING \
    -dbUser sys -dbRole sysdba -selectDependentsForComponents true -schemaPrefix $RCUPREFIX \
    -component MDS -component IAU -component IAU_APPEND -component IAU_VIEWER -component OPSS \
    -component WLS -component STB -component OAM -f < /tmp/pwd.txt
    
  3. Delete the Persistent Volume and Persistent Volume Claim:

    $ kubectl delete pv <pv-name>
    $ kubectl delete pvc <pvc-name> -n <domain_namespace>
    

    For example:

    $ kubectl delete pv accessdomain-domain-pv
    $ kubectl delete pvc accessdomain-domain-pvc -n oamns
    
  4. Delete the contents of the persistent volume, for example:

    $ rm -rf <work directory>/accessdomainpv/*
    

    For example:

    $ rm -rf /scratch/OAMDockerK8S/accessdomainpv/*
    
  5. Delete the Oracle WebLogic Server Kubernetes Operator, by running the following command:

    $ helm delete weblogic-kubernetes-operator -n opns
    
  6. To delete NGINX:

    cd <work_directory>/weblogic-kubernetes-operator/kubernetes/samples/charts/ingress-per-domain
    $ kubectl delete -f ssl-nginx-ingress.yaml
    

    Then run:

    $ helm delete nginx-ingress -n <domain namespace>
    

    For example:

    $ helm delete nginx-ingress -n oamns
    
  7. To delete Voyager:

    helm delete voyager-operator -n voyager
    

    then:

    $ helm delete oam-voyager-ingress -n <domain_namespace>
    

    For example:

    $ helm delete oam-voyager-ingress -n oamns