Coder Social home page Coder Social logo

aws-samples / eks-workshop Goto Github PK

View Code? Open in Web Editor NEW
800.0 48.0 1.2K 91.09 MB

AWS Workshop for Learning EKS

Home Page: https://eksworkshop.com

License: MIT No Attribution

Shell 3.07% HTML 18.60% CSS 62.74% Dockerfile 1.89% Go 5.57% Python 8.05% JavaScript 0.08%

eks-workshop's Introduction

Gitpod Ready-to-Code

Warning This repository is in maintenance mode and currently only accepting bug-fixes. PRs for new content should be adapted for the new EKS Workshop: https://github.com/aws-samples/eks-workshop-v2

eksworkshop

Setup:

Using GitPod.io:

This is how I set up my environment: (I am using gitpod.io for editing)

  1. fork the repo to your own github account
  2. prepend gitpod.io# to the beginning of your github url. Mine becomes: https://gitpod.io#github.com/brentley/eks-workshop
  3. once gitpod has started, in the terminal, run npm install && npm run theme This will install the dependencies and clone the theme submodule.

From here, you can use the online IDE to edit /content/chapter/filename.md... If you want to preview your edits, in the terminal, run: npx hugo server. That will start the local hugo server.

A dialog box will pop up telling you "A service is listening on port 1313, but is not exposed." -- press the expose button. After that, choose "open browser" to get a new tab with your preview site. As you save edits, this tab should refresh.

When you're happy with your edits, commit, push, and open a pull request to the upstream repo's main branch. Once merged, the preview site (linked above) will be refreshed.

On a Mac:

Install Hugo: brew install hugo

On Linux:

Clone this repo:

From wherever you checkout repos: git clone [email protected]:aws-samples/eks-workshop.git (or your fork)

Clone the theme submodule:

cd eks-workshop

git submodule init ; git submodule update

Install Node.js and npm:

You can follow instructions from npm website: https://www.npmjs.com/get-npm

Install node packages:

npm install

Run Hugo locally:

npm run server or npm run drafts to see stubbed in draft pages.

npm run build will build your content locally and output to ./public/

npm run test will test the built content for bad links

View Hugo locally:

Visit http://localhost:8080/ to see the site.

Making Edits:

As you save edits to a page, the site will live-reload to show your changes.

Auto Deploy:

Any commits to main will auto build and deploy in a couple of minutes. You can see the currently deployed hash at the bottom of the menu panel.

Any commits to a branch will auto build and deploy in a couple of minutes to a custom route named with the branch name. You can see the currently deployed hash at the bottom of the menu panel. An example is the "jenkinsworld" branch would be deployed to https://eksworkshop.com/jenkinsworld/

note: shift-reload may be necessary in your browser to reflect the latest changes.

eks-workshop's People

Contributors

adamjkeller avatar alisade avatar allamand avatar arun-gupta avatar brentley avatar buzzsurfr avatar dalbhanj avatar evisb avatar fmedery avatar geremycohen avatar gfediere avatar iizotov avatar jagpk avatar jlbutler avatar joebowbeer avatar jpeddicord avatar mvaldesdeleon avatar nagi9 avatar oak2278 avatar otoolema avatar otterley avatar paavan98pm avatar praseedasathaye avatar rafaelpereyra avatar rnzsgh avatar rounoff avatar scouturier avatar trevorrobertsjr avatar tsahiduek avatar ybezsonov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eks-workshop's Issues

Build a deployment pipeline - slide deck

* Push the Docker image to registry (_*_ECR_*_)
* Write k8s manifest file
* Deploy the application
* Update the business logic, push changes to git, update the app using pipeline
* Sidecar Injection
    * service mesh? Let's use a super common sidecar example

Run batch workloads

  • showcase how to use GPU instances
  • how to use taint, toleration, affinity/anti-affinity

helm install stable/metrics-server fails

From https://eksworkshop.com/onug/logging/

When running:

helm install stable/metrics-server --name metrics-server --version 2.0.2 --namespace metrics

I get the error:

Error: release metrics-server failed: namespaces "metrics" is forbidden: User "system:serviceaccount:kube-system:default" cannot get namespaces in the namespace "metrics"

I tried to manually create the ns first and re-ran, but no dice. Any ideas whats going on? Is this dependent on another step in the tutorial that I [apparently] skipped?

Fix bugs in logging module

  • add steps to create lambda_basic_execution role. repurpose log_policy folder after renaming it to iam_policy and updating references
  • fluentd.yml : mention that us-west-2 should be updated if a different region is picked and update stream_name value to avoid lognameprefix issue
  • Add a banner to inform that all URLs default to us-west-2 and user should select the applicable region
  • Update cleanup page to remove lambda_basic_execution role

port-forward may fail if pods have not come up yet

https://eksworkshop.com/integration/monitoring/deploy-prometheus/

After

export POD_NAME=$(kubectl get pods --namespace prometheus -l "app=prometheus,component=server" -o jsonpath="{.items[0].metadata.name}")

kubectl --namespace prometheus port-forward $POD_NAME 9090

We may want to add something like:

If you get an error similar to error: unable to forward port because pod is not running. Current status=Pending the Prometheus pods may just not had a chance to come up yet. If you get this error, wait 30s, and retry the command.

Setting up Workshop infrastructure

Expected Outcomes

  • Pre Provisioned Accounts
  • Easy Start Experience
  • Easy account clean-up
  • Pre-deploy the setup from previous workshop, may be using Helm chart

Network Policies

* Configure authn, authz and RBAC
* Configure network policies

U/I interface for Workshop

Expected Outcomes

  • Create an U/I for the workshop
  • Write document that shows workflow of how to update modules

Fix bugs in monitoring chapter

Prometheus and Grafana default installation uses ClusterIP to expose its metrics and dashboards. This doesn't work well with Cloud9 when you try to run port-forwarding and try to use the ports where the services are listening.

  • Need to change how we expose Prometheus metrics
  • Need to change how we expose Grafana dashboards

EKSclt having issues while creating cluster

This is the error message I got while creating a cluster with the following command
eksctl create cluster --name=eksworkshop-eksctl --nodes=3 --node-ami=auto --region=${AWS_REGION}

2018-10-23T21:46:08Z [ℹ] using region us-west-2
2018-10-23T21:46:09Z [ℹ] setting availability zones to [us-west-2a us-west-2b us-west-2c]
2018-10-23T21:46:10Z [ℹ] using "ami-0a54c984b9f908c81" for nodes
2018-10-23T21:46:10Z [ℹ] creating EKS cluster "eksworkshop-eksctl" in "us-west-2" region
2018-10-23T21:46:10Z [ℹ] will create 2 separate CloudFormation stacks for cluster itself and the initial nodegroup
2018-10-23T21:46:10Z [ℹ] if you encounter any issues, check CloudFormation console or try 'eksctl utils describe-stacks --region=us-west-2 --name=eksworkshop-eksctl'
2018-10-23T21:46:10Z [ℹ] creating cluster stack "eksctl-eksworkshop-eksctl-cluster"
2018-10-23T21:47:06Z [✖] unexpected status "ROLLBACK_IN_PROGRESS" while waiting for CloudFormation stack "eksctl-eksworkshop-eksctl-cluster" to reach "CREATE_COMPLETE" status
2018-10-23T21:47:06Z [ℹ] fetching stack events in attempt to troubleshoot the root cause of the failure
2018-10-23T21:47:06Z [ℹ] AWS::CloudFormation::Stack/eksctl-eksworkshop-eksctl-cluster: ROLLBACK_IN_PROGRESS – "The following resource(s) failed to create: [SubnetUSWEST2A, SubnetUSWEST2B, PublicSubnetRoute, PolicyNLB, SubnetUSWEST2C]. . Rollback requested by user."
2018-10-23T21:47:06Z [✖] AWS::EC2::Subnet/SubnetUSWEST2B: CREATE_FAILED – "Resource creation cancelled"
2018-10-23T21:47:06Z [✖] AWS::EC2::Subnet/SubnetUSWEST2C: CREATE_FAILED – "Resource creation cancelled"
2018-10-23T21:47:06Z [✖] AWS::IAM::Policy/PolicyNLB: CREATE_FAILED – "Resource creation cancelled"
2018-10-23T21:47:06Z [✖] AWS::EC2::Subnet/SubnetUSWEST2A: CREATE_FAILED – "Resource creation cancelled"
2018-10-23T21:47:06Z [✖] AWS::EC2::Route/PublicSubnetRoute: CREATE_FAILED – "route table rtb-0400aa3431520b725 and network gateway igw-0c49354aae0fc78cf belong to different networks (Service: AmazonEC2; Status Code: 400; Error Code: InvalidParameterValue; Request ID: 2c781c6e-aad3-4510-959b-df0ac89ea59a)"
2018-10-23T21:47:06Z [ℹ] AWS::EC2::Route/PublicSubnetRoute: CREATE_IN_PROGRESS
2018-10-23T21:47:06Z [ℹ] AWS::EC2::SecurityGroup/ControlPlaneSecurityGroup: CREATE_COMPLETE
2018-10-23T21:47:06Z [ℹ] AWS::EC2::SecurityGroup/ControlPlaneSecurityGroup: CREATE_IN_PROGRESS – "Resource creation Initiated"
2018-10-23T21:47:06Z [ℹ] AWS::EC2::RouteTable/RouteTable: CREATE_COMPLETE
2018-10-23T21:47:06Z [ℹ] AWS::IAM::Policy/PolicyNLB: CREATE_IN_PROGRESS – "Resource creation Initiated"
2018-10-23T21:47:06Z [ℹ] AWS::EC2::Subnet/SubnetUSWEST2A: CREATE_IN_PROGRESS – "Resource creation Initiated"
2018-10-23T21:47:06Z [ℹ] AWS::EC2::Subnet/SubnetUSWEST2C: CREATE_IN_PROGRESS – "Resource creation Initiated"
2018-10-23T21:47:06Z [ℹ] AWS::EC2::RouteTable/RouteTable: CREATE_IN_PROGRESS – "Resource creation Initiated"
2018-10-23T21:47:06Z [ℹ] AWS::EC2::Subnet/SubnetUSWEST2B: CREATE_IN_PROGRESS – "Resource creation Initiated"
2018-10-23T21:47:06Z [ℹ] AWS::IAM::Policy/PolicyNLB: CREATE_IN_PROGRESS
2018-10-23T21:47:06Z [ℹ] AWS::EC2::Subnet/SubnetUSWEST2C: CREATE_IN_PROGRESS
2018-10-23T21:47:06Z [ℹ] AWS::EC2::Subnet/SubnetUSWEST2A: CREATE_IN_PROGRESS
2018-10-23T21:47:06Z [ℹ] AWS::EC2::RouteTable/RouteTable: CREATE_IN_PROGRESS
2018-10-23T21:47:06Z [ℹ] AWS::EC2::Subnet/SubnetUSWEST2B: CREATE_IN_PROGRESS
2018-10-23T21:47:06Z [ℹ] AWS::EC2::SecurityGroup/ControlPlaneSecurityGroup: CREATE_IN_PROGRESS
2018-10-23T21:47:06Z [ℹ] AWS::IAM::Role/ServiceRole: CREATE_COMPLETE
2018-10-23T21:47:06Z [ℹ] AWS::EC2::VPC/VPC: CREATE_COMPLETE
2018-10-23T21:47:06Z [ℹ] AWS::EC2::InternetGateway/InternetGateway: CREATE_COMPLETE
2018-10-23T21:47:06Z [ℹ] AWS::IAM::Role/ServiceRole: CREATE_IN_PROGRESS – "Resource creation Initiated"
2018-10-23T21:47:06Z [ℹ] AWS::EC2::InternetGateway/InternetGateway: CREATE_IN_PROGRESS – "Resource creation Initiated"
2018-10-23T21:47:06Z [ℹ] AWS::IAM::Role/ServiceRole: CREATE_IN_PROGRESS
2018-10-23T21:47:06Z [ℹ] AWS::EC2::VPC/VPC: CREATE_IN_PROGRESS – "Resource creation Initiated"
2018-10-23T21:47:06Z [ℹ] AWS::EC2::InternetGateway/InternetGateway: CREATE_IN_PROGRESS
2018-10-23T21:47:06Z [ℹ] AWS::EC2::VPC/VPC: CREATE_IN_PROGRESS
2018-10-23T21:47:06Z [ℹ] AWS::CloudFormation::Stack/eksctl-eksworkshop-eksctl-cluster: CREATE_IN_PROGRESS – "User Initiated"
2018-10-23T21:47:06Z [ℹ] 1 error(s) occurred and cluster hasn't been created properly, you may wish to check CloudFormation console
2018-10-23T21:47:06Z [ℹ] to cleanup resources, run 'eksctl delete cluster --region=us-west-2 --name=eksworkshop-eksctl'
2018-10-23T21:47:06Z [✖] waiting for CloudFormation stack "eksctl-eksworkshop-eksctl-cluster" to reach "CREATE_COMPLETE" status: ResourceNotReady: failed waiting for successful resource state
2018-10-23T21:47:06Z [✖] failed to create cluster "eksworkshop-eksctl"

The issue went away when I deleted the stack and ran the eksctl create cluster command once again

Fix bugs in Autoscaling chapter

Found some bugs and typos in Autoscaling chapter. I sent a PR that is already merged into Integration. This is ready to merge into master

Setup Pod-based roles

Deploy solution for pod based roles. will use kube2iam unless there is other feedback

few errors with eksworkshop setup (main ReadMe)

$ git submodule init git submodule update
error: pathspec 'git' did not match any file(s) known to git.
error: pathspec 'submodule' did not match any file(s) known to git.
error: pathspec 'update' did not match any file(s) known to git.

$ npm install
-bash: npm: command not found
Sorry I have brand new laptop : )
Need to include npm install steps (https://www.npmjs.com/get-npm).

$ npm run server
(truncated for abbreviation)......
ERROR 2018/09/26 11:22:31 Unable to locate template for shortcode "notice" in page "cleanup/eksctl.md"
ERROR 2018/09/26 11:22:31 Unable to locate template for shortcode "children" in page "deploy/_index.md"
ERROR 2018/09/26 11:22:31 Unable to locate template for shortcode "notice" in page "dashboard/dashboard.md"
ERROR 2018/09/26 11:22:31 Unable to locate template for shortcode "notice" in page "deploy/viewservices.md"
ERROR 2018/09/26 11:22:31 Unable to locate template for shortcode "notice" in page "eksctl/launcheks.md"
ERROR 2018/09/26 11:22:31 Unable to locate template for shortcode "children" in page "prerequisites/_index.md"
ERROR 2018/09/26 11:22:31 Unable to locate template for shortcode "notice" in page "prerequisites/account.md"
ERROR 2018/09/26 11:22:31 Unable to locate template for shortcode "notice" in page "prerequisites/k8stools.md"
ERROR 2018/09/26 11:22:31 Unable to locate template for shortcode "notice" in page "prerequisites/sshkey.md"
ERROR 2018/09/26 11:22:31 Unable to locate template for shortcode "notice" in page "prerequisites/workspace.md"
ERROR 2018/09/26 11:22:31 Unable to locate template for shortcode "notice" in page "prerequisites/workspaceiam.md"
(truncated for abbreviation)......
Error: Error building site: logged 12 error(s)

clarify that we're going to save a file and then open it and edit it.

https://eksworkshop.com/integration/monitoring/deploy-prometheus/

Change:
curl -o prometheus-values.yaml https://raw.githubusercontent.com/helm/charts/master/stable/prometheus/values.yaml

Search for # storageClass: “-”, uncomment and change the value to “prometheus”. You will do this twice, under both server & alertmanager manifests

to something like:

To install Prometheus, first we'll download the Prometheus configuration using curl, then edit the storageClass attribute.

To download the configuration as values.yaml, execute the following command:

curl -o prometheus-values.yaml https://raw.githubusercontent.com/helm/charts/master/stable/prometheus/values.yaml

Next, using a text editor, open up values.yaml, search for # storageClass: “-”, uncomment and change the value to “prometheus”. You will do this twice, under both server & alertmanager manifests

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.