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.
1---2apiVersion: getambassador.io/v3alpha13kind: Listener4metadata:5 name: edge-stack-listener-80806 namespace: ambassador7spec:8 port: 80809 protocol: HTTP10 securityModel: XFP11 hostBinding:12 namespace:13 from: ALL14---15apiVersion: getambassador.io/v3alpha116kind: Listener17metadata:18 name: edge-stack-listener-844319 namespace: ambassador20spec:21 port: 844322 protocol: HTTPS23 securityModel: XFP24 hostBinding:25 namespace:26 from: ALL27EOF
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.
1apiVersion: getambassador.io/v3alpha12kind: Mapping3metadata:4 name: quote-backend5spec:6 hostname: "*"7 prefix: /backend/8 service: quote9 docs:10 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.