In this chapter, you will import and deploy Edge Stack Custom Resource Definitions (CRDs) and YAML files. You’ll learn how to configure the necessary Ambassador Cloud license and set up essential components like Listener and Mapping resources. Finally, you’ll deploy a sample Quote service application to route traffic through Edge Stack.
The Edge Stack CRD YAML file typically contains the definitions for custom resources used by Edge Stack. These definitions include the schemas and validation rules for resources like Mappings, Hosts, TLSContexts, RateLimits, Filters, and more. These custom resources allow you to define and manage the various aspects of your API gateway configuration, such as routing, authentication, rate limiting, and TLS settings, directly within your Kubernetes cluster.
In the left sidebar, click on the upward arrow symbol (import icon) to import the file into Meshery.
In the modal that appears:
Click on the name of the design on the Designs tab to display the visual representations of the various Kubernetes resources and their relationships on the canvas.
Click Actions in the top right corner and click on Deploy (double tick).
To check the status of your deployment, click on the notification icon on the top right corner.
Now that the CRDs have been deployed, go ahead to deploy the main Edge Stack Configuration.
Ambassador Edge Stack requires a valid license to operate. Generate your license token to establish a secure connection between Edge Stack and Ambassador Cloud.
Complete the steps on the Ambassador Cloud to generate your license token, then copy the token. Be sure to convert it into base64 format. You can use an online tool for this conversion.
Click on the Secret component on the design canvas and input the token.
Click Actions in the top right corner and click on Deploy (double tick).
Click on Open In visualizer to navigate to the Visualize section and see a pre-filtered view of the deployed resources in the cluster.
The Listener Custom Resource tells Ambassador Edge Stack what port to listen on.
---
apiVersion: getambassador.io/v3alpha1
kind: Listener
metadata:
name: edge-stack-listener-8080
namespace: ambassador
spec:
port: 8080
protocol: HTTP
securityModel: XFP
hostBinding:
namespace:
from: ALL
---
apiVersion: getambassador.io/v3alpha1
kind: Listener
metadata:
name: edge-stack-listener-8443
namespace: ambassador
spec:
port: 8443
protocol: HTTPS
securityModel: XFP
hostBinding:
namespace:
from: ALL
EOF
Create a Mapping configuration that instructs Edge Stack on how and where to route traffic. In the YAML file below, any request coming to the specified hostname with the prefix /backend/ will be directed to the quote service.
Copy the following the YAML and save it to a file called mapping.yaml , then import it into Kanvas.
apiVersion: getambassador.io/v3alpha1
kind: Mapping
metadata:
name: quote-backend
spec:
hostname: "*"
prefix: /backend/
service: quote
docs:
path: "/.ambassador-internal/openapi-docs"
Next, import the Quote Service YAML and deploy it on Kanvas. This step will create the necessary deployment and service resources for the Quote service within your Kubernetes cluster, allowing you to see how Edge Stack manages and routes traffic to this backend service.