Deleting Service Interconnect edge gateways with the CLI

Use the IBM Hybrid Cloud Mesh (Mesh) CLI to delete Red Hat® Service Interconnect gateways from your deployment environment.

About this task

If the gateway is deployed, you must first unlink the gateway from the namespace before you can delete the gateway.

Procedure

  1. Use the palmctl get namespaces command to get the details of the namespace where the gateway is deployed and send the output to a file.
    The syntax for the command is as follows:
    palmctl get namespaces (--cloud-name <cloud_name> | --cloud-id <cloud_id>) \ 
    (--cluster-name <cluster_name> | --cluster-id <cluster_id>) \ 
    (<namespace_id> | --id <namespace_id> | --name <namespace_name>) \ 
    > <namespace_file.yaml>
    For example, if the gateway is deployed in a namespace that is named frontend, run a command like this:
    palmctl get namespace --cloud-name IBM --cluster-name clusterA --name frontend > frontend.yaml
  2. Edit the output file and remove the entry for the gateway that you are deleting. You might also need to set the namespace to unmanaged and remove a remote connection.
    For example, to edit the output file, you might run commands like these:
    sed -i 's/unmanaged: false/unmanaged: true/g' frontend.yaml
    sed -i '/gateway_id/d' frontend.yaml
    sed -i '/router_site_cor_id/d' frontend.yaml
  3. Use the palmctl update namespace command to unlink the gateway from the namespace.
    The syntax for the command is as follows:
    palmctl update namespace (--cloud-name <cloud_name> | --cloud-id <cloud_id>) \ 
    (--cluster-name <cluster_name> | --cluster-id <cluster_id>) \ 
    (<namespace_id> | --id <namespace_id> | --name <namespace_name>) \ 
    -f <namespace_file.yaml>
    For example, unlink the namespace that is named frontend by running a command like this:
    palmctl update namespace --cloud-name IBM --cluster-name clusterA --name frontend -f frontend.yaml
  4. In your Kubernetes namespace, monitor the pods and wait until the Mesh agent and router-specific pods for Skupper are deleted.
  5. Use the palmctl delete gateway command to request for the gateway to be deleted.
    The syntax for the command is as follows:
    palmctl delete gateway (<gateway_id> | --id <gateway_id> | --name <gateway_name>)
    For example, delete the gateway by running a command like this:
    palmctl delete gateway --name gw1
  6. Check that the gateway is deleted by running a command like this:
    palmctl get gateway --name gw1
    If the gateway was successfully deleted, output that is similar to the following example is shown:
    [ERROR] gateway with name gw1 not found