-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from morka17/ft/eks
update readme
- Loading branch information
Showing
13 changed files
with
467 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,55 @@ | ||
# # This workflow will build a golang project | ||
# # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | ||
|
||
# name: Deploy to production | ||
# name: Deploy to production | ||
|
||
# on: | ||
# push: | ||
# branches: [ "main" ] | ||
|
||
# branches: [ release ] | ||
|
||
# jobs: | ||
|
||
# build: | ||
# deploy: | ||
# name: Build image | ||
# runs-on: ubuntu-latest | ||
|
||
# steps: | ||
# - name: Check out code | ||
# uses: actions/checkout@v3 | ||
|
||
# - name: Configure AWS credentials | ||
# uses: aws-actions/configure-aws-credentials@v2 | ||
# - name: Check out code | ||
# uses: actions/checkout@v2 | ||
|
||
# - name: Install kubectl | ||
# uses: azure/setup-kubectl@v1 | ||
# with: | ||
# version: 'v1.21.3' | ||
# id: install | ||
|
||
# - name: Configure AWS credentials | ||
# uses: aws-actions/configure-aws-credentials@v1 | ||
# with: | ||
# aws-access-key-id: ${{secrets.AWS_ACCESS_KEY_ID}} | ||
# aws-secret-access-key: ${{secrets.AWS_SECRET_ACCESS_KEY}} | ||
# aws-region: us-east-1 | ||
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
# aws-region: eu-west-1 | ||
|
||
# - name: Login to Amazon ECR Private | ||
# - name: Login to Amazon ECR | ||
# id: login-ecr | ||
# uses: aws-actions/amazon-ecr-login@v1 | ||
|
||
# - name: Load secrets and save to app.env | ||
# run: aws secretsmanager get-secret-value --secret-id shiny-bank --query SecretString --output text | jq -r 'to_entries|map("\(.key)=\(.value)")|.[]' > app.env | ||
|
||
# run: aws secretsmanager get-secret-value --secret-id shiny_bank --query SecretString --output text | jq -r 'to_entries|map("\(.key)=\(.value)")|.[]' > app.env | ||
|
||
# - name: Build, tag, and push docker image to Amazon ECR | ||
# - name: Build, tag, and push image to Amazon ECR | ||
# env: | ||
# REGISTRY: ${{ steps.login-ecr.outputs.registry }} | ||
# REPOSITORY: shinybank | ||
# ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | ||
# ECR_REPOSITORY: shinybank | ||
# IMAGE_TAG: ${{ github.sha }} | ||
# run: | | ||
# docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG . | ||
# docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG | ||
# docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:latest . | ||
# docker push -a $ECR_REGISTRY/$ECR_REPOSITORY | ||
|
||
# - name: Update kube config | ||
# run: aws eks update-kubeconfig --name shiny-bank --region eu-west-2 | ||
|
||
# - name: Deploy image to Amazon EKS | ||
# run: | | ||
# kubectl apply -f eks/aws-auth.yaml | ||
# kubectl apply -f eks/deployment.yaml | ||
# kubectl apply -f eks/service.yaml | ||
# kubectl apply -f eks/issuer.yaml | ||
# kubectl apply -f eks/ingress.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: aws-auth | ||
namespace: kube-system | ||
data: | ||
mapUsers: | | ||
- userarn: arn | ||
username: github-ci | ||
groups: | ||
- system:masters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: shiny-bank-api-deployment | ||
labels: | ||
app: shiny-bank-api | ||
spec: | ||
replicas: 2 | ||
selector: | ||
matchLabels: | ||
app: shiny-bank-api | ||
template: | ||
metadata: | ||
labels: | ||
app: shiny-bank-api | ||
spec: | ||
containers: | ||
- name: shiny-bank-api | ||
image: <Image> | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: IngressClass | ||
metadata: | ||
name: nginx | ||
spec: | ||
controller: k8s.io/ingress-nginx | ||
--- | ||
|
||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: shiny-bank-ingress | ||
annotations: | ||
cert-manager.io/cluster-issuer: letsencrypt | ||
spec: | ||
ingressClassName: nginx | ||
rules: | ||
- host: "api.shiny-bank.org" | ||
http: | ||
paths: | ||
- pathType: Prefix | ||
path: "/" | ||
backend: | ||
service: | ||
name: shiny-bank-api-service | ||
port: | ||
number: 80 | ||
|
||
tls: | ||
- hosts: | ||
- api.shiny-bank.org | ||
secretName: shiny-bank-api-cert | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: cert-manager.io/v1 | ||
kind: ClusterIssuer | ||
metadata: | ||
name: letsencrypt | ||
spec: | ||
acme: | ||
email: techschool.guru@gmail.com | ||
server: https://acme-v02.api.letsencrypt.org/directory | ||
privateKeySecretRef: | ||
# Secret resource that will be used to store the account's private key. | ||
name: letsencrypt-account-private-key | ||
# Add a single challenge solver, HTTP01 using nginx | ||
solvers: | ||
- http01: | ||
ingress: | ||
class: nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: shiny-bank-api-service | ||
spec: | ||
selector: | ||
app: shiny-bank-api | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
targetPort: 8080 | ||
type: ClusterIP | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.