Glasnostic for AWS Wavelength Quick Start (EKS)

This document explains how to get up and running with Glasnostic on an existing AWS EKS cluster running on AWS Wavelength. The process consists of three simple steps:

  1. Create a Glasnostic network identifier for your cluster.
  2. Install Glasnostic for Wavelength.
  3. Restart pods to pick up the new sidecars.

Prerequisites

Glasnostic for AWS Wavelength supports Kubernetes version 1.17 and above. You’ll need a Linux or macOS machine to run the installer.

If you’re not having an EKS cluster running on Wavelength yet, please follow the instructions in the appendix section Install EKS on Wavelength.

1. Create a Network Identifier

To register EKS clusters with the proper Glasnostic environment, each Glasnostic for Wavelength installation needs a unique identifier. This is called a “network identifier”.

To create this identifier, log into your account at glasnostic.com and select the environment you want to use for your cluster. (In this document, we’ll use the default “My Environment”.)

Choose “Manage…” from the menu.

Screenshot of Glasnostic console

Click the “Settings” link next to “My Environment”:

Screenshot of Glasnostic console showing list of environments

Click “Add network” to add a new network representing your cluster:

Screenshot of Glasnostic console showing details of the environment

Copy the automatically generated identifier by clicking on the icon:

Screenshot of Glasnostic console showing list of the networks

With that network identifier, you are ready to install Glasnostic for Wavelength.

2. Install Glasnostic for Wavelength

Replacing [NETWORK_ID] with the network identifier retrieved in step 1, install Glasnostic for Wavelength using this command:

curl -s https://get.glasnostic.com/install-wavelength-eks | bash -s [NETWORK_ID]

If you want to install Glasnostic on an EKS cluster that is different from your current cluster, you can provide an appropriate kubeconfig file as a second parameter:

curl -s https://get.glasnostic.com/install-wavelength-eks | bash -s [NETWORK_ID] [KUBECONFIG]

Once the installation completes, you will see this message:

Glasnostic for AWS Wavelength (EKS) 1.0 has been installed successfully.

Congratulations! Glasnostic for Wavelength is now installed and ready to run.

3. Restart Running Pods

Glasnostic for Wavelength is using the sidecar pattern to control interactions between pods. Sidecars are injected automatically for newly created pods but existing pods have to be restarted to get their sidecar.

To restart pods, just delete them and EKS will restart them automatically. For example, to delete all pods in the default namespace, run:

kubectl delete po -n default --all

By default, Glasnostic injects sidecars into pods in all namespaces other than the kube-system namespace. To exclude a namespace, label it with glasnostic=disable, e.g.:

kubectl label namespace default glasnostic=disable

Then delete the pods as shown above. As before, replace ‘default’ with the namespace you want to exclude.

Note: Because sidecar injection uses iptable rules to redirect traffic to the sidecar within the isolated network namespace of the pod, sidecars can only be injected into pods that communicate via the pod network. This excludes pods that have hostNetwork enabled.

Check Whether Sidecars Are Running

Run kubectl get po -A to check whether pods were injected with the Glasnostic sidecar. If the READY column of that command’s output shows an additional container, the sidecar is running inside the pod. For instance, if your output would normally show 1/1 :

$ kubectl get po -A
NAMESPACE       NAME                              READY
default         adservice-5597994964-mvml4          1/1

Then that same pod with a sidecar running inside it would show 2/2 :

$ kubectl get po -A
NAMESPACE       NAME                              READY
default         adservice-5597994964-mvml4          2/2

Where to Go From Here

Now that Glasnostic is running on your EKS cluster, log into the Glasnostic console at app.glasnostic.com and select “My environment” from the environment drop-down. Assuming your EKS cluster is up, reachable and has applications actively serving requests, you will see a service map showing which pods are running as well as calls between them.

Screenshot of Glasnostic console
Glasnostic UI. The service map on the left shows Interactions between pods of a sample application deployed in two namespaces. The cyan-colored nodes are load generator pods. The right side shows short-term behaviors of various subsets of the architecture.

To create views of specific parts of your architecture, click “Create View”. See “Getting Started with Glasnostic” for an introduction to Glasnostic.

Uninstall Glasnostic

To uninstall Glasnostic for Wavelength, just run the following commands:

$ kubectl --kubeconfig [KUBECONFIG] delete ns glasnostic-system
$ kubectl --kubeconfig [KUBECONFIG] delete Mutatingwebhookconfigurations/glasnostic-sidecar-injector

As it’s a standard kubectl command, passing the kubeconfig is optional.

The first command is removing the system namespace containing the Glasnostic installation, where the second command deletes the sidecar injector.

Appendix: Install EKS on Wavelength

To install EKS on Wavelength, follow the Lab 3 example from Vodafone. This setup is running out of the box, except that Glasnostic requires egress from the Wavelength zone to the internet to access glasnostic.com.

As a quick workaround, you can assign carrier IPs to each wavelength worker node by:

  1. Allocating a Carrier IP:
$ aws ec2 allocate-address --domain vpc --region <Your-Region> --network-border-group <Wavelength-zone-id>
  1. Retrieving the Allocation ID:
$ aws ec2 describe-addresses
  1. And associating the Carrier IP to nodes:
$ aws ec2 associate-address --allocation-id <AllocationID> --network-interface-id <NIC-ID><

See Amazon Carrier gateways documentation for reference.