https://github.com/gavinray97/garden-eks-deploy-action
Github Action for deploying Garden projects to AWS EKS
https://github.com/gavinray97/garden-eks-deploy-action
Last synced: 3 months ago
JSON representation
Github Action for deploying Garden projects to AWS EKS
- Host: GitHub
- URL: https://github.com/gavinray97/garden-eks-deploy-action
- Owner: GavinRay97
- Created: 2020-05-10T18:21:35.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-10T18:54:49.000Z (about 5 years ago)
- Last Synced: 2025-02-16T10:56:53.410Z (3 months ago)
- Language: Shell
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Garden EKS Deploy Action
This Action:
- Downloads `kubectl`
- Uses the `garden-aws` container image to provide `garden` and `aws` CLI binaries
- Configures access to AWS through your access key and secret key
- Generates a `KUBECONFIG` for the desired cluster, and exports it to `PATH`After doing this, you have the ability to interact with your cluster through `kubectl`, the AWS CLI, and `garden` like you would locally. You need to implement the final steps of navigating to the directory of your project containing the root `garden.yml` and run `garden deploy --env=your-aws-remote-name`
The required environment variables are:
- `AWS_REGION`
- `EKS_CLUSTER_NAME`
- `KUBECONFIG_CLUSTER_NAME` (see description below in example usage)And the required secrets are:
- `AWS_ACCESS_KEY_ID`
- `AWS_SECRET_ACCESS_KEY````yaml
name: Deployon:
push:
branches:
- develop
- 'release/**'env:
AWS_REGION: us-east-2
EKS_CLUSTER_NAME: my-eks-cluster
# The value for "context" variable in project-level "garden.yml" for AWS
# This could be identical to EKS_CLUSTER_NAME, or different if your local KUBECONFIG has an alias,
# such as when creating clusters with eksctl
#
# Example:
# - name: kubernetes
# environments: [aws]
# context: my-eks-cluster
#
# This is due to this line:
# aws eks update-kubeconfig --region ${aws_region} --name ${cluster_name} --alias ${kubeconfig_cluster_name}
# As EKS clusters come with default names like "arn:aws:eks:us-east-2:123098607654:cluster/my-cluster"
# So you may have either aliased it in KUBECONFIG and your "garden.yml", or created with eksctl which gives different names
KUBECONFIG_CLUSTER_NAME: my-eks-clusterjobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Deploy
uses: GavinRay97/[email protected]
env:
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_region: $AWS_REGION
cluster_name: $EKS_CLUSTER_NAME
kubeconfig_cluster_name: $KUBECONFIG_CLUSTER_NAME
with:
# CD to the location of your project-level "garden.yml", if it's not in root
# Export KUBECONFIG
# Run the deploy
args: |
cd app
export KUBECONFIG=/github/home/.kube/config
garden deploy --env=aws
```