Forked from jdluther2020/amazon-eks-immersion-ch1.2.sh
Created
November 21, 2022 11:16
-
-
Save avi202020/37e9bf36dca5df0b7cd7977895e55f85 to your computer and use it in GitHub Desktop.
Working The Amazon EKS Immersion Workshop - Chapter 1 - Deploying A Microservices Application In A Kubernetes Cluster
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
# Purpose: Working The Amazon EKS Immersion Workshop - CH 1.2 — Deploy Microservices Application Using Helm | |
# Ref: https://catalog.workshops.aws/eks-immersionday/en-US/helm | |
# | |
# Author's NOTE | |
# 1. # are comment lines | |
# 2. Command output wherever helpful is shown inside {} | |
# | |
# Set working location | |
cd $WORKSHOP_HOME | |
# Clone repo unless cloned already | |
git clone https://github.com/aws-containers/eks-app-mesh-polyglot-demo.git | |
cd eks-app-mesh-polyglot-demo | |
# Dry run. | |
# Note - Dry run out produces the manifest that's worth taking a look. | |
helm install --debug --dry-run workshop ./workshop/helm-chart/ | |
# Final run | |
helm install workshop ./workshop/helm-chart/ | |
{ | |
NAME: workshop | |
LAST DEPLOYED: Sat Oct 22 17:52:44 2022 | |
NAMESPACE: default | |
STATUS: deployed | |
REVISION: 1 | |
NOTES: | |
1. Get the application URL by running these commands: | |
NOTE: It may take a few minutes for the LoadBalancer to be available. | |
You can watch the status of by running 'kubectl get --namespace workshop svc -w frontend' | |
export LB_NAME=$(kubectl get svc --namespace workshop frontend -o jsonpath="{.status.loadBalancer.ingress[*].hostname}") | |
echo http://$LB_NAME:80 | |
} | |
# List chart to confirm | |
helm list | |
{ | |
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION | |
workshop default 1 2022-10-22 17:52:44.746801 -0700 PDT deployed productcatalog_workshop-1.0.0 1.0 | |
} | |
# Confirm pods and services are up | |
kubectl get pod,svc -n workshop -o wide | |
{ | |
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES | |
pod/frontend-5ffb7ffc69-42hnz 1/1 Running 0 2m17s 192.168.51.0 ip-192-168-52-95.ec2.internal <none> <none> | |
pod/prodcatalog-5c47947fb7-4jg84 1/1 Running 0 2m17s 192.168.31.49 ip-192-168-0-78.ec2.internal <none> <none> | |
pod/proddetail-69d4b5fbdc-fjvz5 1/1 Running 0 2m17s 192.168.46.226 ip-192-168-52-95.ec2.internal <none> <none> | |
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR | |
service/frontend LoadBalancer 10.100.90.2 a7c8fc2ca26e34965ab2fe73aa78d7df-1220770866.us-east-1.elb.amazonaws.com 80:31722/TCP 2m18s app=frontend | |
service/prodcatalog ClusterIP 10.100.247.9 <none> 5000/TCP 2m18s app=prodcatalog | |
service/proddetail ClusterIP 10.100.12.144 <none> 3000/TCP 2m18s app=proddetail | |
} | |
# Get the Loadbalancer url above or with command below anytime to access the application | |
export LB_NAME=$(kubectl get svc frontend -n workshop -o jsonpath="{.status.loadBalancer.ingress[*].hostname}") | |
echo $LB_NAME | |
{ | |
http://a7c8fc2ca26e34965ab2fe73aa78d7df-1220770866.us-east-1.elb.amazonaws.com:80 | |
} | |
# http://a7c8fc2ca26e34965ab2fe73aa78d7df-1220770866.us-east-1.elb.amazonaws.com should pull the website. | |
# Test the ADD functionality by adding a product id and product name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment