Skip to content

Commit

Permalink
new
Browse files Browse the repository at this point in the history
  • Loading branch information
Oloruntobi Olurombi committed Aug 27, 2024
1 parent ef9e653 commit 705ee9d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/eks-setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on: push
jobs:
LogInToAWS:
runs-on: ubuntu-latest

steps:
- name: Set AWS Environment Variables
run: |
Expand Down Expand Up @@ -61,7 +60,6 @@ jobs:
- name: Get EC2 Public IP
id: get_public_ip
run: echo "EC2_PUBLIC_IP=$(terraform output -raw ec2_public_ip)" >> $GITHUB_ENV


InstallTools:
runs-on: ubuntu-latest
Expand All @@ -84,8 +82,13 @@ jobs:
- name: Wait for EC2 Instance to be Ready
run: sleep 100

- name: Print Environment Variables
run: |
echo "EC2_PUBLIC_IP=${{ env.EC2_PUBLIC_IP }}"
- name: SSH and Install AWS CLI and kubectl
run: |
set -x
ssh -o StrictHostKeyChecking=no -i /tmp/private_key ec2-user@${{ env.EC2_PUBLIC_IP }} << 'EOF'
sudo yum install -y unzip
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
Expand All @@ -97,4 +100,4 @@ jobs:
mkdir -p $HOME/bin && cp ./kubectl $HOME/bin/kubectl && export PATH=$HOME/bin:$PATH
kubectl version --client
aws eks update-kubeconfig --region ${{ env.AWS_REGION }} --name ${{ env.EKS_CLUSTER_NAME }}
EOF
EOF

0 comments on commit 705ee9d

Please sign in to comment.