From 04b36bf2c65dc4d51bc1c2f2796d89ddc1516845 Mon Sep 17 00:00:00 2001 From: = <=> Date: Sun, 24 Nov 2024 16:07:14 +0100 Subject: [PATCH 01/45] added docker file --- .env | 2 +- Dockerfile | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/.env b/.env index 99e4db5..2f16c2d 100644 --- a/.env +++ b/.env @@ -1,6 +1,6 @@ ENVIRONMENT=DEV HOST=localhost PORT=8000 -REDIS_HOST=localhost +REDIS_HOST=redis-container REDIS_PORT=6379 REDIS_DB=0 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..496ddc5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,38 @@ + +# Taking python as base image +FROM python:3.9-slim + +# Set the working directory in the container +WORKDIR /app + +# create a user appuser and make it default +RUN groupadd -r appuser && useradd -r -m -g appuser appuser +USER appuser + +# Copy the requirements.txt and install dependencies +COPY requirements.txt . + +# Upgrading the pip and setting the path + +RUN pip install --upgrade pip +ENV PATH="/home/appuser/.local/bin:$PATH" + +# Installing the required library for project +RUN pip install --no-cache-dir -r requirements.txt + +# Copy the full application code in docker image +COPY . . + +# Set environment variables from the .env file +ENV ENVIRONMENT=${ENVIRONMENT} +ENV HOST=${HOST} +ENV PORT=${PORT} +ENV REDIS_HOST=${REDIS_HOST} +ENV REDIS_PORT=${REDIS_PORT} +ENV REDIS_DB=${REDIS_DB} + +# Expose the port the app runs on. +EXPOSE ${PORT} + +# Run the application +CMD ["python", "hello.py"] \ No newline at end of file From 2e2bf610b5f22494e681338176eac5ef663a3f1a Mon Sep 17 00:00:00 2001 From: = <=> Date: Sun, 24 Nov 2024 16:45:35 +0100 Subject: [PATCH 02/45] k8s --- k8s-manifests/app-service.yml | 14 +++++++++++ k8s-manifests/application-deployment.yml | 32 ++++++++++++++++++++++++ k8s-manifests/configmapfile.yml | 11 ++++++++ k8s-manifests/hpafile.yml | 19 ++++++++++++++ k8s-manifests/redis-deployment.yml | 21 ++++++++++++++++ k8s-manifests/redis-service.yml | 11 ++++++++ k8s-manifests/secrets.yml | 8 ++++++ 7 files changed, 116 insertions(+) create mode 100644 k8s-manifests/app-service.yml create mode 100644 k8s-manifests/application-deployment.yml create mode 100644 k8s-manifests/configmapfile.yml create mode 100644 k8s-manifests/hpafile.yml create mode 100644 k8s-manifests/redis-deployment.yml create mode 100644 k8s-manifests/redis-service.yml create mode 100644 k8s-manifests/secrets.yml diff --git a/k8s-manifests/app-service.yml b/k8s-manifests/app-service.yml new file mode 100644 index 0000000..92f7120 --- /dev/null +++ b/k8s-manifests/app-service.yml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: demo-service +spec: + selector: + app: demo-app + ports: + - protocol: TCP + port: 80 # Expose on port 80 within the cluster + targetPort: 8000 # Container port to which the traffic will be forwarded + nodePort: 30080 # External port on each node to access the application + type: NodePort + \ No newline at end of file diff --git a/k8s-manifests/application-deployment.yml b/k8s-manifests/application-deployment.yml new file mode 100644 index 0000000..0b06807 --- /dev/null +++ b/k8s-manifests/application-deployment.yml @@ -0,0 +1,32 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: demo-deployment +spec: + replicas: 3 # Ensure 3 replicas for high availability + selector: + matchLabels: + app: demo-app + template: + metadata: + labels: + app: demo-app + spec: + containers: + - name: demo-container + image: ersanjeev/app1:latest # Replace with Docker image + ports: + - containerPort: 8000 # application will run on port 8000 inside container + envFrom: + - configMapRef: + name: application-env-variable # Reference the ConfigMap for non-sensitive envs + resources: + requests: + memory: "100Mi" + cpu: "100m" + limits: + memory: "200Mi" + cpu: "200m" # You can tweak these based on your app's requirements + imagePullSecrets: + - name: regcred + diff --git a/k8s-manifests/configmapfile.yml b/k8s-manifests/configmapfile.yml new file mode 100644 index 0000000..ec5bb42 --- /dev/null +++ b/k8s-manifests/configmapfile.yml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: application-env-variable +data: + ENVIRONMENT: "DEV" + HOST: "localhost" + PORT: "8000" + REDIS_HOST: redis-service + REDIS_PORT: "6379" + REDIS_DB: "0" \ No newline at end of file diff --git a/k8s-manifests/hpafile.yml b/k8s-manifests/hpafile.yml new file mode 100644 index 0000000..8f23d93 --- /dev/null +++ b/k8s-manifests/hpafile.yml @@ -0,0 +1,19 @@ +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: demo-app-hpa + namespace: default +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: demo-deployment + minReplicas: 3 # Minimum replicas for availability + maxReplicas: 10 # Maximum replicas for scaling up based on load + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 50 # Target 50% CPU utilization diff --git a/k8s-manifests/redis-deployment.yml b/k8s-manifests/redis-deployment.yml new file mode 100644 index 0000000..3f4709f --- /dev/null +++ b/k8s-manifests/redis-deployment.yml @@ -0,0 +1,21 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: redis-deployment +spec: + replicas: 1 + selector: + matchLabels: + app: redis + template: + metadata: + labels: + app: redis + spec: + containers: + - name: redis + image: redis:latest + ports: + - containerPort: 6379 + + diff --git a/k8s-manifests/redis-service.yml b/k8s-manifests/redis-service.yml new file mode 100644 index 0000000..5427392 --- /dev/null +++ b/k8s-manifests/redis-service.yml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: redis-service +spec: + selector: + app: redis + ports: + - protocol: TCP + port: 6379 + targetPort: 6379 \ No newline at end of file diff --git a/k8s-manifests/secrets.yml b/k8s-manifests/secrets.yml new file mode 100644 index 0000000..2bf55b9 --- /dev/null +++ b/k8s-manifests/secrets.yml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: Secret +metadata: + name: regcred # Name of the secret + namespace: default # Namespace (you can change this if needed) +type: kubernetes.io/dockerconfigjson # Type for Docker registry secret +data: + .dockerconfigjson: ewoJImF1dGhzIjogewoJCSJodHRwczovL2luZGV4LmRvY2tlci5pby92MS8iOiB7CgkJCSJhdXRoIjogIlpYSnpZVzVxWldWMk9rRmhhR0Z1WVdGb1lXNGlOREV4IgoJCX0KCX0KfQ== # Replace with your base64 string From 829db982adc91ac8a1b79f373904d371b1ebd6a0 Mon Sep 17 00:00:00 2001 From: = <=> Date: Sun, 24 Nov 2024 17:01:05 +0100 Subject: [PATCH 03/45] no chnage --- k8s-manifests/redis-deployment.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/k8s-manifests/redis-deployment.yml b/k8s-manifests/redis-deployment.yml index 3f4709f..f5a9121 100644 --- a/k8s-manifests/redis-deployment.yml +++ b/k8s-manifests/redis-deployment.yml @@ -17,5 +17,3 @@ spec: image: redis:latest ports: - containerPort: 6379 - - From 5dfe8d290a6ff9d9ebb8f64d3ef9f357d777be8d Mon Sep 17 00:00:00 2001 From: = <=> Date: Sun, 24 Nov 2024 17:53:03 +0100 Subject: [PATCH 04/45] change image --- k8s-manifests/application-deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s-manifests/application-deployment.yml b/k8s-manifests/application-deployment.yml index 0b06807..86e00de 100644 --- a/k8s-manifests/application-deployment.yml +++ b/k8s-manifests/application-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: demo-container - image: ersanjeev/app1:latest # Replace with Docker image + image: ersanjeev/app2:latest # Replace with Docker image ports: - containerPort: 8000 # application will run on port 8000 inside container envFrom: From ce80eea49304445916f4b016a93d24dd69ae5205 Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 25 Nov 2024 17:42:35 +0100 Subject: [PATCH 05/45] githubaction workflows --- .github/build-and-publish.yml | 57 +++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/build-and-publish.yml diff --git a/.github/build-and-publish.yml b/.github/build-and-publish.yml new file mode 100644 index 0000000..be5677f --- /dev/null +++ b/.github/build-and-publish.yml @@ -0,0 +1,57 @@ +name: Build and Publish to Docker Hub + +on: + push: + branches: + - master + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + # Set to "latest" for master branch, or branch name for other branches + IMAGE_TAG: ${{ github.ref_name == 'master' && 'latest' || github.ref_name }} + DOCKER_REPO: ersanjeev/Devops-challanges # Replace with your Docker Hub repository + +jobs: + build-and-publish: + name: Build and Publish to Docker Hub + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Infer Tag from Branch + id: infer-tag + # Get the branch name from the ref, and replace / with - to make it a valid tag + env: + BRANCH_NAME: ${{ github.ref_name }} + run: | + if [[ $BRANCH_NAME == "master" ]]; then + echo "tag=latest" >> $GITHUB_OUTPUT + else + echo "tag=$(echo $BRANCH_NAME | sed -e 's/\//-/g')" >> $GITHUB_OUTPUT + fi + + - name: Build and Push Docker Image + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile # Update path if Dockerfile is not in ./docker/ + pull: true + push: true + tags: | + ${{ env.DOCKER_REPO }}:${{ steps.infer-tag.outputs.tag }}, + ${{ env.DOCKER_REPO }}:${{ github.sha }} \ No newline at end of file From f26666a7c5668c8570548cd3095d418ecd5092cc Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 25 Nov 2024 17:48:16 +0100 Subject: [PATCH 06/45] delete file --- .github/build-and-publish.yml | 57 ----------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 .github/build-and-publish.yml diff --git a/.github/build-and-publish.yml b/.github/build-and-publish.yml deleted file mode 100644 index be5677f..0000000 --- a/.github/build-and-publish.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Build and Publish to Docker Hub - -on: - push: - branches: - - master - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - # Set to "latest" for master branch, or branch name for other branches - IMAGE_TAG: ${{ github.ref_name == 'master' && 'latest' || github.ref_name }} - DOCKER_REPO: ersanjeev/Devops-challanges # Replace with your Docker Hub repository - -jobs: - build-and-publish: - name: Build and Publish to Docker Hub - runs-on: ubuntu-latest - - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Infer Tag from Branch - id: infer-tag - # Get the branch name from the ref, and replace / with - to make it a valid tag - env: - BRANCH_NAME: ${{ github.ref_name }} - run: | - if [[ $BRANCH_NAME == "master" ]]; then - echo "tag=latest" >> $GITHUB_OUTPUT - else - echo "tag=$(echo $BRANCH_NAME | sed -e 's/\//-/g')" >> $GITHUB_OUTPUT - fi - - - name: Build and Push Docker Image - uses: docker/build-push-action@v5 - with: - context: . - file: ./Dockerfile # Update path if Dockerfile is not in ./docker/ - pull: true - push: true - tags: | - ${{ env.DOCKER_REPO }}:${{ steps.infer-tag.outputs.tag }}, - ${{ env.DOCKER_REPO }}:${{ github.sha }} \ No newline at end of file From ded91e7bdb49982171cb76b61e52bb2a75f32161 Mon Sep 17 00:00:00 2001 From: SANJEEV KUMAR Date: Mon, 25 Nov 2024 17:50:48 +0100 Subject: [PATCH 07/45] Create build-publish.yml --- .github/workflows/build-publish.yml | 59 +++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/build-publish.yml diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml new file mode 100644 index 0000000..5651ffa --- /dev/null +++ b/.github/workflows/build-publish.yml @@ -0,0 +1,59 @@ +name: Build and Publish to Docker Hub + +on: + push: + branches: + - master + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + # Set to "latest" for master branch, or branch name for other branches + IMAGE_TAG: ${{ github.ref_name == 'master' && 'latest' || github.ref_name }} + DOCKER_REPO: ersanjeev/Devops-challanges # Replace with your Docker Hub repository + +jobs: + build-and-publish: + name: Build and Publish to Docker Hub + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Infer Tag from Branch + id: infer-tag + # Get the branch name from the ref, and replace / with - to make it a valid tag + env: + BRANCH_NAME: ${{ github.ref_name }} + run: | + if [[ $BRANCH_NAME == "master" ]]; then + echo "tag=latest" >> $GITHUB_OUTPUT + else + echo "tag=$(echo $BRANCH_NAME | sed -e 's/\//-/g')" >> $GITHUB_OUTPUT + fi + + - name: Build and Push Docker Image + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile # Update path if Dockerfile is not in ./docker/ + pull: true + push: true + tags: | + ${{ env.DOCKER_REPO }}:${{ steps.infer-tag.outputs.tag }}, + ${{ env.DOCKER_REPO }}:${{ github.sha }} + + From b3fe09d8878725ae752274e9a92d9e0d7a4065a2 Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 25 Nov 2024 17:53:20 +0100 Subject: [PATCH 08/45] repository name must be lowercase --- .github/workflows/build-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index 5651ffa..7330ff7 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -13,7 +13,7 @@ concurrency: env: # Set to "latest" for master branch, or branch name for other branches IMAGE_TAG: ${{ github.ref_name == 'master' && 'latest' || github.ref_name }} - DOCKER_REPO: ersanjeev/Devops-challanges # Replace with your Docker Hub repository + DOCKER_REPO: ersanjeev/devops-challanges # Replace with your Docker Hub repository jobs: build-and-publish: From b4d82b3e01c3a07c25bb2a0c8f1ac03d8e69e586 Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 25 Nov 2024 18:52:26 +0100 Subject: [PATCH 09/45] argocdfile --- argocd/deploy.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 argocd/deploy.yml diff --git a/argocd/deploy.yml b/argocd/deploy.yml new file mode 100644 index 0000000..1bfdaaa --- /dev/null +++ b/argocd/deploy.yml @@ -0,0 +1,20 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: ersanjeev/devops-challanges + namespace: argocd +spec: + project: default + source: + repoURL: https://github.com/imsanjeevkumar/gitops.git + targetRevision: HEAD + path: devops-challanges + destination: + server: https://kubernetes.default.svc + namespace: devops-challanges + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true \ No newline at end of file From e75498b8f1f62eeef0977213ca202d6d4b6298a1 Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 25 Nov 2024 18:57:21 +0100 Subject: [PATCH 10/45] argocdfile --- argocd/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/argocd/deploy.yml b/argocd/deploy.yml index 1bfdaaa..7d0ef4f 100644 --- a/argocd/deploy.yml +++ b/argocd/deploy.yml @@ -6,9 +6,9 @@ metadata: spec: project: default source: - repoURL: https://github.com/imsanjeevkumar/gitops.git + repoURL: https://github.com/imsanjeevkumar/DevOps-Challenge.git targetRevision: HEAD - path: devops-challanges + path: k8s-manifests destination: server: https://kubernetes.default.svc namespace: devops-challanges From c6940530bb656cf408091e4b9127581b2ed78b07 Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 25 Nov 2024 19:04:11 +0100 Subject: [PATCH 11/45] add --- argocd/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/argocd/deploy.yml b/argocd/deploy.yml index 7d0ef4f..d334907 100644 --- a/argocd/deploy.yml +++ b/argocd/deploy.yml @@ -1,7 +1,7 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - name: ersanjeev/devops-challanges + name: ersanjeev-devops-challanges namespace: argocd spec: project: default From 83bef5b8775accde5ec0d9c0675c6c1ab8466bed Mon Sep 17 00:00:00 2001 From: = <=> Date: Tue, 26 Nov 2024 19:06:12 +0100 Subject: [PATCH 12/45] add cd steps --- .github/workflows/build-publish.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index 7330ff7..c8ab77e 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -56,4 +56,18 @@ jobs: ${{ env.DOCKER_REPO }}:${{ steps.infer-tag.outputs.tag }}, ${{ env.DOCKER_REPO }}:${{ github.sha }} + # Copy Docker image to AWS server + - name: Copy Docker image to remote server + run: | + docker save ${{ env.DOCKER_REPO }}:${{ github.sha }} | bzip2 | ssh -i ${{ secrets.SSH_KEY }} ${{ secrets.AWS_USER }}@${{ secrets.AWS_SERVER }} "bunzip2 | docker load" + + # SSH to AWS server and apply Kubernetes manifests + - name: Deploy to Minikube + run: | + ssh -i ${{ secrets.SSH_KEY }} ${{ secrets.AWS_USER }}@${{ secrets.AWS_SERVER }} << EOF + sudo -i + cd /root/DevOps-Challenge/k8s-manifests + kubectl apply -f . + EOF + From 8b334da2caece0ecbaeed8bc1ba1e34c118868a1 Mon Sep 17 00:00:00 2001 From: = <=> Date: Tue, 26 Nov 2024 19:17:26 +0100 Subject: [PATCH 13/45] change in cd file --- .github/workflows/build-publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index c8ab77e..2d3c792 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -57,9 +57,9 @@ jobs: ${{ env.DOCKER_REPO }}:${{ github.sha }} # Copy Docker image to AWS server - - name: Copy Docker image to remote server - run: | - docker save ${{ env.DOCKER_REPO }}:${{ github.sha }} | bzip2 | ssh -i ${{ secrets.SSH_KEY }} ${{ secrets.AWS_USER }}@${{ secrets.AWS_SERVER }} "bunzip2 | docker load" + # - name: Copy Docker image to remote server + # run: | + # docker save ${{ env.DOCKER_REPO }}:${{ github.sha }} | bzip2 | ssh -i ${{ secrets.SSH_KEY }} ${{ secrets.AWS_USER }}@${{ secrets.AWS_SERVER }} "bunzip2 | docker load" # SSH to AWS server and apply Kubernetes manifests - name: Deploy to Minikube From 2dd58ba102cc8746c1bb28c47cdf15015979c284 Mon Sep 17 00:00:00 2001 From: = <=> Date: Tue, 26 Nov 2024 19:32:45 +0100 Subject: [PATCH 14/45] add cd file --- .github/workflows/build-publish.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index 2d3c792..fe2876f 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -64,10 +64,8 @@ jobs: # SSH to AWS server and apply Kubernetes manifests - name: Deploy to Minikube run: | - ssh -i ${{ secrets.SSH_KEY }} ${{ secrets.AWS_USER }}@${{ secrets.AWS_SERVER }} << EOF - sudo -i - cd /root/DevOps-Challenge/k8s-manifests - kubectl apply -f . + ssh -o StrictHostKeyChecking=no -i ${{ secrets.SSH_KEY }} ${{ secrets.AWS_USER }}@${{ secrets.AWS_SERVER }} << EOF + sudo kubectl apply -f /root/DevOps-Challenge/k8s-manifests EOF From 5a6c5fb4ba54149df52e90f16b8ee59d7672f70f Mon Sep 17 00:00:00 2001 From: = <=> Date: Tue, 26 Nov 2024 19:59:53 +0100 Subject: [PATCH 15/45] add cd --- .github/workflows/build-publish.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index fe2876f..2d3c792 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -64,8 +64,10 @@ jobs: # SSH to AWS server and apply Kubernetes manifests - name: Deploy to Minikube run: | - ssh -o StrictHostKeyChecking=no -i ${{ secrets.SSH_KEY }} ${{ secrets.AWS_USER }}@${{ secrets.AWS_SERVER }} << EOF - sudo kubectl apply -f /root/DevOps-Challenge/k8s-manifests + ssh -i ${{ secrets.SSH_KEY }} ${{ secrets.AWS_USER }}@${{ secrets.AWS_SERVER }} << EOF + sudo -i + cd /root/DevOps-Challenge/k8s-manifests + kubectl apply -f . EOF From a11c843e02f45302292ea542c5a47e7c2f015cd2 Mon Sep 17 00:00:00 2001 From: = <=> Date: Wed, 27 Nov 2024 00:28:29 +0100 Subject: [PATCH 16/45] add cd file --- .github/workflows/build-publish.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index 2d3c792..0136c13 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -64,10 +64,11 @@ jobs: # SSH to AWS server and apply Kubernetes manifests - name: Deploy to Minikube run: | - ssh -i ${{ secrets.SSH_KEY }} ${{ secrets.AWS_USER }}@${{ secrets.AWS_SERVER }} << EOF - sudo -i + ssh -i /tmp/ssh_key "${{ secrets.AWS_USER }}@${{ secrets.AWS_SERVER }}" << 'EOF' + sudo bash -c " cd /root/DevOps-Challenge/k8s-manifests kubectl apply -f . + " EOF From 5ae12871efa7a4a7c24a13587f83b324bd9f0e85 Mon Sep 17 00:00:00 2001 From: = <=> Date: Wed, 27 Nov 2024 00:33:37 +0100 Subject: [PATCH 17/45] add cd --- .github/workflows/build-publish.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index 0136c13..9d745a0 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -64,11 +64,17 @@ jobs: # SSH to AWS server and apply Kubernetes manifests - name: Deploy to Minikube run: | - ssh -i /tmp/ssh_key "${{ secrets.AWS_USER }}@${{ secrets.AWS_SERVER }}" << 'EOF' - sudo bash -c " - cd /root/DevOps-Challenge/k8s-manifests - kubectl apply -f . - " - EOF + # Create the SSH key file + echo "${{ secrets.SSH_PRIVATE_KEY }}" > /tmp/ssh_key + chmod 600 /tmp/ssh_key + + # Execute the SSH command + ssh -T -i /tmp/ssh_key "${{ secrets.AWS_USER }}@${{ secrets.AWS_SERVER }}" << 'EOF' + sudo bash -c " + cd /root/DevOps-Challenge/k8s-manifests + kubectl apply -f . + " + EOF + From 173d92f83776f3f6f17e049c750434e7cfa6ee23 Mon Sep 17 00:00:00 2001 From: = <=> Date: Wed, 27 Nov 2024 00:37:27 +0100 Subject: [PATCH 18/45] add cd --- .github/workflows/build-publish.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index 9d745a0..b5ab505 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -65,16 +65,15 @@ jobs: - name: Deploy to Minikube run: | # Create the SSH key file - echo "${{ secrets.SSH_PRIVATE_KEY }}" > /tmp/ssh_key - chmod 600 /tmp/ssh_key - - # Execute the SSH command - ssh -T -i /tmp/ssh_key "${{ secrets.AWS_USER }}@${{ secrets.AWS_SERVER }}" << 'EOF' - sudo bash -c " - cd /root/DevOps-Challenge/k8s-manifests - kubectl apply -f . - " - EOF + echo "${{ secrets.SSH_PRIVATE_KEY }}" > /tmp/ssh_key + chmod 600 /tmp/ssh_key + # Execute the SSH command + ssh -T -i /tmp/ssh_key "${{ secrets.AWS_USER }}@${{ secrets.AWS_SERVER }}" << 'EOF' + sudo bash -c " + cd /root/DevOps-Challenge/k8s-manifests + kubectl apply -f . + " + EOF From b985d5eff9eb184bb8795f28a032a05a7f6ec6d2 Mon Sep 17 00:00:00 2001 From: = <=> Date: Wed, 27 Nov 2024 00:45:29 +0100 Subject: [PATCH 19/45] add cd --- .github/workflows/build-publish.yml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index b5ab505..06749f9 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -62,18 +62,24 @@ jobs: # docker save ${{ env.DOCKER_REPO }}:${{ github.sha }} | bzip2 | ssh -i ${{ secrets.SSH_KEY }} ${{ secrets.AWS_USER }}@${{ secrets.AWS_SERVER }} "bunzip2 | docker load" # SSH to AWS server and apply Kubernetes manifests - - name: Deploy to Minikube + - name: Create SSH key file run: | - # Create the SSH key file echo "${{ secrets.SSH_PRIVATE_KEY }}" > /tmp/ssh_key chmod 600 /tmp/ssh_key - # Execute the SSH command - ssh -T -i /tmp/ssh_key "${{ secrets.AWS_USER }}@${{ secrets.AWS_SERVER }}" << 'EOF' - sudo bash -c " - cd /root/DevOps-Challenge/k8s-manifests - kubectl apply -f . - " - EOF + - name: Debug Secrets + run: | + echo "AWS_SERVER=${{ secrets.AWS_SERVER }}" # Ensure this value is not empty + echo "AWS_USER=${{ secrets.AWS_USER }}" # Ensure this value is correct + + - name: Deploy to Minikube + run: | + ssh -T -i /tmp/ssh_key "${{ secrets.AWS_USER }}@${{ secrets.AWS_SERVER }}" << 'EOF' + sudo bash -c " + cd /root/DevOps-Challenge/k8s-manifests + kubectl apply -f . + " + EOF + From 7084918242ff7f23f73407f4c1de7c2a23bb913c Mon Sep 17 00:00:00 2001 From: = <=> Date: Wed, 27 Nov 2024 00:47:16 +0100 Subject: [PATCH 20/45] cd --- .github/workflows/build-publish.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index 06749f9..6337504 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -74,12 +74,12 @@ jobs: - name: Deploy to Minikube run: | - ssh -T -i /tmp/ssh_key "${{ secrets.AWS_USER }}@${{ secrets.AWS_SERVER }}" << 'EOF' - sudo bash -c " - cd /root/DevOps-Challenge/k8s-manifests - kubectl apply -f . - " - EOF + ssh -T -i /tmp/ssh_key "${{ secrets.AWS_USER }}@${{ secrets.AWS_SERVER }}" << 'EOF' + sudo bash -c " + cd /root/DevOps-Challenge/k8s-manifests + kubectl apply -f . + " + EOF From bb48c17b70f7b5f83080153d8292816df2e62fac Mon Sep 17 00:00:00 2001 From: = <=> Date: Wed, 27 Nov 2024 01:14:46 +0100 Subject: [PATCH 21/45] add cd --- .github/workflows/build-publish.yml | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index 6337504..4254763 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -62,24 +62,9 @@ jobs: # docker save ${{ env.DOCKER_REPO }}:${{ github.sha }} | bzip2 | ssh -i ${{ secrets.SSH_KEY }} ${{ secrets.AWS_USER }}@${{ secrets.AWS_SERVER }} "bunzip2 | docker load" # SSH to AWS server and apply Kubernetes manifests - - name: Create SSH key file + - name: Deploy Kubernetes manifests run: | - echo "${{ secrets.SSH_PRIVATE_KEY }}" > /tmp/ssh_key - chmod 600 /tmp/ssh_key - - - name: Debug Secrets - run: | - echo "AWS_SERVER=${{ secrets.AWS_SERVER }}" # Ensure this value is not empty - echo "AWS_USER=${{ secrets.AWS_USER }}" # Ensure this value is correct - - - name: Deploy to Minikube - run: | - ssh -T -i /tmp/ssh_key "${{ secrets.AWS_USER }}@${{ secrets.AWS_SERVER }}" << 'EOF' - sudo bash -c " - cd /root/DevOps-Challenge/k8s-manifests - kubectl apply -f . - " - EOF + kubectl apply -f ./k8s-manifests From 04262d967b49d22d990f502e0d31ec2919d0463a Mon Sep 17 00:00:00 2001 From: = <=> Date: Thu, 28 Nov 2024 18:35:59 +0100 Subject: [PATCH 22/45] cd --- .github/workflows/build-publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index 4254763..f7ee077 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -65,6 +65,7 @@ jobs: - name: Deploy Kubernetes manifests run: | kubectl apply -f ./k8s-manifests + From 987df596e906dc8573c9787350e534995deae02e Mon Sep 17 00:00:00 2001 From: = <=> Date: Thu, 28 Nov 2024 18:47:26 +0100 Subject: [PATCH 23/45] ci --- .github/workflows/build-publish.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index f7ee077..ee6915c 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -56,16 +56,7 @@ jobs: ${{ env.DOCKER_REPO }}:${{ steps.infer-tag.outputs.tag }}, ${{ env.DOCKER_REPO }}:${{ github.sha }} - # Copy Docker image to AWS server - # - name: Copy Docker image to remote server - # run: | - # docker save ${{ env.DOCKER_REPO }}:${{ github.sha }} | bzip2 | ssh -i ${{ secrets.SSH_KEY }} ${{ secrets.AWS_USER }}@${{ secrets.AWS_SERVER }} "bunzip2 | docker load" - - # SSH to AWS server and apply Kubernetes manifests - - name: Deploy Kubernetes manifests - run: | - kubectl apply -f ./k8s-manifests - + From 4b722bb6ef4878a9ed13599f0b8223ee751fde3a Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Sun, 1 Dec 2024 11:33:29 +0000 Subject: [PATCH 24/45] app --- k8s-manifests/app-service.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s-manifests/app-service.yml b/k8s-manifests/app-service.yml index 92f7120..f1c28fd 100644 --- a/k8s-manifests/app-service.yml +++ b/k8s-manifests/app-service.yml @@ -10,5 +10,5 @@ spec: port: 80 # Expose on port 80 within the cluster targetPort: 8000 # Container port to which the traffic will be forwarded nodePort: 30080 # External port on each node to access the application - type: NodePort - \ No newline at end of file + type: LoadBalancer + From 9cfb9515503cc4811c82fc76c8f4a1bc86ce2403 Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 2 Dec 2024 18:32:32 +0100 Subject: [PATCH 25/45] cd --- .github/workflows/build-publish.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index ee6915c..684df21 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -56,6 +56,13 @@ jobs: ${{ env.DOCKER_REPO }}:${{ steps.infer-tag.outputs.tag }}, ${{ env.DOCKER_REPO }}:${{ github.sha }} + - name: update kube config + run: aws eks update-kubeconfig --region eu-central-1 --name eksdemo + + - name: Deploz to EKS + run: | + kubectl apply -f ./k8-manifests/application-deployment.yml + From 707c6f9f1c56c8dd3213b5903fa1de263c07e5e6 Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 2 Dec 2024 18:38:45 +0100 Subject: [PATCH 26/45] cd --- .github/workflows/build-publish.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index 684df21..2c3ca60 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -24,6 +24,14 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 + - 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: eu-central-1 + + - name: Login to Docker Hub uses: docker/login-action@v3 with: From 8ab7b98f4e645283e1913ff2f4ee2e7880ba24d3 Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 2 Dec 2024 18:45:39 +0100 Subject: [PATCH 27/45] cd --- .github/workflows/build-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index 2c3ca60..c5b59b7 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -69,7 +69,7 @@ jobs: - name: Deploz to EKS run: | - kubectl apply -f ./k8-manifests/application-deployment.yml + kubectl apply -f ./k8s-manifests/application-deployment.yml From cc8418e9a3b54c2edbe4b5e416847b22e26445c5 Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 2 Dec 2024 18:52:50 +0100 Subject: [PATCH 28/45] re --- k8s-manifests/application-deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s-manifests/application-deployment.yml b/k8s-manifests/application-deployment.yml index 86e00de..a2e9f01 100644 --- a/k8s-manifests/application-deployment.yml +++ b/k8s-manifests/application-deployment.yml @@ -3,7 +3,7 @@ kind: Deployment metadata: name: demo-deployment spec: - replicas: 3 # Ensure 3 replicas for high availability + replicas: 1 # Ensure 3 replicas for high availability selector: matchLabels: app: demo-app From b696bebb9e2d1e9193c82edb257bd5f51e328c26 Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 2 Dec 2024 18:57:08 +0100 Subject: [PATCH 29/45] re --- k8s-manifests/hpafile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s-manifests/hpafile.yml b/k8s-manifests/hpafile.yml index 8f23d93..46fa5ea 100644 --- a/k8s-manifests/hpafile.yml +++ b/k8s-manifests/hpafile.yml @@ -8,7 +8,7 @@ spec: apiVersion: apps/v1 kind: Deployment name: demo-deployment - minReplicas: 3 # Minimum replicas for availability + minReplicas: 1 # Minimum replicas for availability maxReplicas: 10 # Maximum replicas for scaling up based on load metrics: - type: Resource From 1adccd566f03d22e7653adfe170c0acbc3b4ab86 Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 2 Dec 2024 18:59:52 +0100 Subject: [PATCH 30/45] re --- k8s-manifests/application-deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s-manifests/application-deployment.yml b/k8s-manifests/application-deployment.yml index a2e9f01..11915f2 100644 --- a/k8s-manifests/application-deployment.yml +++ b/k8s-manifests/application-deployment.yml @@ -3,7 +3,7 @@ kind: Deployment metadata: name: demo-deployment spec: - replicas: 1 # Ensure 3 replicas for high availability + replicas: 2 # Ensure 3 replicas for high availability selector: matchLabels: app: demo-app From e1b63bf8bc883e4311b62fe4be6c74169a1ec8f1 Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 2 Dec 2024 19:03:45 +0100 Subject: [PATCH 31/45] re --- k8s-manifests/application-deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s-manifests/application-deployment.yml b/k8s-manifests/application-deployment.yml index 11915f2..86e00de 100644 --- a/k8s-manifests/application-deployment.yml +++ b/k8s-manifests/application-deployment.yml @@ -3,7 +3,7 @@ kind: Deployment metadata: name: demo-deployment spec: - replicas: 2 # Ensure 3 replicas for high availability + replicas: 3 # Ensure 3 replicas for high availability selector: matchLabels: app: demo-app From 42c3bb53f4c1dc033bf08b98172ed4b3c6f899d6 Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 2 Dec 2024 22:01:34 +0100 Subject: [PATCH 32/45] new image change --- k8s-manifests/application-deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s-manifests/application-deployment.yml b/k8s-manifests/application-deployment.yml index 86e00de..508cc98 100644 --- a/k8s-manifests/application-deployment.yml +++ b/k8s-manifests/application-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: demo-container - image: ersanjeev/app2:latest # Replace with Docker image + image: ersanjeev/testapp02122024 # Replace with Docker image ports: - containerPort: 8000 # application will run on port 8000 inside container envFrom: From a73d1da13f9016c46c0d31c5859787faf5a3ed45 Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 2 Dec 2024 22:07:09 +0100 Subject: [PATCH 33/45] image change --- k8s-manifests/application-deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s-manifests/application-deployment.yml b/k8s-manifests/application-deployment.yml index 508cc98..76b0899 100644 --- a/k8s-manifests/application-deployment.yml +++ b/k8s-manifests/application-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: demo-container - image: ersanjeev/testapp02122024 # Replace with Docker image + image: ersanjeev/testapp0212202 # Replace with Docker image ports: - containerPort: 8000 # application will run on port 8000 inside container envFrom: From 04dfb14524957fae849640e39228f8600a3247f5 Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 2 Dec 2024 22:26:16 +0100 Subject: [PATCH 34/45] hpa file chnage --- k8s-manifests/hpafile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s-manifests/hpafile.yml b/k8s-manifests/hpafile.yml index 46fa5ea..8f23d93 100644 --- a/k8s-manifests/hpafile.yml +++ b/k8s-manifests/hpafile.yml @@ -8,7 +8,7 @@ spec: apiVersion: apps/v1 kind: Deployment name: demo-deployment - minReplicas: 1 # Minimum replicas for availability + minReplicas: 3 # Minimum replicas for availability maxReplicas: 10 # Maximum replicas for scaling up based on load metrics: - type: Resource From 8d627cca6da788195f914b89421f0a51fbd3049e Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 2 Dec 2024 22:38:20 +0100 Subject: [PATCH 35/45] change image --- k8s-manifests/application-deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s-manifests/application-deployment.yml b/k8s-manifests/application-deployment.yml index 76b0899..508cc98 100644 --- a/k8s-manifests/application-deployment.yml +++ b/k8s-manifests/application-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: demo-container - image: ersanjeev/testapp0212202 # Replace with Docker image + image: ersanjeev/testapp02122024 # Replace with Docker image ports: - containerPort: 8000 # application will run on port 8000 inside container envFrom: From 93e96019ea7211c8dd6d13f47c636f42e64bcc40 Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 2 Dec 2024 23:07:50 +0100 Subject: [PATCH 36/45] replica --- k8s-manifests/application-deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s-manifests/application-deployment.yml b/k8s-manifests/application-deployment.yml index 508cc98..6a33e2a 100644 --- a/k8s-manifests/application-deployment.yml +++ b/k8s-manifests/application-deployment.yml @@ -3,7 +3,7 @@ kind: Deployment metadata: name: demo-deployment spec: - replicas: 3 # Ensure 3 replicas for high availability + replicas: 4 # Ensure 3 replicas for high availability selector: matchLabels: app: demo-app From a52344fcb8d51b69642c823a125df8d64079b13e Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 2 Dec 2024 23:09:52 +0100 Subject: [PATCH 37/45] re --- k8s-manifests/application-deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s-manifests/application-deployment.yml b/k8s-manifests/application-deployment.yml index 6a33e2a..58907ab 100644 --- a/k8s-manifests/application-deployment.yml +++ b/k8s-manifests/application-deployment.yml @@ -3,7 +3,7 @@ kind: Deployment metadata: name: demo-deployment spec: - replicas: 4 # Ensure 3 replicas for high availability + replicas: 2 # Ensure 3 replicas for high availability selector: matchLabels: app: demo-app From 9932fa27583bf0b67382bd173186dd5d5ebe6457 Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 2 Dec 2024 23:12:47 +0100 Subject: [PATCH 38/45] hpa --- k8s-manifests/hpafile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s-manifests/hpafile.yml b/k8s-manifests/hpafile.yml index 8f23d93..803a691 100644 --- a/k8s-manifests/hpafile.yml +++ b/k8s-manifests/hpafile.yml @@ -8,7 +8,7 @@ spec: apiVersion: apps/v1 kind: Deployment name: demo-deployment - minReplicas: 3 # Minimum replicas for availability + minReplicas: 2 # Minimum replicas for availability maxReplicas: 10 # Maximum replicas for scaling up based on load metrics: - type: Resource From 7687f05a404f3803758bd403c7d527b0e34a2155 Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 2 Dec 2024 23:13:01 +0100 Subject: [PATCH 39/45] dp --- k8s-manifests/application-deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s-manifests/application-deployment.yml b/k8s-manifests/application-deployment.yml index 58907ab..c6602a2 100644 --- a/k8s-manifests/application-deployment.yml +++ b/k8s-manifests/application-deployment.yml @@ -3,7 +3,7 @@ kind: Deployment metadata: name: demo-deployment spec: - replicas: 2 # Ensure 3 replicas for high availability + replicas: 1 # Ensure 3 replicas for high availability selector: matchLabels: app: demo-app From 8071c87f9e2452a47b685d6e83ff99f67f8d0bc6 Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 2 Dec 2024 23:16:39 +0100 Subject: [PATCH 40/45] hpa --- k8s-manifests/hpafile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s-manifests/hpafile.yml b/k8s-manifests/hpafile.yml index 803a691..8f23d93 100644 --- a/k8s-manifests/hpafile.yml +++ b/k8s-manifests/hpafile.yml @@ -8,7 +8,7 @@ spec: apiVersion: apps/v1 kind: Deployment name: demo-deployment - minReplicas: 2 # Minimum replicas for availability + minReplicas: 3 # Minimum replicas for availability maxReplicas: 10 # Maximum replicas for scaling up based on load metrics: - type: Resource From 4599be3a62246fe93148caf624f6597dc472228f Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 2 Dec 2024 23:17:12 +0100 Subject: [PATCH 41/45] deploy --- k8s-manifests/application-deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s-manifests/application-deployment.yml b/k8s-manifests/application-deployment.yml index c6602a2..508cc98 100644 --- a/k8s-manifests/application-deployment.yml +++ b/k8s-manifests/application-deployment.yml @@ -3,7 +3,7 @@ kind: Deployment metadata: name: demo-deployment spec: - replicas: 1 # Ensure 3 replicas for high availability + replicas: 3 # Ensure 3 replicas for high availability selector: matchLabels: app: demo-app From ad73345bd162e7ce826a0d7eeda2a604dc338511 Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 2 Dec 2024 23:22:12 +0100 Subject: [PATCH 42/45] imagechange --- k8s-manifests/application-deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s-manifests/application-deployment.yml b/k8s-manifests/application-deployment.yml index 508cc98..f4c3ad2 100644 --- a/k8s-manifests/application-deployment.yml +++ b/k8s-manifests/application-deployment.yml @@ -14,7 +14,7 @@ spec: spec: containers: - name: demo-container - image: ersanjeev/testapp02122024 # Replace with Docker image + image: ersanjeev/testapp02122024:latest # Replace with Docker image ports: - containerPort: 8000 # application will run on port 8000 inside container envFrom: From 206a6545a3e3ffa8fe10501694c01c650d8099e8 Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 2 Dec 2024 23:28:14 +0100 Subject: [PATCH 43/45] name chnage --- .github/workflows/build-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index c5b59b7..eee71d6 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -67,7 +67,7 @@ jobs: - name: update kube config run: aws eks update-kubeconfig --region eu-central-1 --name eksdemo - - name: Deploz to EKS + - name: Deploy to EKS run: | kubectl apply -f ./k8s-manifests/application-deployment.yml From d90a1d83cc31b978d9c40c26dcaf912f66bf8721 Mon Sep 17 00:00:00 2001 From: = <=> Date: Tue, 3 Dec 2024 10:45:23 +0100 Subject: [PATCH 44/45] red --- k8s-manifests/redis-deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s-manifests/redis-deployment.yml b/k8s-manifests/redis-deployment.yml index f5a9121..faf4021 100644 --- a/k8s-manifests/redis-deployment.yml +++ b/k8s-manifests/redis-deployment.yml @@ -3,7 +3,7 @@ kind: Deployment metadata: name: redis-deployment spec: - replicas: 1 + replicas: 2 selector: matchLabels: app: redis From d14ae1498d1c36413108e246045367bbe990a7a1 Mon Sep 17 00:00:00 2001 From: sanjeev Date: Wed, 25 Dec 2024 11:33:44 +0100 Subject: [PATCH 45/45] change file replica --- k8s-manifests/redis-deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s-manifests/redis-deployment.yml b/k8s-manifests/redis-deployment.yml index faf4021..f5a9121 100644 --- a/k8s-manifests/redis-deployment.yml +++ b/k8s-manifests/redis-deployment.yml @@ -3,7 +3,7 @@ kind: Deployment metadata: name: redis-deployment spec: - replicas: 2 + replicas: 1 selector: matchLabels: app: redis