An existing Grey Matter deployment running on Kubernetes _(tutorial)
kubectl or oc setup with access to the cluster
greymatter cli setup with access to the deployment
Delete service from the Grey Matter application
Delete Edge routes
Delete pod with the service and sidecar
Delete Service Configurations
NOTE: The exact configurations and commands done here assume you've gone through the service launch tutorial to setup this service. For any other service; you'll just need to substitute your object keys and service deployments where appropriate.
1. Delete Catalog Entry
The first step is to remove the service entry from the Catalog server so that users will not see it and expect to be able to use it.
greymatter delete catalog-service fibonacci
This will remove the service card from display.
2. Edge Routing
Next we'll remove any Edge routing configuration. This will prevent users from using the service.
Shortly after these steps (generally a few seconds) the Edge will have removed the configuration to route to this service and users can no longer call the service.
3. Delete Deployment
Now that the service is no longer routed to from the edge, we can fully spin down the pod so that it no longer can receive any traffic and stops announcing into the mesh. This can be done in any way supported by k8s:
Scale the deployment/replicaset to 0
Delete the resources (deployment, replicaset, pod)
Assuming you've followed out tutorial, the deployment set can be removed the kubectl command:.
kubectl delete deployment fibonacci
4. Delete Sidecar config
NOTE This step is optional for removing a service, and should only be done if this service is not expected to spin back up. These configuration objects are not sent to any Sidecar now that the pod is spun down, and nothing is referencing them for routing.
The last step is to delete the configuration objects in the API for this service.
First we'll delete the cluster for the Sidecar to talk to its local microservice.
greymatter delete cluster fibonacci-cluster
Then we'll delete the domain, and use the --deep option to make sure no other Sidecars are using it.
greymatter delete --deep domain fibonacci-domain
Third, delete the listener:
greymatter delete listener fibonacci-listener
Then we can delete the route and shared_rules together