Edge Stack Configuration

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.

Steps

Import Edge Stack CRD YAML and Deploy

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.

  1. In the left sidebar, click on the upward arrow symbol (import icon) to import the file into Meshery.

  2. In the modal that appears:

    • Enter a name for your design in the Design File Name field (e.g. Edge-stack-crd).
    • Select Kubernetes Manifest from the Design Type dropdown menu.
    • Choose Url upload for the upload method, and paste in the Edge-Stack-crd YAML link.
    • Then, click on Import.
  1. 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.

  2. Click Actions in the top right corner and click on Deploy (double tick).

  3. To check the status of your deployment, click on the notification icon on the top right corner.

  1. Click on Open In visualizer to navigate to the Visualize section and see a pre-filtered view of the deployed resources in the cluster.

Import the Edge Stack YAML

Now that the CRDs have been deployed, go ahead to deploy the main Edge Stack Configuration.

  1. Follow the previous Steps to Import the Edge Stack YAML into Kanvas with the name Edge-Stack.
  1. You can use the Group Components icon on the dock below to group resources based on shared labels or annotations.

Configure Edge Stack License

Ambassador Edge Stack requires a valid license to operate. Generate your license token to establish a secure connection between Edge Stack and Ambassador Cloud.

  1. 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.

  2. Click on the Secret component on the design canvas and input the token.

Deploy Edge Stack

  1. Click Actions in the top right corner and click on Deploy (double tick).

  2. Click on Open In visualizer to navigate to the Visualize section and see a pre-filtered view of the deployed resources in the cluster.

Listener Custom Resource

The Listener Custom Resource tells Ambassador Edge Stack what port to listen on.

  1. Copy the following the YAML and save it to a file called listener.yaml , then import it into Kanvas.
1---
2apiVersion: getambassador.io/v3alpha1
3kind: Listener
4metadata:
5 name: edge-stack-listener-8080
6 namespace: ambassador
7spec:
8 port: 8080
9 protocol: HTTP
10 securityModel: XFP
11 hostBinding:
12 namespace:
13 from: ALL
14---
15apiVersion: getambassador.io/v3alpha1
16kind: Listener
17metadata:
18 name: edge-stack-listener-8443
19 namespace: ambassador
20spec:
21 port: 8443
22 protocol: HTTPS
23 securityModel: XFP
24 hostBinding:
25 namespace:
26 from: ALL
27EOF
  1. Deploy the resource on Kanvas.

Mapping Resource

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/v3alpha1
2kind: Mapping
3metadata:
4 name: quote-backend
5spec:
6 hostname: "*"
7 prefix: /backend/
8 service: quote
9 docs:
10 path: "/.ambassador-internal/openapi-docs"

Deploy Quote Service

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.

NEXT CHAPTER

Introduction

Layer5, the cloud native management company