Skip to content

Commit

Permalink
ECR documents (#25)
Browse files Browse the repository at this point in the history
* docs(ecr): new README for ECR example

* docs(eks): updated description of update-kubeconfig.sh

* docs(ecr): updated instructions
  • Loading branch information
Young-ook authored Dec 31, 2020
1 parent 49556bb commit 4c8f3c5
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 8 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ Run terraform:
$ terraform init
$ terraform apply
```
## Generate kubernetes config
This terraform module provides users with a shell script that extracts the kubeconfig file of the EKS cluster. When users run the terraform init command in their workspace, the script is downloaded with the terraform module from the terraform registry. User can see how to run this script in terraform output after terraform apply command completes successfully. Using this script, users can easily obtain a kubeconfig file. So, they can use this kubeconfig file for access to the EKS cluster (with Spinnaker). The original script is here [update-kubeconfig.sh](https://github.com/Young-ook/terraform-aws-eks/blob/main/script/update-kubeconfig.sh) and users can check out the details of the script.

### Generate kubernetes config
This terraform module will give you a shell script to get kubeconfig file of an EKS cluster. You will find the [update-kubeconfig.sh](https://github.com/Young-ook/terraform-aws-eks/blob/main/script/update-kubeconfig.sh) script in the `script` directory of this repository. You can get the kubeconfig file with credentials to access your EKS cluster using this script. For more detail of how to use this, please refer to the help message of the script.

[Important] Before you run this script you must configure your local environment to have proper permission to get the credentials from EKS cluster on your AWS account whatever you are using aws-cli or aws-vault.
**[Important]** Before you run this script you must configure your local environment to have proper permission to get the credentials from EKS cluster on your AWS account whatever you are using aws-cli or aws-vault.

## IAM Role for Service Account
After then you will see the created EKS cluster and node groups and IAM role. For more information about configuration of service account mapping for IAM role in Kubernetes, please check out the [IAM Role for Service Accounts](https://github.com/Young-ook/terraform-aws-eks/blob/main/modules/iam-role-for-serviceaccount/README.md)
Expand Down
28 changes: 28 additions & 0 deletions examples/ecr/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Amazon ECR

## Setup
[This](https://github.com/Young-ook/terraform-aws-eks/blob/main/examples/ecr/main.tf) is the example of terraform configuration file to create an ECR (Elastic Container Registry) on your AWS account. Check out and apply it using terraform command.

Run terraform:
```
terraform init
terraform apply
```
Also you can use the `-var-file` option for customized paramters when you run the terraform plan/apply command.
```
terraform plan -var-file default.tfvars
terraform apply -var-file default.tfvars
```

## Register Artifacts
To register and release the artifacts from your build system, please check out [this](https://github.com/Young-ook/terraform-aws-eks/blob/main/modules/ecr) for more details.

## Clean up
Run terraform:
```
$ terraform destroy
```
Don't forget you have to use the `-var-file` option when you run terraform destroy command to delete the aws resources created with extra variable files.
```
$ terraform destroy -var-file default.tfvars
```
2 changes: 1 addition & 1 deletion examples/ecr/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module "vpc" {
# the com.amazonaws.region.ecr.dkr Amazon ECR VPC endpoint and the Amazon S3 gateway endpoints.
#
# Amazon ECS tasks using the Fargate launch type and platform version 1.4.0 or later require both
# the com.amazonaws.region.ecr.dkr and com.amazonaws.region.ecr.api Amazon ECR VPC endpoints and
# the com.amazonaws.region.ecr.dkr and com.amazonaws.region.ecr.api Amazon ECR VPC endpoints and
# the Amazon S3 gateway endpoints.
#
# For more default, please visit the https://docs.aws.amazon.com/AmazonECR/latest/userguide/vpc-endpoints.html
Expand Down
10 changes: 7 additions & 3 deletions modules/ecr/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Amazon ECR (Elastic Container Registry)
[Amazon Elastic Container Registry](https://aws.amazon.com/ecr/) is a fully managed container registry that makes it easy to store, manage, share, and deploy your container images and artifacts anywhere. Amazon ECR eliminates the need to operate your own container repositories or worry about scaling the underlying infrastructure. Amazon ECR hosts your images in a highly available and high-performance architecture, allowing you to reliably deploy images for your container applications. You can share container software privately within your organization or publicly worldwide for anyone to discover and download.

* You want to create an ECR and this module will create an ECR.
[Amazon Elastic Container Registry](https://aws.amazon.com/ecr/) is a fully managed container registry that makes it easy to store, manage, share, and deploy your container images and artifacts anywhere. Amazon ECR eliminates the need to operate your own container repositories or worry about scaling the underlying infrastructure. Amazon ECR hosts your images in a highly available and high-performance architecture, allowing you to reliably deploy images for your container applications. You can share container software privately within your organization or publicly worldwide for anyone to discover and download. This module will create an ECR on AWS.

## Quickstart
### Setup
Expand All @@ -16,3 +14,9 @@ Run terraform:
terraform init
terraform apply
```

## Pushing a Docker image
Follow [these](https://docs.aws.amazon.com/AmazonECR/latest/userguide/docker-push-ecr-image.html) instructions

## Pushing a Helm chart
Follow [these](https://docs.aws.amazon.com/AmazonECR/latest/userguide/push-oci-artifact.html) instructions

0 comments on commit 4c8f3c5

Please sign in to comment.