All services deployed into greymatter require a corresponding GSL service file containing that service’s application networking configurations. The greymatter
init service CLI command generates a configuration file and is the fastest method for integrating the service into the mesh.
This guide will show you how to deploy a service into the mesh by using the auto-generated configurations produced by the
init service command. By the end of this guide, your service will be running in the mesh, reporting metrics and request audits, and fully routable from the application edge node.
- A greymatter
- A greymatter tenant project. Follow this guide to set one up.
In your terminal, navigate to the GSL project you want to initialize a service in. Run the command:
greymatter init service -n <project name> --dir greymatter/<service folder> -t <type of service> -p <service port> <service name>
There are three types of services:
Each one will change the type of default listener produced by the command.
You can choose any name for the service folder name. If you service is organized under some greater application, then a useful pattern is to choose a folder that describes that application. For instance, a dashboard application could have a folder named
dashboard with the service files
After running the command, verify that the service folder contains a new CUE file matching the service name.
Navigate to your service’s Kubernetes manifest. Open it and add a new annotation to the
This special annotation tells greymatter Operator to inject a greymatter data plane proxy container into your Kubernetes resource.
Everything is setup to begin the deployment. Start by validating your configurations are correct by running from the root of the project:
greymatter sync --dry-run
The command will log any errors it encountered during validation.
Correct any errors, if there are any, and commit and push your changes:
git add . git commit -m "Add new service" git push
Deploy your service into the Kubernetes cluster while you wait for the sync service to finish. Track it’s status by running:
kubectl get pods -n <project namespace> -w
You should see it get deleted and replaced by a Pod of the same name but with one more container than it had before (this is the operator injecting a data plane proxy).
Navigate to your service by loading the URL in the browser or through a tool like curl. The service should be accessible at a URL with the form:
https://<edge service external ip>:<edge service port>/services/<project namespace>/<service name>.
Your service is now successfully deployed and integrated into greymatter. Follow this process again when you want to deploy another one.