Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EKS multiple listener support walkthrough #508

Merged
merged 6 commits into from
Sep 13, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions walkthroughs/howto-k8s-multiple-listeners/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ This example illustrates usage of multiple listeners using AppMesh on EKS. This
## Prerequisites
1. [Walkthrough: App Mesh with EKS](../eks/)

2. The manifest in this walkthrough requires [aws-app-mesh-controller-for-k8s](https://github.com/aws/aws-app-mesh-controller-for-k8s) version [>=v1.0.0](https://github.com/aws/aws-app-mesh-controller-for-k8s/releases/tag/v1.0.0). Run the following to check the version of controller you are running.
2. The manifest in this walkthrough requires [aws-app-mesh-controller-for-k8s](https://github.com/aws/aws-app-mesh-controller-for-k8s) version [>=v1.6.1](https://github.com/aws/aws-app-mesh-controller-for-k8s/releases/tag/v1.0.0). Run the following to check the version of controller you are running.
paulyeo21 marked this conversation as resolved.
Show resolved Hide resolved
```
kubectl get deployment -n appmesh-system appmesh-controller -o json | jq -r ".spec.template.spec.containers[].image" | cut -f2 -d ':'|tail -n1
```

3. Install Docker

## Setup
1. Clone this repository and navigate to the walkthrough/howto-k8s-egress folder, all commands will be ran from this location
1. Clone this repository and navigate to the walkthrough/howto-k8s-multiple-listeners folder, all commands will be ran from this location

2. Your AWS account id:

Expand Down Expand Up @@ -40,8 +40,14 @@ Validate port 8080 and port 8090 are accepted
export EXTERNAL_IP1=$(kubectl get svc/colors-gw-1 -n colors -o go-template='{{(index .status.loadBalancer.ingress 0).hostname}}'
export EXTERNAL_IP2=$(kubectl get svc/colors-gw-2 -n colors -o go-template='{{(index .status.loadBalancer.ingress 0).hostname}}'

curl $EXTERNAL_IP1
curl $EXTERNAL_IP2
curl $EXTERNAL_IP1 | grep 8080
curl $EXTERNAL_IP2 | grep 8090
```

* using two load balancers because it requires manual setup to create two listeners (see https://github.com/kubernetes-sigs/aws-load-balancer-controller/issues/2234)

## Cleanup

```
kubectl delete -f manifest.yaml
```
2 changes: 1 addition & 1 deletion walkthroughs/howto-k8s-multiple-listeners/app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func startServer(port string) {

mux.Handle("/ping", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {}))
mux.Handle("/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, "Hello world")
fmt.Fprintf(w, "Hello world %s\n", port)
}))

log.Fatal(http.ListenAndServe(fmt.Sprintf(":%s", port), mux))
Expand Down
6 changes: 3 additions & 3 deletions walkthroughs/howto-k8s-multiple-listeners/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ spec:
apiVersion: appmesh.k8s.aws/v1beta2
kind: VirtualNode
metadata:
name: white
name: multi-colors
namespace: colors
spec:
podSelector:
Expand Down Expand Up @@ -138,7 +138,7 @@ spec:
action:
weightedTargets:
- virtualNodeRef:
name: white
name: multi-colors
weight: 1
port: 8080
- name: color-route-black
Expand All @@ -149,7 +149,7 @@ spec:
action:
weightedTargets:
- virtualNodeRef:
name: white
name: multi-colors
weight: 1
port: 8090
---
Expand Down