A service catalog is one of the most powerful tools that engineers have, offering insight into all of their microservices. But, a catalog doesn’t offer visibility into all of the resources your services access: the databases, caches, load balancers, schema definitions, third party vendors, and other infrastructure assets that affect your microservices. These things don’t belong in a service catalog, but they still need to be tracked and managed — that’s where the resource catalog comes in.
Cortex's resource catalog functions just like the service catalog, giving your teams total visibility into your infrastructure, without bogging them down in the nitty-gritty of where those resources are being provisioned. The resource catalog introduces the concept of ownership into resource management, transforming static metadata into actionable knowledge, unlocking a whole new way of working with your architecture.
You can access the resource catalog from the navigation bar. Just like with the service catalog, all of your organization's resources appear under All, while resources related to services you own appear under Mine. You can easily search the resource catalog for specific components, and sort by name or identifier.
You can also filter the resource catalog by type, group, and owner.
Each resource has its own home page, just like services do — just click into any resource to see its description, owners, Slack channels, links to logs and dashboards, and more. The only significant difference is that a resource's home page will include information about resource type and resource metadata.
This similarity is intentional — the resource catalog is designed to encourage developers to think about architecture in a holistic way, which includes all of the resources that operate behind the scenes.
Resource definitions
Within the resource catalog, you’ll also see resource definitions, which is exactly what it sounds like — this is where you can find all the different types of resources that your services access. All of the resources in your organization will belong to one of the types defined here.
Each resource definition has its own home page where you can find the definition's JSON schema.
You can also find all of the specific resources that belong to this resource type.
YAML Linter
Resources are fully featured within Cortex, which means all of them have YAML files, just like services do. There are two main differences with a resource’s YAML: the x-cortex-type field and x-cortex-definition block. The x-cortex-type field dictates the resource type that applies (for example, squid-proxy or kafka-topic). The x-cortex-definition block will be validated against the JSON schema that defines the resource type.
To verify that a resource is formatted correctly before adding it to the catalog, you can use the YAML Linter available within a resource definition's home page. On this page, you'll find the general schema for the resource type, as well as an example YAML below.
If your definition has errors, Cortex will indicate what those are. In the below example, the network is missing and the IP address needs to be input as a string.
Once that information is included or corrected, click Validate YAML again to check the formatting. If there are no errors, a pop-up will appear in the bottom right corner indicating that the YAML is valid.
Importing resources
To add a new resource, select Import Resource within the resource catalog:
The first stage is determining whether you want to import from a cloud provider or through a custom resource definition. Import from Cloud Provider walks you through an import flow almost identical to the service import flow.
Import from Cloud Provider
If you choose to Import from Cloud Provider, you'll see all resources discovered by Cortex , just like when importing services. You can import resources individually, in small batches, or all at once.
The resources you select will appear under Selected Resources.
If you select multiple resources, you’ll bypass this stage and be taken directly to the confirmation page. You can return to each resource later to add this information.
Once you complete the import flow, you’ll find your new resources within the resource catalog.
Create a Resource Manually
If you choose to Create a resource manually, the first step is selecting the Resource type from the dropdown menu. Your options in the menu will populate from the resource definitions that have been created.
On the next page, you'll define the YAML schema for your new resource, designate owners, and add other important information. Cortex will automatically provide a template for the JSON schema for your resource based on your resource type selection on the prior page.
Manage your infra with resources
The resource catalog can offer your engineers unparalleled insight into every aspect of your application, including not only services, but all of the resources operating under the hood. Resources will appear in scorecards, in the query builder, and in the dependency graph, making it easy to get a clear understanding of how your infrastructure works. These tools, coupled with the ability to establish ownership over resources, will drive accountability in your teams like never before.
Comments
0 comments
Article is closed for comments.