Introduction to Wayfinder CRDs
Custom Resource Definitions (CRDs) provide a way to extend the Kubernetes API. Kubernetes has several built-in resources such as pods and deployments. A CRD provides a specification for an additional custom Kubernetes resource.
Wayfinder installs custom resources into the kubernetes API to provide specific functionality. From these, you can create custom objects in yaml based on the CRD specification, and then apply the object to Wayfinder.
Once you create and apply these objects, you can manage them using the Kubernetes CLI (
kubectl) and the Wayfinder CLI (
For users comfortable with creating instances of Kubernetes resources in yaml, the CRDs can be used for automations, creating custom policies, or extending Wayfinder to suit your needs.
See the API Reference for descriptions of Wayfinder CRDs.
For more information, see Create custom objects in the Kubernetes documentation.
Creating and applying a custom object in Wayfinder
Wayfinder CRDs let you create custom object instances.
Example of creating an object instance
Here is a simple example of how an object instance is related to a CRD. (See more complex examples below.)
The User object specification defines the fields required for an instance of that object. To create a user object based on the specification, you will provide:
- spec: email, username
Here's example yaml for the above:
After saving this file, you now must apply it to Wayfinder. See below.
Apply the object in Wayfinder
When you create a custom object instance as in the example above, you must apply it to Wayfinder before you can manage that object using the Wayfinder and Kubernetes CLIs (
To apply a custom object to Wayfinder:
Create the object definition in a yaml file. See the example above.
Apply the file using the CLI:
wf apply -f PATH-TO-FILE.yaml
View details and status of an object
You can view details and status of any object/resource in Wayfinder.
To list and view details of objects:
To list objects/resources in Wayfinder, use the command:
wf get OBJECT
wf get clusterslists all clusters in your current workspace.
wf get userslists all users in your current workspace.
To view details and status of an object in Wayfinder, add
-o yamlto the command:
wf get OBJECT OBJECT-NAME -o yaml
wf get cluster eks-dev -o yamlreturns the details and status of the
eks-devcluster in your current workspace.
wf get plan aks-nonprod -o yamlreturns the details of the
Example use cases
Here are some examples of using CRDs in Wayfinder.
Apply custom security policies
You can write custom security policies using Wayfinder's Policy CRD. Whether you want to control access or resource usage across Wayfinder, or a). These links walk you through:
Add an RBAC role
Wayfinder comes with some roles pre-defined, such as
cluster.admin, which have a set of permissions. You can use the PolicyPlan CRD to add more roles if needed.
For an example, see:
Define network peering
You can define how you want your networks to be wired up. The links below provide example peering definitions, which use the PeeringRule CRD for the following network topologies:
- AWS Transit Gateway attachment performs a VPC attachment to a centrally managed backbone.
- Management Network provides the ability to connect back directly to the control plane.
- Azure Hub & Spoke connects your networks to a central control plane.
See also Overview of Peering.