Add Kubernetes questions

And AWS CodePipeline question.
This commit is contained in:
Arie Bregman
2022-08-19 13:17:49 +03:00
parent 04dc78b5b7
commit 591ef7495b
5 changed files with 215 additions and 62 deletions

View File

@@ -146,6 +146,12 @@ Failover | Route 53 | [Exercise](exercises/route_53_failover/exercise.md) | [Sol
|--------|--------|------|----|----|
| Simple Elastic Beanstalk Node.js app | Elastic Beanstalk | [Exercise](exercises/elastic_beanstalk_simple/exercise.md) | [Solution](exercises/elastic_beanstalk_simple/solution.md) | |
### CodePipeline
|Name|Topic|Objective & Instructions|Solution|Comments|
|--------|--------|------|----|----|
| Basic CI with S3 | CodePipeline & S3 | [Exercise](exercises/basic_s3_ci/exercise.md) | [Solution](exercises/basic_s3_ci/solution.md) | |
### Misc
|Name|Topic|Objective & Instructions|Solution|Comments|
@@ -1626,6 +1632,12 @@ Lifecycle hooks allows you perform extra steps before the instance goes in servi
Lifecycle hooks in pending state.
</b></details>
<details>
<summary>Describe one way to test ASG actually works</summary><br><b>
In Linux instnaces, you can install the 'stress' package and run stress to load the system for certain period of time and see if ASG kicks in by adding additional capacity (= more instances).
</b></details>
### Security
<details>

View File

@@ -0,0 +1,9 @@
# Basic CI with S3
## Objectives
1. Create a new S3 bucket
2. Add to the bucket index.html file and make it a static website
3. Create a GitHub repo and put the index.html there
4. Make sure to connect your AWS account to GitHub
5. Create a CI pipeline in AWS to publish the updated index.html from GitHub every time someone makes a change to the repo, to a specific branch

View File

@@ -0,0 +1,54 @@
# Basic CI with S3
## Objectives
1. Create a new S3 bucket
2. Add to the bucket index.html file and make it a static website
3. Create a GitHub repo and put the index.html there
4. Make sure to connect your AWS account to GitHub
5. Create a CI pipeline in AWS to publish the updated index.html from GitHub every time someone makes a change to the repo, to a specific branch
## Solution
### Manual
#### Create S3 bucket
1. Go to S3 service in AWS console
2. Insert bucket name and choose region
3. Uncheck "block public access" to make it public
4. Click on "Create bucket"
#### Static website hosting
1. Navigate to the newly created bucket and click on "properties" tab
2. Click on "Edit" in "Static Website Hosting" section
3. Check "Enable" for "Static web hosting"
4. Set "index.html" as index document and "error.html" as error document.
#### S3 bucket permissions
1. Click on "Permissions" tab in the newly created S3 bucket
2. Click on Bucket Policy -> Edit -> Policy Generator. Click on "Generate Policy" for "GetObject"
3. Copy the generated policy and go to Permissions tab and replace it with the current policy
#### GitHub Source
1. Go to Developers Tools Console and create a new connection (GitHub)
#### Create a CI pipeline
1. Go to CodePipeline in AWS console
2. Click on "Create Pipeline" -> Insert a pipeline name -> Click on Next
3. Choose the newly created source (GitHub) under sources
4. Select repository name and branch name
5. Select "AWS CodeBuild" as build provider
6. Select "Managed Image", "standard" runtime and "new service role"
7. In deploy stage choose the newly created S3 bucket and for deploy provider choose "Amazon S3"
8. Review the pipeline and click on "Create pipeline"
#### Test the pipeline
1. Clone the project from GitHub
2. Make changes to index.html and commit them (git commit -a)
3. Push the new change, verify that the newly created AWS pipeline was triggered and check the content of the site