From 0e1e7e973ca749839711b65f73835555ec6221bb Mon Sep 17 00:00:00 2001 From: Luca Bruno Date: Wed, 2 Oct 2024 23:34:31 +0100 Subject: [PATCH] Minor fixes for day 6 --- README.md | 6 +++++- frontend/k8s/manifest.yaml | 41 -------------------------------------- tf/user_data/init.sh | 5 ----- 3 files changed, 5 insertions(+), 47 deletions(-) delete mode 100644 frontend/k8s/manifest.yaml diff --git a/README.md b/README.md index 74ea4ca..aab9214 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,10 @@ curl http://$(terraform output --raw experiments_nlb_dns_name) ### Day 6: Helm for the app +Commit: https://github.com/lucabrunox/experiments/tree/0427c9b777aaab + +Planning to create multiple instances of the same app, so packaging it with helm. + Some notes: - Created the helm with the default helm create scaffolding. - Added container hostname to ALLOWED_HOSTS for the health checks. @@ -138,5 +142,5 @@ Some notes: kubectl apply -f k8s/ecr-credentials.yaml helm install --set-string image=ACCOUNT_ID.dkr.ecr.eu-west-1.amazonaws.com/experiments-frontend:vTAG frontend ./frontend/k8s/chart -curl localhost:3000 +curl http://$(terraform output --raw experiments_nlb_dns_name) ``` \ No newline at end of file diff --git a/frontend/k8s/manifest.yaml b/frontend/k8s/manifest.yaml deleted file mode 100644 index 5c8db39..0000000 --- a/frontend/k8s/manifest.yaml +++ /dev/null @@ -1,41 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: frontend - labels: - app.kubernetes.io/name: frontend -spec: - replicas: 3 - selector: - matchLabels: - app.kubernetes.io/name: frontend - template: - metadata: - labels: - app.kubernetes.io/name: frontend - spec: - imagePullSecrets: - - name: ecrsecret - containers: - - name: frontend - tty: true - image: MY_ACCOUNT.dkr.ecr.eu-west-1.amazonaws.com/experiments-frontend:v29446ea079d6df7875c08c6641523f8e029caf37 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 8000 ---- -apiVersion: v1 -kind: Service -metadata: - name: frontend - labels: - app.kubernetes.io/name: frontend -spec: - type: NodePort - selector: - app.kubernetes.io/name: frontend - ports: - - protocol: TCP - port: 8000 - targetPort: 8000 - nodePort: 30000 \ No newline at end of file diff --git a/tf/user_data/init.sh b/tf/user_data/init.sh index e1bfc5b..029b12d 100644 --- a/tf/user_data/init.sh +++ b/tf/user_data/init.sh @@ -10,10 +10,6 @@ function update_system() { yum update -y } -function configure_etc_environment() { - echo 'PATH="$PATH:/usr/local/bin"' >> /etc/environment -} - function install_containerd() { yum install containerd -y systemctl enable containerd @@ -64,7 +60,6 @@ function install_flannel() { } update_system -configure_etc_environment install_containerd configure_netfilter install_kube_tools