-
Notifications
You must be signed in to change notification settings - Fork 274
eks-charts to ECR Public migration #803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
LikithaVemulapalli
merged 11 commits into
aws:main
from
LikithaVemulapalli:eks-ecrpublic
Apr 14, 2023
Merged
Changes from 4 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
3aea696
eks-charts to ECR Public migration
LikithaVemulapalli 923af3f
Removed makefile errors
LikithaVemulapalli 99660bf
Reverted release-prep make targets
LikithaVemulapalli bc50aaa
Changes made as per PR comments
LikithaVemulapalli 5c44f5a
Removed io/ioutil package as it is deprecated and used io and os pack…
LikithaVemulapalli 6cb4de4
eks-charts to ECR Public migration
LikithaVemulapalli 9ca1645
Removed makefile errors
LikithaVemulapalli 8671fd3
Reverted release-prep make targets
LikithaVemulapalli 8ba38a9
Changes made as per PR comments
LikithaVemulapalli 325ca93
Merge remote-tracking branch 'origin/eks-ecrpublic' into eks-ecrpublic
LikithaVemulapalli ebe5d78
Made changes to match with script name
LikithaVemulapalli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"description": "Helm Charts for AWS Node Termination Handler", | ||
"aboutText": "# Helm Chart for Node Termination Handler\n\n AWS NTH gracefully handles EC2 instance shutdown within Kubernetes.\n\nThis repository contains helm-charts for Node Termination Handler.\n\nFor more information on this project, see the project repo at [AWS Node Termination Handler](https://github.com/aws/aws-node-termination-handler)", | ||
"usageText": "# We can install AWS NTH using the helm chart from this repository.\n\nWe need to authenticate our helm client to ECR registry and install NTH chart using helm chart URI, detailed information on how to install helm chart can be found here [HelmChart ReadMe](https://github.com/aws/aws-node-termination-handler/tree/main/config/helm/aws-node-termination-handler#readme)" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" | ||
BUILD_DIR=$SCRIPTPATH/../build/ | ||
export PATH="${BUILD_DIR}:${PATH}" | ||
|
||
if [[ -z "${ECR_REGISTRY}" ]]; then | ||
echo "The env var ECR_REGISTRY must be set" | ||
exit 1 | ||
fi | ||
|
||
function exit_and_fail() { | ||
echo "❌ Failed to login to ECR Public Repo!" | ||
} | ||
|
||
trap exit_and_fail INT TERM ERR | ||
|
||
export HELM_EXPERIMENTAL_OCI=1 | ||
helm registry login --username AWS --password="$(aws ecr-public get-login-password --region us-east-1)" "${ECR_REGISTRY}" |
LikithaVemulapalli marked this conversation as resolved.
Show resolved
Hide resolved
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
SCRIPTPATH="$( cd "$(dirname "$0")";pwd -P )" | ||
|
||
REPO_ROOT_PATH=$SCRIPTPATH/../ | ||
MAKE_FILE_PATH=$REPO_ROOT_PATH/Makefile | ||
CHART_VERSION=$(make -s -f $MAKE_FILE_PATH chart-version) | ||
HELM_CHART_PATH=$REPO_ROOT_PATH/config/helm/aws-node-termination-handler | ||
|
||
USAGE=$(cat << 'EOM' | ||
Usage: push-helm-charts | ||
LikithaVemulapalli marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Pushes helm charts | ||
Optional: | ||
-h HELM CHART REGISTRY: set the helm chart registry | ||
-v CHART VERSION: The chart version [DEFAULT: output of `make chart-version`] | ||
-r HELM CHART REPOSITORY: Set the helm chart repository | ||
EOM | ||
) | ||
|
||
# Process our input arguments | ||
while getopts "r:v:h:" opt; do | ||
case ${opt} in | ||
r ) # Helm Chart Repository | ||
HELM_CHART_REPOSITORY="$OPTARG" | ||
;; | ||
v ) # Image Version | ||
CHART_VERSION="$OPTARG" | ||
;; | ||
h ) # Helm Chart Registry | ||
ECR_REGISTRY="$OPTARG" | ||
;; | ||
\? ) | ||
echo "$USAGE" 1>&2 | ||
exit | ||
;; | ||
esac | ||
done | ||
|
||
CHART_EXISTS=$(aws ecr-public describe-images --repository-name "helm/$HELM_CHART_REPOSITORY" --region us-east-1 --query "imageDetails[?contains(imageTags, '$CHART_VERSION')].imageTags[]" --output text) | ||
|
||
if [[ -n "$CHART_EXISTS" ]]; then | ||
echo "chart with version $CHART_VERSION already exists in the repository, skipping pushing of chart..." | ||
exit 0 | ||
fi | ||
|
||
echo "chart with version $CHART_VERSION not found in repository, pushing new chart..." | ||
#Package the chart | ||
helm package $HELM_CHART_PATH --destination $REPO_ROOT_PATH/build | ||
#Pushing helm chart | ||
helm push $REPO_ROOT_PATH/build/$HELM_CHART_REPOSITORY-$CHART_VERSION.tgz oci://$ECR_REGISTRY/helm |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.