Flagger
Search…
Flagger Install on EKS App Mesh
This guide walks you through setting up Flagger and AWS App Mesh on EKS.

App Mesh

The App Mesh integration with EKS is made out of the following components:
    Kubernetes custom resources
      mesh.appmesh.k8s.aws defines a logical boundary for network traffic between the services
      virtualnode.appmesh.k8s.aws defines a logical pointer to a Kubernetes workload
      virtualservice.appmesh.k8s.aws defines the routing rules for a workload inside the mesh
    CRD controller - keeps the custom resources in sync with the App Mesh control plane
    Admission controller - injects the Envoy sidecar and assigns Kubernetes pods to App Mesh virtual nodes
    Telemetry service - Prometheus instance that collects and stores Envoy's metrics

Create a Kubernetes cluster

In order to create an EKS cluster you can use eksctl. Eksctl is an open source command-line utility made by Weaveworks in collaboration with Amazon.
On MacOS you can install eksctl with Homebrew:
1
brew tap weaveworks/tap
2
brew install weaveworks/tap/eksctl
Copied!
Create an EKS cluster with:
1
eksctl create cluster --name=appmesh \
2
--region=us-west-2 \
3
--nodes 3 \
4
--node-volume-size=120 \
5
--appmesh-access
Copied!
The above command will create a two nodes cluster with App Mesh IAM policy attached to the EKS node instance role.
Verify the install with:
1
kubectl get nodes
Copied!

Install Helm

Install the Helm v3 command-line tool:
1
brew install helm
Copied!
Add the EKS repository to Helm:
1
helm repo add eks https://aws.github.io/eks-charts
Copied!

Enable horizontal pod auto-scaling

Install the Horizontal Pod Autoscaler (HPA) metrics provider:
1
helm upgrade -i metrics-server stable/metrics-server \
2
--namespace kube-system \
3
--set args[0]=--kubelet-preferred-address-types=InternalIP
Copied!
After a minute, the metrics API should report CPU and memory usage for pods. You can very the metrics API with:
1
kubectl -n kube-system top pods
Copied!

Install the App Mesh components

Install the App Mesh CRDs:
1
kubectl apply -k github.com/aws/eks-charts/stable/appmesh-controller//crds?ref=master
Copied!
Create the appmesh-system namespace:
1
kubectl create ns appmesh-system
Copied!
Install the App Mesh controller:
1
helm upgrade -i appmesh-controller eks/appmesh-controller \
2
--wait --namespace appmesh-system
Copied!
In order to collect the App Mesh metrics that Flagger needs to run the canary analysis, you'll need to setup a Prometheus instance to scrape the Envoy sidecars.
Install the App Mesh Prometheus:
1
helm upgrade -i appmesh-prometheus eks/appmesh-prometheus \
2
--wait --namespace appmesh-system
Copied!

Install Flagger

Add Flagger Helm repository:
1
helm repo add flagger https://flagger.app
Copied!
Install Flagger's Canary CRD:
1
kubectl apply -f https://raw.githubusercontent.com/fluxcd/flagger/main/artifacts/flagger/crd.yaml
Copied!
Deploy Flagger in the appmesh-system namespace:
1
helm upgrade -i flagger flagger/flagger \
2
--namespace=appmesh-system \
3
--set crd.create=false \
4
--set meshProvider=appmesh:v1beta2 \
5
--set metricsServer=http://appmesh-prometheus:9090
Copied!

Install Grafana

Deploy App Mesh Grafana that comes with a dashboard for monitoring Flagger's canary releases:
1
helm upgrade -i appmesh-grafana eks/appmesh-grafana \
2
--namespace appmesh-system
Copied!
You can access Grafana using port forwarding:
1
kubectl -n appmesh-system port-forward svc/appmesh-grafana 3000:3000
Copied!
Now that you have Flagger running, you can try the App Mesh canary deployments tutorial.
Last modified 8mo ago