Remove Service from Grey Matter on Kubernetes
Prerequisites
An existing Grey Matter deployment running on Kubernetes _(tutorial)
kubectlorocsetup with access to the clustergreymattercli setup with access to the deployment
Overview
Delete service from Intelligence 360 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.
Steps
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.
curl -X DELETE \
-k --cacert ./certs/ca.pem \
--cert ./certs/client.pem \
--key ./certs/client.key \
https://{YOUR_AWS_ELB_HOSTNAME}:10808/services/catalog/latest/clusters/fibonacci?zoneName=zone-default-zone{"deleted": "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.
First delete the cluster object.
greymatter delete cluster edge-to-fibonacci-clusterThen delete the route and shared_rules. We can delete these both with a single call because they're explicitly linked by object keys.
greymatter delete --deep=true route edge-to-fibonacci-route
greymatter delete route edge-to-fibonacci-route-slashShortly 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 fibonacci4. 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 it's local microservice.
greymatter delete cluster fibonacci-clusterThen we'll delete the domain, and use the --deep option to make sure no other Sidecars are using it.
greymatter delete --deep domain fibonacci-domainThird, delete the listener:
greymatter delete listener fibonacci-listenerThen we can delete the route and shared_rules together
greymatter delete --deep route fibonacci-local-routeFinally, we'll delete the overarching proxy object.
greymatter delete proxy fibonacci-proxyThe service and all configs are now removed from GreyMatter.
Last updated
Was this helpful?