Coder Social home page Coder Social logo

amazon-eks-sample-http-service's Introduction

AWS Sample: Simple Go Web Server for Amazon EKS

Overview

This repository contains a webserver written in Go. Its only function is to return a web page showing some interesting data about the Kubernetes Pod and EC2 instance on which it runs, along with remote IP address information.

This server can be used to illustrate the differences in behavior when you choose Instances versus IP addresses in a Network or Application Load Balancer's Target Group type. It can also be used to show the impact of enabling the Proxy v2 Protocol on Network Load Balancers.

The server listens on ports 8080 and 9080. Port 9080 requires the Proxy v2 protocol supported by AWS Network Load Balancers to provide client IP address information. Port 8080 is for use without the Proxy protocol.

Prerequisites

You'll need to create an IAM policy as follows. The policy only allows the webserver to describe EC2 network interfaces:

POLICY_ARN=$(aws iam create-policy \
  --policy-name EKSLoadBalancerDemo \
  --policy-document file://policy.json \
  --query 'Policy.Arn' --output text)

Then, you'll need to create a Service Account in your EKS cluster. This service is called aws-lb-demo in the default namespace. The podspec located in deployment.yaml refers to this name and namespace. You can change these if you like, but you'll need to make sure the podspec is also changed if you do.

eksctl create iamserviceaccount \
  --cluster $CLUSTER \
  --attach-policy-arn $POLICY_ARN \
  --namespace default \
  --name aws-lb-demo \
  --override-existing-serviceaccounts \
  --approve

Other files

The deployment.yaml file has a couple of application deployment manifests in it. ingresses.yaml contains some service and ingress manifests. Finally, the nlb-services.yaml file defines some Load Balancer services that create Network Load Balancers. It creates multiple Load Balancers via both the legacy in-tree NLB controller and the AWS Load Balancer v2 controller.

Warnings

This software is unsupported and not for production use. It is for demonstration purposes only.

Use of this software may cause you to incur AWS charges for the resources created. Charges are the sole responsibility of the customer. We encourage you to destroy these resources after you have finished using them.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.