Skip to content

Commit

Permalink
frontend: Add tzdata to requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
lucabrunox committed Sep 24, 2024
1 parent fca1360 commit e296b82
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,18 @@ The GH also contains a job to push to ECR, which is not tested locally.
Needless to say it's more complicated without using EKS, but let's try.

Learnings:
- Using cron job to get AWS creds from the node, login to ECR, and store the secret for pulling images.
- 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.

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

```bash
kubectl apply -f k8s/ecr-credentials.yaml
kubectl apply -f frontend/k8s/manifest.yaml

```
curl $(kubectl get svc frontend -o=jsonpath='{.spec.clusterIP}'):8000
```
26 changes: 20 additions & 6 deletions frontend/k8s/manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,38 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend-deployment
name: frontend
labels:
app: frontend
app.kubernetes.io/name: frontend
spec:
replicas: 3
selector:
matchLabels:
app: frontend
app.kubernetes.io/name: frontend
template:
metadata:
labels:
app: frontend
app.kubernetes.io/name: frontend
spec:
imagePullSecrets:
- name: ecrsecret
containers:
- name: frontend
image: 658456307177.dkr.ecr.eu-west-1.amazonaws.com/learning-frontend:v407ed7d51b85e829d0ce6c33e2af8ffff082b548
image: 658456307177.dkr.ecr.eu-west-1.amazonaws.com/learning-frontend:vfca136021ea7fd89ad2bd60e47fe275d694eafaa
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8000
- containerPort: 8000
---
apiVersion: v1
kind: Service
metadata:
name: frontend
labels:
app.kubernetes.io/name: frontend
spec:
selector:
app.kubernetes.io/name: frontend
ports:
- protocol: TCP
port: 8000
targetPort: 8000
1 change: 1 addition & 0 deletions frontend/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Django==4.2.16
tzdata

0 comments on commit e296b82

Please sign in to comment.