AWS CLI V2
# x86 x64
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
aws --version
# ARM64
curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
aws --version
Shell
복사
Docker
sudo yum install docker -y
sudo systemctl enable docker
sudo usermod -aG docker ec2-user
sudo usermod -aG docker root
sudo systemctl start docker
sudo chmod 666 /var/run/docker.sock
docker --version
Shell
복사
Docker Compose
sudo mkdir -p /usr/local/lib/docker/cli-plugins/
sudo curl -SL "https://github.com/docker/compose/releases/latest/download/docker-compose-linux-$(uname -m)" -o /usr/local/lib/docker/cli-plugins/docker-compose
sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
docker compose version
Shell
복사
Kubectl
# x86 x64
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
kubectl version
# ARM64
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl"
curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl.sha256"
echo "$(cat kubectl.sha256) kubectl" | sha256sum --check
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
kubectl version --client
Shell
복사
EKSCTL
# x86 x64
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
# ARM64
curl -sLO "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_Linux_arm64.tar.gz"
tar -xzf eksctl_Linux_arm64.tar.gz -C /tmp && rm eksctl_Linux_arm64.tar.gz
sudo mv /tmp/eksctl /usr/local/bin
eksctl version
Shell
복사
HELM
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
helm version
Shell
복사
K9S
sudo yum install -y wget
wget wget https://github.com/derailed/k9s/releases/download/v0.32.5/k9s_Linux_amd64.tar.gz
tar -xf k9s_Linux_amd64.tar.gz
chmod +x k9s
sudo mv k9s /usr/local/bin
Shell
복사
EKS Node Viewer
wget -O eks-node-viewer https://github.com/awslabs/eks-node-viewer/releases/download/v0.7.1/eks-node-viewer_Linux_x86_64
chmod +x eks-node-viewer
sudo mv -v eks-node-viewer /usr/local/bin
eks-node-viewer
Shell
복사
SSM
sudo dnf install -y https://s3.amazonaws.com/session-manager-downloads/plugin/latest/linux_64bit/session-manager-plugin.rpm
sudo systemctl start amazon-ssm-agent
# sudo yum erase session-manager-plugin -y
Shell
복사
Fluentbit
curl https://raw.githubusercontent.com/fluent/fluent-bit/master/install.sh | sh
sudo ln -s /opt/fluent-bit/bin/fluent-bit /usr/local/bin/fluent-bit
sudo systemctl start fluent-bit
sudo systemctl enable fluent-bit
# sudo systemctl status fluent-bit
Shell
복사
Xray Daemon
curl https://s3.us-east-2.amazonaws.com/aws-xray-assets.us-east-2/xray-daemon/aws-xray-daemon-3.x.rpm -o /home/ec2-user/xray.rpm
yum install -y /home/ec2-user/xray.rpm
Shell
복사
CloudWatch Agent
sudo yum install -y amazon-cloudwatch-agent
# amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -s -c file:/opt/aws/amazon-cloudwatch-agent/bin/config.json
Shell
복사
Apache
#!/bin/bash
yum install -y httpd
service httpd start
echo $(hostname -I) > /var/www/html/ip.html
date=$(TZ=Asia/Seoul date +"%Y-%m-%d:%H:%M")
echo $date > /var/www/html/date.html
echo "WEB Page" > /var/www/html/index.html
Shell
복사
Nginx
#!/bin/bash
sudo dnf install -y nginx
sudo systemctl start nginx
sudo systemctl enable nginx
# echo "WEB Page" > /usr/share/nginx/html/index.html
Shell
복사
PHP
sudo dnf install php httpd -y
# sudo vim /var/www/html/index.php
Shell
복사
Rsyslog
sudo dnf install rsyslog -y
sudo systemctl enable rsyslog --now
sudo cat /var/log/secure
Shell
복사
Terraform
yum install -y yum-utils
yum-config-manager --add-repo https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo
yum install -y terraform
Shell
복사
Github CLI
type -p yum-config-manager >/dev/null || sudo yum install yum-utils
sudo yum-config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo -y
sudo yum install -y gh
Shell
복사
# gh login with token
echo "$GITHUB_TOKEN" | gh auth login --with-token
gh auth setup-git
Shell
복사
Code Deploy Agent
yum update -y
yum install -y ruby
Shell
복사
AWS_DEFAULT_REGION="ap-northeast-2"
cd /home/ec2-user
wget https://aws-codedeploy-$AWS_DEFAULT_REGION.s3.$AWS_DEFAULT_REGION.amazonaws.com/latest/install
chmod +x ./install
./install auto
systemctl status codedeploy-agent.service
Shell
복사
