Skip to content

Commit

Permalink
Merge pull request #6 from Sanim16/feat-new
Browse files Browse the repository at this point in the history
Feat new
  • Loading branch information
Sanim16 authored Nov 13, 2024
2 parents 59a3eb1 + 643763d commit 62d1c5a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ jobs:
REPOSITORY: node-ecr-repo
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG .
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
docker build -t $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG -t $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:latest .
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY --all-tags
working-directory: ./nodeapp

infra-test:
Expand Down Expand Up @@ -111,12 +111,22 @@ jobs:
with:
python-version: '3.12.7'

# uncomment this block to deploy the infra
- name: venv
id: venv
run: |-
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt
cdk destroy --require-approval never
cdk deploy --require-approval never
# # uncomment this block to tear down infra
# - name: destroy-venv
# id: destroy-venv
# run: |-
# python3 -m venv .venv
# source .venv/bin/activate
# python -m pip install -r requirements.txt
# cdk destroy --force

- run: echo "🍏 This job's status is ${{ job.status }}."
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The project defines an Amazon EKS cluster with the following configuration:
* Fargate Profile - Fargate worker nodes managed by EKS.
* KubectlHandler - Lambda function for invoking kubectl commands on the cluster - created by CDK.
* AWS Load Balancer Controller to help manage Elastic Load Balancers for the Kubernetes cluster.
* A Kubernetes deployment with 3 replicas running pods with a container based on the image created from the `./maxapp/` folder.
* A Kubernetes deployment with 3 replicas running pods with a container based on the image created from the `./nodeapp/` folder.
* A Kubernetes service to expose the app
* A Kubernetes Ingress resource

Expand Down Expand Up @@ -43,7 +43,7 @@ At this point you can now synthesize the CloudFormation template for this code.
$ cdk synth
```

You can now begin exploring the source code, contained in the `./maxapp/` directory.
You can now begin exploring the source code, contained in the `./nodeapp/` directory.
There is also a very trivial test included that can be run like this:

```
Expand Down
8 changes: 4 additions & 4 deletions cdk_new_app/cdk_new_app_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
}],
"containers": [{
"name": "max-app",
"image": "paulbouwer/hello-kubernetes:1.5",
"ports": [{"containerPort": 8080}]
"image": "public.ecr.aws/j0l0w3g7/node-ecr-repo:latest",
"ports": [{"containerPort": 3000}]
}
]
}
Expand All @@ -100,7 +100,7 @@ def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
"namespace": "maxapp"},
"spec": {
"type": "NodePort",
"ports": [{"port": 8080, "targetPort": 8080}],
"ports": [{"port": 80, "targetPort": 3000}],
"selector": app_label
}
}
Expand All @@ -117,7 +117,7 @@ def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
},
"spec": {
"ingressClassName": "alb",
"rules": [{"http": {"paths": [{"path": "/", "pathType": "Prefix", "backend": {"service": {"name": "hello-kubernetes", "port": {"number": 8080}}}}]}}]
"rules": [{"http": {"paths": [{"path": "/", "pathType": "Prefix", "backend": {"service": {"name": "hello-kubernetes", "port": {"number": 80}}}}]}}]
}
}

Expand Down
1 change: 0 additions & 1 deletion requirements-dev.txt

This file was deleted.

0 comments on commit 62d1c5a

Please sign in to comment.