Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified aws-cdk-eks-adot-alert-incidentmgr/bootstrap-env.sh
100755 → 100644
Empty file.
Empty file modified aws-cdk-eks-adot-alert-incidentmgr/format_display.sh
100755 → 100644
Empty file.
Empty file modified batch-processing-with-k8s/cdk.json
100755 → 100644
Empty file.
3 changes: 0 additions & 3 deletions batch-processing-with-k8s/payload/load-test-payloads.zip

This file was deleted.

129 changes: 48 additions & 81 deletions bottlerocket-images-cache/cloud9_init.sh
Original file line number Diff line number Diff line change
@@ -1,85 +1,52 @@
#!/bin/bash
#update cli
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install

#install jq.....
sudo yum -y install jq gettext bash-completion moreutils

echo 'yq() {
docker run --rm -i -v "${PWD}":/workdir mikefarah/yq "$@"
}' | tee -a ~/.bashrc && source ~/.bashrc

#ec2 iam profile.
export instance_id=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)
export EC2_ASSOCIATE_ID=$(aws ec2 describe-iam-instance-profile-associations --filters Name=instance-id,Values=$instance_id | jq -r '.IamInstanceProfileAssociations[0].AssociationId')
aws ec2 replace-iam-instance-profile-association --iam-instance-profile Name=eksworkshop-admin --association-id $EC2_ASSOCIATE_ID

#install kubectl
sudo curl --silent --location -o /usr/local/bin/kubectl \
https://amazon-eks.s3.us-west-2.amazonaws.com/1.19.6/2021-01-05/bin/linux/amd64/kubectl

sudo chmod +x /usr/local/bin/kubectl

kubectl completion bash >> ~/.bash_completion
. /etc/profile.d/bash_completion.sh
. ~/.bash_completion

#set the AWS Load Balancer Controller version
echo 'export LBC_VERSION="v2.4.1"' >> ~/.bash_profile
echo 'export LBC_CHART_VERSION="1.4.1"' >> ~/.bash_profile
source ~/.bash_profile

#update-environment
aws cloud9 update-environment --environment-id $C9_PID --managed-credentials-action DISABLE
rm -vf ${HOME}/.aws/credentials

export ACCOUNT_ID=$(aws sts get-caller-identity --output text --query Account)
export AWS_REGION=$(curl -s 169.254.169.254/latest/dynamic/instance-identity/document | jq -r '.region')
export AZS=($(aws ec2 describe-availability-zones --query 'AvailabilityZones[].ZoneName' --output text --region $AWS_REGION))

test -n "$AWS_REGION" && echo AWS_REGION is "$AWS_REGION" || echo AWS_REGION is not set

echo "export ACCOUNT_ID=${ACCOUNT_ID}" | tee -a ~/.bash_profile
echo "export AWS_REGION=${AWS_REGION}" | tee -a ~/.bash_profile
echo "export AZS=(${AZS[@]})" | tee -a ~/.bash_profile
aws configure set default.region ${AWS_REGION}
aws configure get default.region

#check the iam role is valid or not.
aws sts get-caller-identity --query Arn | grep eksworkshop-admin -q && echo "IAM role valid" || echo "IAM role NOT valid"

#create custom kms.
#aws kms create-alias --alias-name alias/eksworkshop --target-key-id $(aws kms create-key --query KeyMetadata.Arn --output text)

#export MASTER_ARN=$(aws kms describe-key --key-id alias/eksworkshop --query KeyMetadata.Arn --output text)
#echo "export MASTER_ARN=${MASTER_ARN}" | tee -a ~/.bash_profile

source ~/.bash_profile

#install eksctl
# Initialize region
if [ -z "$AWS_DEFAULT_REGION" ]; then
echo "Setting default region to us-east-1"
AWS_DEFAULT_REGION="us-east-1"
fi
export AWS_REGION="$AWS_DEFAULT_REGION"
echo "Using region: $AWS_REGION"
# Test AWS CLI with region
if ! aws sts get-caller-identity --region "$AWS_REGION"; then
echo "Failed to validate AWS credentials"
exit 1
fi
# Get Account ID
ACCOUNT_ID=$(aws sts get-caller-identity --region "$AWS_REGION" --query "Account" --output text)
echo "Account ID: $ACCOUNT_ID"
# Get Availability Zones
AZS=$(aws ec2 describe-availability-zones --region "$AWS_REGION" --query "AvailabilityZones[].ZoneName" --output text)
echo "Available AZs: $AZS"
# Install kubectl
curl --silent --location -o kubectl \
https://amazon-eks.s3.us-west-2.amazonaws.com/1.19.6/2021-01-05/bin/linux/amd64/kubectl
chmod +x kubectl
mkdir -p $HOME/bin && mv kubectl $HOME/bin/
export PATH=$PATH:$HOME/bin
# Set environment variables
{
echo "export AWS_REGION=\"$AWS_REGION\""
echo "export ACCOUNT_ID=\"$ACCOUNT_ID\""
echo "export AZS=($AZS)"
echo "export PATH=\$PATH:\$HOME/bin"
} >> ~/.bash_profile
# Install eksctl
curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp

sudo mv -v /tmp/eksctl /usr/local/bin

eksctl version

#add the bash completion on eksctl.
eksctl completion bash >> ~/.bash_completion
. /etc/profile.d/bash_completion.sh
. ~/.bash_completion

##install helm
mkdir -p $HOME/bin
mv -v /tmp/eksctl $HOME/bin/
# Install helm
curl -sSL https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash

#helm init.
# Setup completions
{
kubectl completion bash
eksctl completion bash
helm completion bash
} >> ~/.bash_completion
source ~/.bash_completion
source ~/.bash_profile
# Verify installations
echo "Verifying installations..."
kubectl version --client
eksctl version
helm version --short
helm repo add stable https://charts.helm.sh/stable
helm search repo stable

#helm bash completion.
helm completion bash >> ~/.bash_completion
. /etc/profile.d/bash_completion.sh
. ~/.bash_completion
source <(helm completion bash)
echo "Setup complete!"
Empty file modified bottlerocket-images-cache/run.sh
100755 → 100644
Empty file.
Empty file modified bottlerocket-images-cache/snapshot.sh
100755 → 100644
Empty file.
Empty file.
Empty file.
Empty file modified custom-kubernetes-scheduler/check_pod_spread.sh
100755 → 100644
Empty file.
Empty file modified custom-kubernetes-scheduler/check_webhook_logs.sh
100755 → 100644
Empty file.
Empty file.
Empty file modified custom-kubernetes-scheduler/deploy/webhook-patch-ca-bundle.sh
100755 → 100644
Empty file.
Empty file modified ecsa-svc-disc/script/ecsa-svc-disc-set-tg-tags.sh
100755 → 100644
Empty file.
Empty file modified ecsa-svc-disc/script/ecsa-svc-disc-show-tasks.sh
100755 → 100644
Empty file.
Empty file modified ecsa-svc-disc/script/ecsa-svc-disc-show-tg-health.sh
100755 → 100644
Empty file.
Empty file modified grafana-operator-AMG/bootstrap-env.sh
100755 → 100644
Empty file.
Empty file modified prefetch-data-to-EKSnodes/build-docker-image.sh
100755 → 100644
Empty file.
Empty file modified prefetch-data-to-EKSnodes/cleanup.sh
100755 → 100644
Empty file.
Empty file modified prefetch-data-to-EKSnodes/get-pod-boot-time.sh
100755 → 100644
Empty file.
Empty file modified prefetch-data-to-EKSnodes/pod.sh
100755 → 100644
Empty file.
Empty file modified scaling-with-KEDA/build-docker-image.sh
100755 → 100644
Empty file.
Empty file modified scaling-with-KEDA/build-k8s-scripts.sh
100755 → 100644
Empty file.