Skip to content

Commit

Permalink
Day 4 done, frontend app is deployed in K8s
Browse files Browse the repository at this point in the history
  • Loading branch information
lucabrunox committed Sep 24, 2024
1 parent e296b82 commit f09e0ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,19 @@ Which in turn creates the frontend Docker, yay!

The GH also contains a job to push to ECR, which is not tested locally.

### Day 4: Deploy the Django app in K8s
### Day 4: Deploy the Django app in K8s using the ECR image

Needless to say it's more complicated without using EKS, but let's try.
Commit: https://github.com/lucabrunox/learning/tree/e296b828cb5

Needless to say that without EKS it's more complicated, but worth the learnings.

Learnings:
- Using CronJob to get AWS creds from the node, login to ECR, and store the secret for pulling images.
- CronJob doesn't start immediately, need to wait a minute.
- Need to untaint control plane node in other to schedule pods.
- Need to build the frontend image for ARM, obviously.
- Python app fails because it can't find the UTC timezone.
- Cannot change deployment matching labels.
- Python app fails because it can't find the UTC timezone, needs tzdata.
- Cannot change the matching labels of a K8s deployment.

At the end we're able to execute the following kubectl on the EC2 instance to deploy the app and watch it working:

Expand Down
2 changes: 1 addition & 1 deletion frontend/k8s/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
- name: ecrsecret
containers:
- name: frontend
image: 658456307177.dkr.ecr.eu-west-1.amazonaws.com/learning-frontend:vfca136021ea7fd89ad2bd60e47fe275d694eafaa
image: 658456307177.dkr.ecr.eu-west-1.amazonaws.com/learning-frontend:ve296b828cb5109a608881efa9fe5bf208d682bbc
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8000
Expand Down

0 comments on commit f09e0ef

Please sign in to comment.