-
Notifications
You must be signed in to change notification settings - Fork 4
57 lines (51 loc) · 2.04 KB
/
deploy-aws-eks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# This workflow deploys StockTrder CR to OCP cluster in IBM Cloud
#
### Before you begin:
# - Have access to AWS
# - Your EKS Cluster must be provisioned
# - Your target namespace must be created
# - Have a secret in the above namespace titled `stock-trader-credentials`, which contains the realized contents of:
# https://github.com/IBMStockTrader/stocktrader-operator/blob/master/helm-charts/stocktrader/templates/credentials.yaml
# - Have the StockTrader operator installed
# - Have all the required services already deployed.
# - Secret Access Key and ID set up in IAM and set up as repo secret (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY)
# - This user, where you generated the Secret Access Key and ID needs the eks:ListCluster and eks:DescribeCluster rights. (set this up in AWS IAM)
# - This user needs to be added to your cluster auth config map:
# `kubectl edit -n kube-system configmap/aws-auth`
# ......
# username: system:node:{{EC2PrivateDNSName}}
# mapUsers: |
# - userarn: arn:aws:iam::<account>:user/<user>
# username: <user>
# groups:
# - system:masters
# - Secrets AWS_CLUSTER_NAMESPACE, AWS_REGION, and AWS_CLUSTER_NAME also set up in the repo.
name: Deploy to EKS
on:
push:
branches:
- main
paths-ignore:
- '.github/**'
# Environment variables available to all jobs and steps in this workflow
env:
CLUSTER_NAMESPACE: ${{ secrets.AWS_CLUSTER_NAMESPACE }}
jobs:
deploy-to-eks:
name: Deploy to AWS EKS Cluster
runs-on: ubuntu-latest
steps:
# Checkout repo
- name: Checkout
uses: actions/checkout@v2
# Deploy CR to namespace
- name: Deploy to EKS
uses: cancue/[email protected]
env:
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_region: ${{ secrets.AWS_REGION }}
cluster_name: ${{ secrets.AWS_CLUSTER_NAME }}
with:
args: |
kubectl apply -f application/stocktrader-aws-eks-cr.yml -n ${CLUSTER_NAMESPACE}