Skip to content

Commit

Permalink
Generated the kubeconfig_data dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
marcuss committed Oct 13, 2024
1 parent f195d7c commit 8370d6e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
aws-region: ${{ secrets.AWS_REGION }}
mask-aws-account-id: true

- name: Set up Docker Build|
- name: Set up Docker Build
uses: docker/setup-buildx-action@v3

- name: Log in to Amazon ECR
Expand Down Expand Up @@ -70,9 +70,17 @@ jobs:
aws-region: ${{ secrets.AWS_REGION }}
mask-aws-account-id: true

- name: Generate kubeconfig for EKS
env:
CLUSTER_NAME: my-eks-cluster # Replace with your EKS cluster name
AWS_REGION: ${{ secrets.AWS_REGION }}
run: |
aws eks update-kubeconfig --name $CLUSTER_NAME --region $AWS_REGION --kubeconfig ./kubeconfig
base64 ./kubeconfig > kubeconfig_base64.txt
- name: Decode and set kubeconfig
run: |
echo "${{ secrets.KUBE_CONFIG_DATA }}" | base64 --decode > $HOME/.kube/config
cat kubeconfig_base64.txt | base64 --decode > $HOME/.kube/config
shell: bash

- name: Install kubectl
Expand All @@ -93,7 +101,7 @@ jobs:
export AWS_ACCOUNT_ID=${{ secrets.AWS_ACCOUNT_ID }}
export AWS_REGION=${{ secrets.AWS_REGION }}
export ECR_REPOSITORY=${{ secrets.ECR_REPOSITORY }}
export IMAGE_TAG=${{ github.event.inputs.image }}
export IMAGE_TAG=${{ github.sha }}
envsubst < k8s/deployment.yaml | tee k8s/deployment-resolved.yaml
- name: Deploy Deployment
Expand Down
Binary file added infrastructure/graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8370d6e

Please sign in to comment.