From a172d7926972921b093512b256ea9af527a6295c Mon Sep 17 00:00:00 2001 From: Chichi Ugorji Date: Sat, 13 Jan 2024 15:25:02 +0000 Subject: [PATCH 01/47] Revert "updates repo with files needed for students" This reverts commit f79caf6adcbbd57614faaf49584d2a705bbca2c7. --- Dockerfile | 32 ++++++++++++++++++++++++++++++++ azure-pipelines-1.yml | 27 +++++++++++++++++++++++++++ azure-pipelines.yml | 28 ++++++++++++++++++++++++++++ deployment.yaml | 40 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 127 insertions(+) create mode 100644 Dockerfile create mode 100644 azure-pipelines-1.yml create mode 100644 azure-pipelines.yml create mode 100644 deployment.yaml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..da0a21ee --- /dev/null +++ b/Dockerfile @@ -0,0 +1,32 @@ +# Use an official Python runtime as a parent image +FROM python:3.8-slim + +# Set the working directory in the container +WORKDIR /app + +# Copy the current directory contents into the container at /app +COPY . /app + +# Install system dependencies and ODBC driver +RUN apt-get update && apt-get install -y \ + unixodbc unixodbc-dev odbcinst odbcinst1debian2 libpq-dev gcc && \ + apt-get install -y gnupg && \ + apt-get install -y wget && \ + wget -qO- https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \ + wget -qO- https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list && \ + apt-get update && \ + ACCEPT_EULA=Y apt-get install -y msodbcsql18 && \ + # apt-get purge -y --auto-remove wget && \ + apt-get clean + +# Install pip and setuptools +RUN pip install --upgrade pip setuptools + +# Install Python packages specified in requirements.txt +RUN pip install --trusted-host pypi.python.org -r requirements.txt + +# Expose port 5000 (change to your desired port) +EXPOSE 5000 + +# Run app.py when the container launches +CMD ["python", "app.py"] diff --git a/azure-pipelines-1.yml b/azure-pipelines-1.yml new file mode 100644 index 00000000..da4a24bb --- /dev/null +++ b/azure-pipelines-1.yml @@ -0,0 +1,27 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +trigger: +- main + +pool: + vmImage: ubuntu-latest + +steps: +- task: Docker@2 + inputs: + containerRegistry: 'Docker Hub' + repository: 'mayaaiuga/test-run-image' + command: 'buildAndPush' + Dockerfile: '**/Dockerfile' + tags: 'latest' +- task: KubernetesManifest@1 + inputs: + action: 'deploy' + connectionType: 'azureResourceManager' + azureSubscriptionConnection: 'aks-service-connection' + azureResourceGroup: 'aks-rg' + kubernetesCluster: 'aks-demo' + manifests: 'deployment.yaml' \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000..219d96f5 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,28 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +trigger: +- main + +pool: + vmImage: ubuntu-latest + +steps: +- task: Docker@2 + inputs: + containerRegistry: 'Docker Hub' + repository: 'mayaaiuga/devops-web-app' + command: 'buildAndPush' + Dockerfile: '**/Dockerfile' + tags: 'latest' + +- task: KubernetesManifest@1 + inputs: + action: 'deploy' + connectionType: 'azureResourceManager' + azureSubscriptionConnection: 'aks-service-connection' + azureResourceGroup: 'aks-rg' + kubernetesCluster: 'aks-demo' + manifests: 'deployment.yaml' \ No newline at end of file diff --git a/deployment.yaml b/deployment.yaml new file mode 100644 index 00000000..a332a61c --- /dev/null +++ b/deployment.yaml @@ -0,0 +1,40 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: flask-app-deployment +spec: + replicas: 2 # Adjust the number of replicas as needed + selector: + matchLabels: + app: flask-app + template: + metadata: + labels: + app: flask-app + spec: + containers: + - name: flask-app-container + image: mayaaiuga/test-run-image:latest + ports: + - containerPort: 5000 # Expose the same port specified in your Dockerfile + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 + +--- +apiVersion: v1 +kind: Service +metadata: + name: flask-app-services +spec: + selector: + app: flask-app + ports: + - protocol: TCP + port: 80 # Port for internal communication within the cluster + targetPort: 5000 # Port exposed by your container + type: ClusterIP # Internal service + + From e902dfce306f5392b367ab89e4f4aabbc9e72679 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji Date: Sun, 14 Jan 2024 13:25:12 +0000 Subject: [PATCH 02/47] My Dockerfile added to my repo --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index da0a21ee..a2e4c015 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ # Use an official Python runtime as a parent image -FROM python:3.8-slim +# Using a specific image for M1/M2 chip Mac users +FROM --platform=linux/amd64/v8 public.ecr.aws/docker/library/python:3.9.10-slim-buster # Set the working directory in the container WORKDIR /app From 3d0e211d24bd0a4408100a92c71f7a0d236f3920 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji Date: Sun, 14 Jan 2024 23:39:08 +0000 Subject: [PATCH 03/47] Updates the terraform-project and all modules --- aks-terraform/.DS_Store | Bin 0 -> 6148 bytes aks-terraform/.gitignore | 3 + aks-terraform/Dockerfile | 33 ++++ aks-terraform/LICENSE | 21 +++ aks-terraform/README.md | 105 +++++++++++ aks-terraform/app.py | 113 ++++++++++++ aks-terraform/azure-pipelines-1.yml | 27 +++ aks-terraform/azure-pipelines.yml | 28 +++ aks-terraform/deployment.yaml | 40 ++++ aks-terraform/modules/.DS_Store | Bin 0 -> 6148 bytes .../networking-module/.terraform.lock.hcl | 21 +++ .../modules/networking-module/main.tf | 63 +++++++ .../modules/networking-module/outputs.tf | 24 +++ .../modules/networking-module/variables.tf | 18 ++ aks-terraform/requirements.txt | 4 + aks-terraform/static/script.js | 49 +++++ aks-terraform/static/style.css | 174 ++++++++++++++++++ aks-terraform/templates/orders.html | 88 +++++++++ 18 files changed, 811 insertions(+) create mode 100644 aks-terraform/.DS_Store create mode 100644 aks-terraform/.gitignore create mode 100644 aks-terraform/Dockerfile create mode 100644 aks-terraform/LICENSE create mode 100644 aks-terraform/README.md create mode 100644 aks-terraform/app.py create mode 100644 aks-terraform/azure-pipelines-1.yml create mode 100644 aks-terraform/azure-pipelines.yml create mode 100644 aks-terraform/deployment.yaml create mode 100644 aks-terraform/modules/.DS_Store create mode 100644 aks-terraform/modules/networking-module/.terraform.lock.hcl create mode 100644 aks-terraform/modules/networking-module/main.tf create mode 100644 aks-terraform/modules/networking-module/outputs.tf create mode 100644 aks-terraform/modules/networking-module/variables.tf create mode 100644 aks-terraform/requirements.txt create mode 100644 aks-terraform/static/script.js create mode 100644 aks-terraform/static/style.css create mode 100644 aks-terraform/templates/orders.html diff --git a/aks-terraform/.DS_Store b/aks-terraform/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..190550528b56ffdd05c7d94a8fb5d2f2434ebef9 GIT binary patch literal 6148 zcmeHKyG{c!5S)cbM50NV(!anTSW)-_egMIxyXcB2{Z)JypT_K?AUf!h0yHbF$6oK) z@)WnX0Bm<2o`4O2HQf;(J}k}m-4}LO5hK!h#)tz>!|8o|n-Sn7B#o~6J-y$8>6E#W!DR8O4eJ(d% z|DWl<^#7M6t)zey_*V+pYX7p|@kv!%7mxE=+vu-!&-tXgaUK*7QI3gGj=Au1yp5#H aYd+_GFPsyD&Uny?`WbLtWK!VP3VZ=HMHQR? literal 0 HcmV?d00001 diff --git a/aks-terraform/.gitignore b/aks-terraform/.gitignore new file mode 100644 index 00000000..de6869f2 --- /dev/null +++ b/aks-terraform/.gitignore @@ -0,0 +1,3 @@ +*.tfstate +*.tfvars +.terraform/ diff --git a/aks-terraform/Dockerfile b/aks-terraform/Dockerfile new file mode 100644 index 00000000..a2e4c015 --- /dev/null +++ b/aks-terraform/Dockerfile @@ -0,0 +1,33 @@ +# Use an official Python runtime as a parent image +# Using a specific image for M1/M2 chip Mac users +FROM --platform=linux/amd64/v8 public.ecr.aws/docker/library/python:3.9.10-slim-buster + +# Set the working directory in the container +WORKDIR /app + +# Copy the current directory contents into the container at /app +COPY . /app + +# Install system dependencies and ODBC driver +RUN apt-get update && apt-get install -y \ + unixodbc unixodbc-dev odbcinst odbcinst1debian2 libpq-dev gcc && \ + apt-get install -y gnupg && \ + apt-get install -y wget && \ + wget -qO- https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \ + wget -qO- https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list && \ + apt-get update && \ + ACCEPT_EULA=Y apt-get install -y msodbcsql18 && \ + # apt-get purge -y --auto-remove wget && \ + apt-get clean + +# Install pip and setuptools +RUN pip install --upgrade pip setuptools + +# Install Python packages specified in requirements.txt +RUN pip install --trusted-host pypi.python.org -r requirements.txt + +# Expose port 5000 (change to your desired port) +EXPOSE 5000 + +# Run app.py when the container launches +CMD ["python", "app.py"] diff --git a/aks-terraform/LICENSE b/aks-terraform/LICENSE new file mode 100644 index 00000000..d3e43ac2 --- /dev/null +++ b/aks-terraform/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Maya Iuga + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/aks-terraform/README.md b/aks-terraform/README.md new file mode 100644 index 00000000..4b97b1df --- /dev/null +++ b/aks-terraform/README.md @@ -0,0 +1,105 @@ +# Web-App-DevOps-Project + +Welcome to the Web App DevOps Project repo! This application allows you to efficiently manage and track orders for a potential business. It provides an intuitive user interface for viewing existing orders and adding new ones. + +## Table of Contents + +- [Features](#features) +- [Getting Started](#getting-started) +- [Technology Stack](#technology-stack) +- [Contributors](#contributors) +- [License](#license) + +## Features + +- **Order List:** View a comprehensive list of orders including details like date UUID, user ID, card number, store code, product code, product quantity, order date, and shipping date. + +![Screenshot 2023-08-31 at 15 48 48](https://github.com/maya-a-iuga/Web-App-DevOps-Project/assets/104773240/3a3bae88-9224-4755-bf62-567beb7bf692) + +- **Pagination:** Easily navigate through multiple pages of orders using the built-in pagination feature. + +![Screenshot 2023-08-31 at 15 49 08](https://github.com/maya-a-iuga/Web-App-DevOps-Project/assets/104773240/d92a045d-b568-4695-b2b9-986874b4ed5a) + +- **Add New Order:** Fill out a user-friendly form to add new orders to the system with necessary information. + +![Screenshot 2023-08-31 at 15 49 26](https://github.com/maya-a-iuga/Web-App-DevOps-Project/assets/104773240/83236d79-6212-4fc3-afa3-3cee88354b1a) + +- **Data Validation:** Ensure data accuracy and completeness with required fields, date restrictions, and card number validation. + +## Getting Started + +### Prerequisites + +For the application to succesfully run, you need to install the following packages: + +- flask (version 2.2.2) +- pyodbc (version 4.0.39) +- SQLAlchemy (version 2.0.21) +- werkzeug (version 2.2.3) + +### Usage + +To run the application, you simply need to run the `app.py` script in this repository. Once the application starts you should be able to access it locally at `http://127.0.0.1:5000`. Here you will be meet with the following two pages: + +1. **Order List Page:** Navigate to the "Order List" page to view all existing orders. Use the pagination controls to navigate between pages. + +2. **Add New Order Page:** Click on the "Add New Order" tab to access the order form. Complete all required fields and ensure that your entries meet the specified criteria. + +## Technology Stack + +- **Backend:** Flask is used to build the backend of the application, handling routing, data processing, and interactions with the database. + +- **Frontend:** The user interface is designed using HTML, CSS, and JavaScript to ensure a smooth and intuitive user experience. + +- **Database:** The application employs an Azure SQL Database as its database system to store order-related data. + +- **Iac** + +1. **Initialize Terraform Project** + +Created a project directory named aks-terraform. +Initialized Terraform using terraform init within this directory. + +2. **Create Modules Directory** +Established a modular structure with two modules: networking-module and aks-cluster-module. +Created directories for each module within the aks-terraform project. + +3. **Networking Module Configuration** + +- variables.tf (Networking Module) + +Defined input variables: +resource_group_name: Name of the Azure Resource Group. +location: Azure region for deploying resources. +vnet_address_space: Address space for the VNet. + +- main.tf (Networking Module) + +Configured essential Azure networking resources: +Resource Group: Created using the resource_group_name variable. +Virtual Network (VNet): Named aks-vnet. +Subnets: Created two subnets - control-plane-subnet and worker-node-subnet. +Network Security Group (NSG): Named aks-nsg with two inbound rules: +kube-apiserver-rule: To allow traffic to kube-apiserver. +ssh-rule: To allow SSH traffic (using 0.0.0.0/0 for wide access, marked with a cautionary comment). + +- outputs.tf (Networking Module) + +Defined output variables to expose necessary information for other modules: +vnet_id: ID of the created VNet. +control_plane_subnet_id: ID of the control plane subnet. +worker_node_subnet_id: ID of the worker node subnet. +networking_resource_group_name: Name of the created resource group. +aks_nsg_id: ID of the created NSG. + +4. **Terraform Execution** +Executed terraform init within the networking-module directory to initialize the module. + +## Contributors + +- [Maya Iuga]([https://github.com/yourusername](https://github.com/maya-a-iuga)) +- C.Ugorji + +## License + +This project is licensed under the MIT License. For more details, refer to the [LICENSE](LICENSE) file. diff --git a/aks-terraform/app.py b/aks-terraform/app.py new file mode 100644 index 00000000..6bcca272 --- /dev/null +++ b/aks-terraform/app.py @@ -0,0 +1,113 @@ +from flask import Flask, render_template, request, redirect, url_for +from sqlalchemy import create_engine, Column, Integer, String, DateTime +from sqlalchemy.orm import sessionmaker +from sqlalchemy.ext.declarative import declarative_base +from sqlalchemy import create_engine +import pyodbc +import os + +# Initialise Flask App +app = Flask(__name__) + +# database connection +server = 'devops-project-server.database.windows.net' +database = 'orders-db' +username = 'maya' +password = 'AiCore1237' +driver= '{ODBC Driver 18 for SQL Server}' + +# Create the connection string +connection_string=f'Driver={driver};\ + Server=tcp:{server},1433;\ + Database={database};\ + Uid={username};\ + Pwd={password};\ + Encrypt=yes;\ + TrustServerCertificate=no;\ + Connection Timeout=30;' + +# Create the engine to connect to the database +engine = create_engine("mssql+pyodbc:///?odbc_connect={}".format(connection_string)) +engine.connect() + +# Create the Session +Session = sessionmaker(bind=engine) + +# Define the Order data model +Base = declarative_base() + +class Order(Base): + __tablename__ = 'orders' + date_uuid = Column('date_uuid', String, primary_key=True) + user_id = Column('User ID', String, primary_key=True) + card_number = Column('Card Number', String) + store_code = Column('Store Code', String) + product_code = Column('product_code', String) + product_quantity = Column('Product Quantity', Integer) + order_date = Column('Order Date', DateTime) + shipping_date = Column('Shipping Date', DateTime) + delivery_date = Column('Delivery Date', DateTime) +# define routes +# route to display orders +@app.route('/') +def display_orders(): + + page = int(request.args.get('page', 1)) + rows_per_page = 25 + + # Calculate the start and end indices for the current page + start_index = (page - 1) * rows_per_page + end_index = start_index + rows_per_page + + # Create a session to interact with the database + session = Session() + + # Fetch a subset of data for the current page + current_page_orders = session.query(Order).order_by(Order.user_id, Order.date_uuid).slice(start_index, end_index).all() + + # Calculate the total number of pages + total_rows = session.query(Order).count() + total_pages = (total_rows + rows_per_page - 1) // rows_per_page + + # Close the session + session.close() + + return render_template('orders.html', orders=current_page_orders, page=page, total_pages=total_pages) + +# route to add orders +@app.route('/add_order', methods=['POST']) +def add_order(): + date_uuid = request.form.get('date_uuid') + user_id = request.form.get('user_id') + card_number = request.form.get('card_number') + store_code = request.form.get('store_code') + product_code = request.form.get('product_code') + product_quantity = request.form.get('product_quantity') + order_date = request.form.get('order_date') + shipping_date = request.form.get('shipping_date') + delivery_date = request.form['delivery_date'] + # Create a session to interact with the database + session = Session() + + # Create a new order object using the form data + new_order = Order( + date_uuid=date_uuid, + user_id=user_id, + card_number=card_number, + store_code=store_code, + product_code=product_code, + product_quantity=product_quantity, + order_date=order_date, + shipping_date=shipping_date + delivery_date=delivery_date + ) + + # Add the new order to the session and commit to the database + session.add(new_order) + session.commit() + + return redirect(url_for('display_orders')) + +# run the app +if __name__ == '__main__': + app.run(host='0.0.0.0', port=5000, debug=True) diff --git a/aks-terraform/azure-pipelines-1.yml b/aks-terraform/azure-pipelines-1.yml new file mode 100644 index 00000000..da4a24bb --- /dev/null +++ b/aks-terraform/azure-pipelines-1.yml @@ -0,0 +1,27 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +trigger: +- main + +pool: + vmImage: ubuntu-latest + +steps: +- task: Docker@2 + inputs: + containerRegistry: 'Docker Hub' + repository: 'mayaaiuga/test-run-image' + command: 'buildAndPush' + Dockerfile: '**/Dockerfile' + tags: 'latest' +- task: KubernetesManifest@1 + inputs: + action: 'deploy' + connectionType: 'azureResourceManager' + azureSubscriptionConnection: 'aks-service-connection' + azureResourceGroup: 'aks-rg' + kubernetesCluster: 'aks-demo' + manifests: 'deployment.yaml' \ No newline at end of file diff --git a/aks-terraform/azure-pipelines.yml b/aks-terraform/azure-pipelines.yml new file mode 100644 index 00000000..219d96f5 --- /dev/null +++ b/aks-terraform/azure-pipelines.yml @@ -0,0 +1,28 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +trigger: +- main + +pool: + vmImage: ubuntu-latest + +steps: +- task: Docker@2 + inputs: + containerRegistry: 'Docker Hub' + repository: 'mayaaiuga/devops-web-app' + command: 'buildAndPush' + Dockerfile: '**/Dockerfile' + tags: 'latest' + +- task: KubernetesManifest@1 + inputs: + action: 'deploy' + connectionType: 'azureResourceManager' + azureSubscriptionConnection: 'aks-service-connection' + azureResourceGroup: 'aks-rg' + kubernetesCluster: 'aks-demo' + manifests: 'deployment.yaml' \ No newline at end of file diff --git a/aks-terraform/deployment.yaml b/aks-terraform/deployment.yaml new file mode 100644 index 00000000..a332a61c --- /dev/null +++ b/aks-terraform/deployment.yaml @@ -0,0 +1,40 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: flask-app-deployment +spec: + replicas: 2 # Adjust the number of replicas as needed + selector: + matchLabels: + app: flask-app + template: + metadata: + labels: + app: flask-app + spec: + containers: + - name: flask-app-container + image: mayaaiuga/test-run-image:latest + ports: + - containerPort: 5000 # Expose the same port specified in your Dockerfile + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 + +--- +apiVersion: v1 +kind: Service +metadata: + name: flask-app-services +spec: + selector: + app: flask-app + ports: + - protocol: TCP + port: 80 # Port for internal communication within the cluster + targetPort: 5000 # Port exposed by your container + type: ClusterIP # Internal service + + diff --git a/aks-terraform/modules/.DS_Store b/aks-terraform/modules/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..f66d02c9c6ab806394141753406ae1bf24f376c0 GIT binary patch literal 6148 zcmeHKJ4ysm5Ukb>7EIR6@Lj;b8w|^O0xuvsi-@BOu8ZkJp39?I{XrOJ1rrmghVFW= zU)LL^g6U}hwm$S%zzV>U?uZW$bMtfenVnR|h;-hu!z-Tfh!;G}s*fj}d(QeT-ta!* zU*ehj9tRBA_WS$cZnqnbU!trOkOERb3P=Gd@M{IU_tKVUiHcG{3P^!(1^oNa=#E|C zm>8c9h8O{e3#P-kj#+}(JVERV$3$jmmQ-R=twsz>I`ggSy23Fr>986;te$K&p;$bf z_qQmAb%}~nKnhG1IL+(oPCUfq$idEjBlsHD9TE>+I#c*Eaes-D^JS rZd?b2A=)u9+A%lYjxVAp>zc25-W86CL1#YbMEwl7E;1?b*9v?AJ>wX5 literal 0 HcmV?d00001 diff --git a/aks-terraform/modules/networking-module/.terraform.lock.hcl b/aks-terraform/modules/networking-module/.terraform.lock.hcl new file mode 100644 index 00000000..39f75cb6 --- /dev/null +++ b/aks-terraform/modules/networking-module/.terraform.lock.hcl @@ -0,0 +1,21 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/hashicorp/azurerm" { + version = "3.87.0" + hashes = [ + "h1:PfnDrSQo5bwN6KV1nVj+5MHnNxeD3bglvFahgJctQHY=", + "zh:1547ed020fa6ca25d940b28601442c7e4495fdea9fb1ead7affb867383f5f40b", + "zh:325e6d636b5ab09a24837194647617c9fabd42f0fb2c7e18ae8d2a8b2d890a55", + "zh:3abb0074de1dc3b723f8c209354ba93e717ba52003847484b19369e8f54735f4", + "zh:52d2b1700108d5093113a986aa10757834e48083c1358a2c7d8d0360e2689390", + "zh:5fe377d5cc80e26766ff411dbcb227728709fe34b14ad106c9e374df653086a4", + "zh:747fe80de4fb88b17cac93ff05d62909d3563325c8ed5a461641b48579c328f8", + "zh:b40142e4041b7f000ab2dda58309755395a4018d5d00218f6a601f737389865a", + "zh:bca622818c221cec81d636879e376c15696a8d091703298195d728b3c1eae7db", + "zh:bfaecd203137ff9eb3228b1cbd3191e1d84d7c019855eb5f3071bbf6eb060a51", + "zh:d197f04b54f2be07f827ced220954d723039c84793a4ce91894b622982c25811", + "zh:e831601ea1f67c5e745946ed3ac0cac772ed8e95ca7d7314d3f0ed631e6eefb1", + "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", + ] +} diff --git a/aks-terraform/modules/networking-module/main.tf b/aks-terraform/modules/networking-module/main.tf new file mode 100644 index 00000000..f7a78e13 --- /dev/null +++ b/aks-terraform/modules/networking-module/main.tf @@ -0,0 +1,63 @@ +resource "azurerm_resource_group" "aks_rg" { + name = var.resource_group_name + location = var.location +} + +resource "azurerm_virtual_network" "aks_vnet" { + name = "aks-vnet" + address_space = var.vnet_address_space + location = var.location + resource_group_name = azurerm_resource_group.aks_rg.name +} + +resource "azurerm_subnet" "control_plane_subnet" { + name = "control-plane-subnet" + resource_group_name = azurerm_resource_group.aks_rg.name + virtual_network_name = azurerm_virtual_network.aks_vnet.name + address_prefixes = ["10.0.1.0/24"] +} +resource "azurerm_subnet" "worker_node_subnet" { + name = "worker-node-subnet" + resource_group_name = azurerm_resource_group.aks_rg.name + virtual_network_name = azurerm_virtual_network.aks_vnet.name + address_prefixes = ["10.0.2.0/24"] +} + +resource "azurerm_network_security_group" "aks_nsg" { + name = "aks-nsg" + location = var.location + resource_group_name = azurerm_resource_group.aks_rg.name +} + +# Inbound rules for kube_apiserver + +resource "azurerm_network_security_rule" "kube_apiserver_rule" { + name = "kube-apiserver-rule" + priority = 100 + direction = "Inbound" + access = "Allow" + protocol = "Tcp" + source_port_range = "*" + destination_port_range = "443" # Standard port for kube-apiserver + source_address_prefix = "0.0.0.0/0" # WARNING allows all traffic ...use only for testing! + destination_address_prefix = "*" + resource_group_name = azurerm_resource_group.aks_rg.name + network_security_group_name = azurerm_network_security_group.aks_nsg.name +} + +# inbound rules SSH + +resource "azurerm_network_security_rule" "ssh_rule" { + name = "ssh-rule" + priority = 101 + direction = "Inbound" + access = "Allow" + protocol = "Tcp" + source_port_range = "*" + destination_port_range = "22" # Standard port for SSH + source_address_prefix = "0.0.0.0/0" # WARNING: Allows all traffic, please use only for testing! + destination_address_prefix = "*" + resource_group_name = azurerm_resource_group.aks_rg.name + network_security_group_name = azurerm_network_security_group.aks_nsg.name +} + diff --git a/aks-terraform/modules/networking-module/outputs.tf b/aks-terraform/modules/networking-module/outputs.tf new file mode 100644 index 00000000..99a42897 --- /dev/null +++ b/aks-terraform/modules/networking-module/outputs.tf @@ -0,0 +1,24 @@ +output "vnet_id" { + value = azurerm_virtual_network.aks_vnet.id + description = "The ID of the Virtual Network." +} + +output "control_plane_subnet_id" { + value = azurerm_subnet.control_plane_subnet.id + description = "The ID of the control plane subnet within the VNet." +} + +output "worker_node_subnet_id" { + value = azurerm_subnet.worker_node_subnet.id + description = "The ID of the worker node subnet within the VNet." +} + +output "networking_resource_group_name" { + value = azurerm_resource_group.aks_rg.name + description = "The name of the Azure Resource Group where the networking resources were provisioned." +} +output "aks_nsg_id" { + value = azurerm_network_security_group.aks_nsg.id + description = "The ID of the Network Security Group." +} + diff --git a/aks-terraform/modules/networking-module/variables.tf b/aks-terraform/modules/networking-module/variables.tf new file mode 100644 index 00000000..e81d1a70 --- /dev/null +++ b/aks-terraform/modules/networking-module/variables.tf @@ -0,0 +1,18 @@ +variable "resource_group_name" { + type = string + description = "The name of the Azure Resource Group for networking resources." + default = "default-rg" +} + +variable "location" { + type = string + description = "The Azure region where the networking resources will be deployed." + default = "UK South" +} + +variable "vnet_address_space" { + type = list(string) + description = "The address space for the Virtual Network." + default = ["10.0.0.0/16"] +} + diff --git a/aks-terraform/requirements.txt b/aks-terraform/requirements.txt new file mode 100644 index 00000000..47ec762e --- /dev/null +++ b/aks-terraform/requirements.txt @@ -0,0 +1,4 @@ +flask==2.2.2 +pyodbc==4.0.39 +SQLAlchemy==2.0.21 +werkzeug===2.2.3 \ No newline at end of file diff --git a/aks-terraform/static/script.js b/aks-terraform/static/script.js new file mode 100644 index 00000000..2d0ef9e4 --- /dev/null +++ b/aks-terraform/static/script.js @@ -0,0 +1,49 @@ +document.addEventListener("DOMContentLoaded", function() { + const paginationLinks = document.querySelectorAll(".pagination-link"); + const orderTable = document.querySelector(".order-table"); + const btnOrders = document.getElementById("btn-orders"); + const btnAddOrder = document.getElementById("btn-add-order"); + const orderListContent = document.getElementById("order-list-content"); + const addOrderContent = document.getElementById("add-order-content"); + + // Pagination click event + paginationLinks.forEach(link => { + link.addEventListener("click", function(event) { + event.preventDefault(); + + const nextPageURL = this.getAttribute("href"); + + // Send AJAX request to fetch next page data + fetch(nextPageURL) + .then(response => response.text()) + .then(data => { + // Update table and pagination controls + const newHTML = new DOMParser().parseFromString(data, "text/html"); + const newTable = newHTML.querySelector(".order-table"); + const newPagination = newHTML.querySelector(".pagination"); + + orderTable.innerHTML = newTable.innerHTML; + const paginationDiv = document.querySelector(".pagination"); + paginationDiv.innerHTML = newPagination.innerHTML; + + // Scroll to the top of the table + window.scrollTo({ top: orderTable.offsetTop, behavior: "smooth" }); + }) + .catch(error => { + console.error("Error fetching data:", error); + }); + }); + }); + + // Tab buttons click events + btnOrders.addEventListener("click", function() { + orderListContent.style.display = "block"; + addOrderContent.style.display = "none"; + }); + + btnAddOrder.addEventListener("click", function() { + orderListContent.style.display = "none"; + addOrderContent.style.display = "block"; + }); +}); + diff --git a/aks-terraform/static/style.css b/aks-terraform/static/style.css new file mode 100644 index 00000000..2ded36be --- /dev/null +++ b/aks-terraform/static/style.css @@ -0,0 +1,174 @@ +body { + font-family: Arial, sans-serif; + margin: 0; + padding: 0; + background-color: #f0f0f0; +} + +h1 { + color: #333; +} + +ul { + list-style-type: none; + padding: 0; +} + +li { + margin-bottom: 20px; + padding: 10px; + background-color: #fff; + border-radius: 5px; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); +} + +form { + margin-top: 20px; + padding: 20px; + background-color: #fff; + border-radius: 5px; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); +} + +label { + display: block; + margin-bottom: 5px; +} + +input { + width: 100%; + padding: 10px; + margin-bottom: 10px; + border: 1px solid #ccc; + border-radius: 5px; + box-sizing: border-box; +} + +input[type="submit"] { + background-color: #007bff; + color: #fff; + cursor: pointer; +} + +/* Add border and spacing to the table */ +.order-table { + border-collapse: collapse; + width: 100%; + margin-bottom: 20px; +} + +/* Style table header cells */ +.order-table th { + background-color: #f2f2f2; + border: 1px solid #dddddd; + text-align: left; + padding: 8px; +} + +/* Style table data cells */ +.order-table td { + border: 1px solid #dddddd; + text-align: left; + padding: 8px; +} + +/* Alternate row background color */ +.order-table tbody tr:nth-child(even) { + background-color: #f2f2f2; +} + +/* Hover effect on rows */ +.order-table tbody tr:hover { + background-color: #ddd; +} + +/* Position pagination controls at bottom right */ +.pagination { + display: flex; + justify-content: flex-end; + align-items: center; + margin-top: 20px; +} + +/* Style pagination links */ +.pagination-link { + padding: 5px 10px; + background-color: #007bff; + color: #fff; + text-decoration: none; + border-radius: 3px; + margin: 0 5px; +} + +/* Style current page indicator */ +.pagination span { + margin: 0 10px; +} + +/* Additional styling for tabs and tab content */ +.tab-container { + display: flex; + flex-direction: column; + align-items: center; + margin-top: 20px; +} + +.tab { + display: none; +} + +.tab-content { + margin-top: 20px; +} + +#tab-orders:checked ~ .tab-content:nth-child(1), +#tab-add-order:checked ~ .tab-content:nth-child(2) { + display: block; +} + +.tab-buttons { + display: flex; + justify-content: center; + margin-top: 20px; +} + +.tab-label { + margin: 0 10px; + padding: 10px 20px; + border: 2px solid #007bff; + border-radius: 5px; + cursor: pointer; + transition: background-color 0.3s ease, color 0.3s ease; + color: #fff; /* Set default text color to white */ + background-color: #007bff; /* Set default background color to blue */ +} + +.tab-label:hover { + background-color: #fff; /* Change background to white on hover */ + color: #007bff; /* Change text color to blue on hover */ +} + +.tab-label:checked { + background-color: #fff; /* Change background to white when checked */ + color: #007bff; /* Change text color to blue when checked */ +} + +.header { + text-align: center; + margin-top: 20px; +} + +.header h1 { + color: #007bff; + font-size: 24px; +} + +.tab-title { + text-align: left; + color: #007bff; + margin-top: 20px; + margin-bottom: 10px; +} + + + diff --git a/aks-terraform/templates/orders.html b/aks-terraform/templates/orders.html new file mode 100644 index 00000000..5277dcb6 --- /dev/null +++ b/aks-terraform/templates/orders.html @@ -0,0 +1,88 @@ + + + + Order Management + + + +
+

Fictional Company Name

+
+
+ + +
+ +
+
+

Order List

+ + + + + + + + + + + + + + + + + {% for order in orders %} + + + + + + + + + + + + {% endfor %} + +
Date UUIDUser IDCard NumberStore CodeProduct CodeProduct QuantityOrder DateShipping DateDelivery Date
{{ order.date_uuid }}{{ order.user_id }}{{ order.card_number }}{{ order.store_code }}{{ order.product_code }}{{ order.product_quantity }}{{ order.order_date }}{{ order.shipping_date }}{{ order.delivery_date }}
+ +
+ +
+ + + From 266d8cb34c2c9548a0356477f8520c70011a282e Mon Sep 17 00:00:00 2001 From: Chichi Ugorji Date: Tue, 16 Jan 2024 19:03:15 +0000 Subject: [PATCH 04/47] aks-terraform directory now contains only modules directory --- aks-terraform/.DS_Store | Bin 6148 -> 6148 bytes aks-terraform/Dockerfile | 33 ------ aks-terraform/LICENSE | 21 ---- aks-terraform/README.md | 105 ----------------- aks-terraform/app.py | 113 ------------------ aks-terraform/azure-pipelines-1.yml | 27 ----- aks-terraform/azure-pipelines.yml | 28 ----- aks-terraform/deployment.yaml | 40 ------- aks-terraform/requirements.txt | 4 - aks-terraform/static/script.js | 49 -------- aks-terraform/static/style.css | 174 ---------------------------- aks-terraform/templates/orders.html | 88 -------------- 12 files changed, 682 deletions(-) delete mode 100644 aks-terraform/Dockerfile delete mode 100644 aks-terraform/LICENSE delete mode 100644 aks-terraform/README.md delete mode 100644 aks-terraform/app.py delete mode 100644 aks-terraform/azure-pipelines-1.yml delete mode 100644 aks-terraform/azure-pipelines.yml delete mode 100644 aks-terraform/deployment.yaml delete mode 100644 aks-terraform/requirements.txt delete mode 100644 aks-terraform/static/script.js delete mode 100644 aks-terraform/static/style.css delete mode 100644 aks-terraform/templates/orders.html diff --git a/aks-terraform/.DS_Store b/aks-terraform/.DS_Store index 190550528b56ffdd05c7d94a8fb5d2f2434ebef9..85511bd6f87a7f59da1843f17c32efb95794f22a 100644 GIT binary patch delta 18 acmZoMXfc?uY~#i-_K6Mro4GlD@&f=#kOxcv delta 20 ccmZoMXfc?ujFEBU#xVAY4P2YqIsWnk08YaPNdN!< diff --git a/aks-terraform/Dockerfile b/aks-terraform/Dockerfile deleted file mode 100644 index a2e4c015..00000000 --- a/aks-terraform/Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ -# Use an official Python runtime as a parent image -# Using a specific image for M1/M2 chip Mac users -FROM --platform=linux/amd64/v8 public.ecr.aws/docker/library/python:3.9.10-slim-buster - -# Set the working directory in the container -WORKDIR /app - -# Copy the current directory contents into the container at /app -COPY . /app - -# Install system dependencies and ODBC driver -RUN apt-get update && apt-get install -y \ - unixodbc unixodbc-dev odbcinst odbcinst1debian2 libpq-dev gcc && \ - apt-get install -y gnupg && \ - apt-get install -y wget && \ - wget -qO- https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \ - wget -qO- https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list && \ - apt-get update && \ - ACCEPT_EULA=Y apt-get install -y msodbcsql18 && \ - # apt-get purge -y --auto-remove wget && \ - apt-get clean - -# Install pip and setuptools -RUN pip install --upgrade pip setuptools - -# Install Python packages specified in requirements.txt -RUN pip install --trusted-host pypi.python.org -r requirements.txt - -# Expose port 5000 (change to your desired port) -EXPOSE 5000 - -# Run app.py when the container launches -CMD ["python", "app.py"] diff --git a/aks-terraform/LICENSE b/aks-terraform/LICENSE deleted file mode 100644 index d3e43ac2..00000000 --- a/aks-terraform/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 Maya Iuga - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/aks-terraform/README.md b/aks-terraform/README.md deleted file mode 100644 index 4b97b1df..00000000 --- a/aks-terraform/README.md +++ /dev/null @@ -1,105 +0,0 @@ -# Web-App-DevOps-Project - -Welcome to the Web App DevOps Project repo! This application allows you to efficiently manage and track orders for a potential business. It provides an intuitive user interface for viewing existing orders and adding new ones. - -## Table of Contents - -- [Features](#features) -- [Getting Started](#getting-started) -- [Technology Stack](#technology-stack) -- [Contributors](#contributors) -- [License](#license) - -## Features - -- **Order List:** View a comprehensive list of orders including details like date UUID, user ID, card number, store code, product code, product quantity, order date, and shipping date. - -![Screenshot 2023-08-31 at 15 48 48](https://github.com/maya-a-iuga/Web-App-DevOps-Project/assets/104773240/3a3bae88-9224-4755-bf62-567beb7bf692) - -- **Pagination:** Easily navigate through multiple pages of orders using the built-in pagination feature. - -![Screenshot 2023-08-31 at 15 49 08](https://github.com/maya-a-iuga/Web-App-DevOps-Project/assets/104773240/d92a045d-b568-4695-b2b9-986874b4ed5a) - -- **Add New Order:** Fill out a user-friendly form to add new orders to the system with necessary information. - -![Screenshot 2023-08-31 at 15 49 26](https://github.com/maya-a-iuga/Web-App-DevOps-Project/assets/104773240/83236d79-6212-4fc3-afa3-3cee88354b1a) - -- **Data Validation:** Ensure data accuracy and completeness with required fields, date restrictions, and card number validation. - -## Getting Started - -### Prerequisites - -For the application to succesfully run, you need to install the following packages: - -- flask (version 2.2.2) -- pyodbc (version 4.0.39) -- SQLAlchemy (version 2.0.21) -- werkzeug (version 2.2.3) - -### Usage - -To run the application, you simply need to run the `app.py` script in this repository. Once the application starts you should be able to access it locally at `http://127.0.0.1:5000`. Here you will be meet with the following two pages: - -1. **Order List Page:** Navigate to the "Order List" page to view all existing orders. Use the pagination controls to navigate between pages. - -2. **Add New Order Page:** Click on the "Add New Order" tab to access the order form. Complete all required fields and ensure that your entries meet the specified criteria. - -## Technology Stack - -- **Backend:** Flask is used to build the backend of the application, handling routing, data processing, and interactions with the database. - -- **Frontend:** The user interface is designed using HTML, CSS, and JavaScript to ensure a smooth and intuitive user experience. - -- **Database:** The application employs an Azure SQL Database as its database system to store order-related data. - -- **Iac** - -1. **Initialize Terraform Project** - -Created a project directory named aks-terraform. -Initialized Terraform using terraform init within this directory. - -2. **Create Modules Directory** -Established a modular structure with two modules: networking-module and aks-cluster-module. -Created directories for each module within the aks-terraform project. - -3. **Networking Module Configuration** - -- variables.tf (Networking Module) - -Defined input variables: -resource_group_name: Name of the Azure Resource Group. -location: Azure region for deploying resources. -vnet_address_space: Address space for the VNet. - -- main.tf (Networking Module) - -Configured essential Azure networking resources: -Resource Group: Created using the resource_group_name variable. -Virtual Network (VNet): Named aks-vnet. -Subnets: Created two subnets - control-plane-subnet and worker-node-subnet. -Network Security Group (NSG): Named aks-nsg with two inbound rules: -kube-apiserver-rule: To allow traffic to kube-apiserver. -ssh-rule: To allow SSH traffic (using 0.0.0.0/0 for wide access, marked with a cautionary comment). - -- outputs.tf (Networking Module) - -Defined output variables to expose necessary information for other modules: -vnet_id: ID of the created VNet. -control_plane_subnet_id: ID of the control plane subnet. -worker_node_subnet_id: ID of the worker node subnet. -networking_resource_group_name: Name of the created resource group. -aks_nsg_id: ID of the created NSG. - -4. **Terraform Execution** -Executed terraform init within the networking-module directory to initialize the module. - -## Contributors - -- [Maya Iuga]([https://github.com/yourusername](https://github.com/maya-a-iuga)) -- C.Ugorji - -## License - -This project is licensed under the MIT License. For more details, refer to the [LICENSE](LICENSE) file. diff --git a/aks-terraform/app.py b/aks-terraform/app.py deleted file mode 100644 index 6bcca272..00000000 --- a/aks-terraform/app.py +++ /dev/null @@ -1,113 +0,0 @@ -from flask import Flask, render_template, request, redirect, url_for -from sqlalchemy import create_engine, Column, Integer, String, DateTime -from sqlalchemy.orm import sessionmaker -from sqlalchemy.ext.declarative import declarative_base -from sqlalchemy import create_engine -import pyodbc -import os - -# Initialise Flask App -app = Flask(__name__) - -# database connection -server = 'devops-project-server.database.windows.net' -database = 'orders-db' -username = 'maya' -password = 'AiCore1237' -driver= '{ODBC Driver 18 for SQL Server}' - -# Create the connection string -connection_string=f'Driver={driver};\ - Server=tcp:{server},1433;\ - Database={database};\ - Uid={username};\ - Pwd={password};\ - Encrypt=yes;\ - TrustServerCertificate=no;\ - Connection Timeout=30;' - -# Create the engine to connect to the database -engine = create_engine("mssql+pyodbc:///?odbc_connect={}".format(connection_string)) -engine.connect() - -# Create the Session -Session = sessionmaker(bind=engine) - -# Define the Order data model -Base = declarative_base() - -class Order(Base): - __tablename__ = 'orders' - date_uuid = Column('date_uuid', String, primary_key=True) - user_id = Column('User ID', String, primary_key=True) - card_number = Column('Card Number', String) - store_code = Column('Store Code', String) - product_code = Column('product_code', String) - product_quantity = Column('Product Quantity', Integer) - order_date = Column('Order Date', DateTime) - shipping_date = Column('Shipping Date', DateTime) - delivery_date = Column('Delivery Date', DateTime) -# define routes -# route to display orders -@app.route('/') -def display_orders(): - - page = int(request.args.get('page', 1)) - rows_per_page = 25 - - # Calculate the start and end indices for the current page - start_index = (page - 1) * rows_per_page - end_index = start_index + rows_per_page - - # Create a session to interact with the database - session = Session() - - # Fetch a subset of data for the current page - current_page_orders = session.query(Order).order_by(Order.user_id, Order.date_uuid).slice(start_index, end_index).all() - - # Calculate the total number of pages - total_rows = session.query(Order).count() - total_pages = (total_rows + rows_per_page - 1) // rows_per_page - - # Close the session - session.close() - - return render_template('orders.html', orders=current_page_orders, page=page, total_pages=total_pages) - -# route to add orders -@app.route('/add_order', methods=['POST']) -def add_order(): - date_uuid = request.form.get('date_uuid') - user_id = request.form.get('user_id') - card_number = request.form.get('card_number') - store_code = request.form.get('store_code') - product_code = request.form.get('product_code') - product_quantity = request.form.get('product_quantity') - order_date = request.form.get('order_date') - shipping_date = request.form.get('shipping_date') - delivery_date = request.form['delivery_date'] - # Create a session to interact with the database - session = Session() - - # Create a new order object using the form data - new_order = Order( - date_uuid=date_uuid, - user_id=user_id, - card_number=card_number, - store_code=store_code, - product_code=product_code, - product_quantity=product_quantity, - order_date=order_date, - shipping_date=shipping_date - delivery_date=delivery_date - ) - - # Add the new order to the session and commit to the database - session.add(new_order) - session.commit() - - return redirect(url_for('display_orders')) - -# run the app -if __name__ == '__main__': - app.run(host='0.0.0.0', port=5000, debug=True) diff --git a/aks-terraform/azure-pipelines-1.yml b/aks-terraform/azure-pipelines-1.yml deleted file mode 100644 index da4a24bb..00000000 --- a/aks-terraform/azure-pipelines-1.yml +++ /dev/null @@ -1,27 +0,0 @@ -# Starter pipeline -# Start with a minimal pipeline that you can customize to build and deploy your code. -# Add steps that build, run tests, deploy, and more: -# https://aka.ms/yaml - -trigger: -- main - -pool: - vmImage: ubuntu-latest - -steps: -- task: Docker@2 - inputs: - containerRegistry: 'Docker Hub' - repository: 'mayaaiuga/test-run-image' - command: 'buildAndPush' - Dockerfile: '**/Dockerfile' - tags: 'latest' -- task: KubernetesManifest@1 - inputs: - action: 'deploy' - connectionType: 'azureResourceManager' - azureSubscriptionConnection: 'aks-service-connection' - azureResourceGroup: 'aks-rg' - kubernetesCluster: 'aks-demo' - manifests: 'deployment.yaml' \ No newline at end of file diff --git a/aks-terraform/azure-pipelines.yml b/aks-terraform/azure-pipelines.yml deleted file mode 100644 index 219d96f5..00000000 --- a/aks-terraform/azure-pipelines.yml +++ /dev/null @@ -1,28 +0,0 @@ -# Starter pipeline -# Start with a minimal pipeline that you can customize to build and deploy your code. -# Add steps that build, run tests, deploy, and more: -# https://aka.ms/yaml - -trigger: -- main - -pool: - vmImage: ubuntu-latest - -steps: -- task: Docker@2 - inputs: - containerRegistry: 'Docker Hub' - repository: 'mayaaiuga/devops-web-app' - command: 'buildAndPush' - Dockerfile: '**/Dockerfile' - tags: 'latest' - -- task: KubernetesManifest@1 - inputs: - action: 'deploy' - connectionType: 'azureResourceManager' - azureSubscriptionConnection: 'aks-service-connection' - azureResourceGroup: 'aks-rg' - kubernetesCluster: 'aks-demo' - manifests: 'deployment.yaml' \ No newline at end of file diff --git a/aks-terraform/deployment.yaml b/aks-terraform/deployment.yaml deleted file mode 100644 index a332a61c..00000000 --- a/aks-terraform/deployment.yaml +++ /dev/null @@ -1,40 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: flask-app-deployment -spec: - replicas: 2 # Adjust the number of replicas as needed - selector: - matchLabels: - app: flask-app - template: - metadata: - labels: - app: flask-app - spec: - containers: - - name: flask-app-container - image: mayaaiuga/test-run-image:latest - ports: - - containerPort: 5000 # Expose the same port specified in your Dockerfile - strategy: - type: RollingUpdate - rollingUpdate: - maxSurge: 1 - maxUnavailable: 0 - ---- -apiVersion: v1 -kind: Service -metadata: - name: flask-app-services -spec: - selector: - app: flask-app - ports: - - protocol: TCP - port: 80 # Port for internal communication within the cluster - targetPort: 5000 # Port exposed by your container - type: ClusterIP # Internal service - - diff --git a/aks-terraform/requirements.txt b/aks-terraform/requirements.txt deleted file mode 100644 index 47ec762e..00000000 --- a/aks-terraform/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -flask==2.2.2 -pyodbc==4.0.39 -SQLAlchemy==2.0.21 -werkzeug===2.2.3 \ No newline at end of file diff --git a/aks-terraform/static/script.js b/aks-terraform/static/script.js deleted file mode 100644 index 2d0ef9e4..00000000 --- a/aks-terraform/static/script.js +++ /dev/null @@ -1,49 +0,0 @@ -document.addEventListener("DOMContentLoaded", function() { - const paginationLinks = document.querySelectorAll(".pagination-link"); - const orderTable = document.querySelector(".order-table"); - const btnOrders = document.getElementById("btn-orders"); - const btnAddOrder = document.getElementById("btn-add-order"); - const orderListContent = document.getElementById("order-list-content"); - const addOrderContent = document.getElementById("add-order-content"); - - // Pagination click event - paginationLinks.forEach(link => { - link.addEventListener("click", function(event) { - event.preventDefault(); - - const nextPageURL = this.getAttribute("href"); - - // Send AJAX request to fetch next page data - fetch(nextPageURL) - .then(response => response.text()) - .then(data => { - // Update table and pagination controls - const newHTML = new DOMParser().parseFromString(data, "text/html"); - const newTable = newHTML.querySelector(".order-table"); - const newPagination = newHTML.querySelector(".pagination"); - - orderTable.innerHTML = newTable.innerHTML; - const paginationDiv = document.querySelector(".pagination"); - paginationDiv.innerHTML = newPagination.innerHTML; - - // Scroll to the top of the table - window.scrollTo({ top: orderTable.offsetTop, behavior: "smooth" }); - }) - .catch(error => { - console.error("Error fetching data:", error); - }); - }); - }); - - // Tab buttons click events - btnOrders.addEventListener("click", function() { - orderListContent.style.display = "block"; - addOrderContent.style.display = "none"; - }); - - btnAddOrder.addEventListener("click", function() { - orderListContent.style.display = "none"; - addOrderContent.style.display = "block"; - }); -}); - diff --git a/aks-terraform/static/style.css b/aks-terraform/static/style.css deleted file mode 100644 index 2ded36be..00000000 --- a/aks-terraform/static/style.css +++ /dev/null @@ -1,174 +0,0 @@ -body { - font-family: Arial, sans-serif; - margin: 0; - padding: 0; - background-color: #f0f0f0; -} - -h1 { - color: #333; -} - -ul { - list-style-type: none; - padding: 0; -} - -li { - margin-bottom: 20px; - padding: 10px; - background-color: #fff; - border-radius: 5px; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); -} - -form { - margin-top: 20px; - padding: 20px; - background-color: #fff; - border-radius: 5px; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); -} - -label { - display: block; - margin-bottom: 5px; -} - -input { - width: 100%; - padding: 10px; - margin-bottom: 10px; - border: 1px solid #ccc; - border-radius: 5px; - box-sizing: border-box; -} - -input[type="submit"] { - background-color: #007bff; - color: #fff; - cursor: pointer; -} - -/* Add border and spacing to the table */ -.order-table { - border-collapse: collapse; - width: 100%; - margin-bottom: 20px; -} - -/* Style table header cells */ -.order-table th { - background-color: #f2f2f2; - border: 1px solid #dddddd; - text-align: left; - padding: 8px; -} - -/* Style table data cells */ -.order-table td { - border: 1px solid #dddddd; - text-align: left; - padding: 8px; -} - -/* Alternate row background color */ -.order-table tbody tr:nth-child(even) { - background-color: #f2f2f2; -} - -/* Hover effect on rows */ -.order-table tbody tr:hover { - background-color: #ddd; -} - -/* Position pagination controls at bottom right */ -.pagination { - display: flex; - justify-content: flex-end; - align-items: center; - margin-top: 20px; -} - -/* Style pagination links */ -.pagination-link { - padding: 5px 10px; - background-color: #007bff; - color: #fff; - text-decoration: none; - border-radius: 3px; - margin: 0 5px; -} - -/* Style current page indicator */ -.pagination span { - margin: 0 10px; -} - -/* Additional styling for tabs and tab content */ -.tab-container { - display: flex; - flex-direction: column; - align-items: center; - margin-top: 20px; -} - -.tab { - display: none; -} - -.tab-content { - margin-top: 20px; -} - -#tab-orders:checked ~ .tab-content:nth-child(1), -#tab-add-order:checked ~ .tab-content:nth-child(2) { - display: block; -} - -.tab-buttons { - display: flex; - justify-content: center; - margin-top: 20px; -} - -.tab-label { - margin: 0 10px; - padding: 10px 20px; - border: 2px solid #007bff; - border-radius: 5px; - cursor: pointer; - transition: background-color 0.3s ease, color 0.3s ease; - color: #fff; /* Set default text color to white */ - background-color: #007bff; /* Set default background color to blue */ -} - -.tab-label:hover { - background-color: #fff; /* Change background to white on hover */ - color: #007bff; /* Change text color to blue on hover */ -} - -.tab-label:checked { - background-color: #fff; /* Change background to white when checked */ - color: #007bff; /* Change text color to blue when checked */ -} - -.header { - text-align: center; - margin-top: 20px; -} - -.header h1 { - color: #007bff; - font-size: 24px; -} - -.tab-title { - text-align: left; - color: #007bff; - margin-top: 20px; - margin-bottom: 10px; -} - - - diff --git a/aks-terraform/templates/orders.html b/aks-terraform/templates/orders.html deleted file mode 100644 index 5277dcb6..00000000 --- a/aks-terraform/templates/orders.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - Order Management - - - -
-

Fictional Company Name

-
-
- - -
- -
-
-

Order List

- - - - - - - - - - - - - - - - - {% for order in orders %} - - - - - - - - - - - - {% endfor %} - -
Date UUIDUser IDCard NumberStore CodeProduct CodeProduct QuantityOrder DateShipping DateDelivery Date
{{ order.date_uuid }}{{ order.user_id }}{{ order.card_number }}{{ order.store_code }}{{ order.product_code }}{{ order.product_quantity }}{{ order.order_date }}{{ order.shipping_date }}{{ order.delivery_date }}
- -
- -
- - - From cbd147a8ca258d4fc31ba7011d8bd85f4346e389 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji Date: Tue, 16 Jan 2024 19:12:12 +0000 Subject: [PATCH 05/47] Add .DS_Store to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..e43b0f98 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store From b705f619711de8e82c669901231f9ae62c5e7e91 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji <73576282+chyjuls@users.noreply.github.com> Date: Tue, 16 Jan 2024 20:26:23 +0000 Subject: [PATCH 06/47] Update README.md Updated the READMEW --- README.md | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/README.md b/README.md index 08407749..02e69d0a 100644 --- a/README.md +++ b/README.md @@ -53,9 +53,67 @@ To run the application, you simply need to run the `app.py` script in this repos - **Database:** The application employs an Azure SQL Database as its database system to store order-related data. + +## Terraform Project Documentation + +**Overview** + +Terraform by HashiCorp is an Infrastructure as Code (IaC) tool used for building, changing, and versioning infrastructure safely and efficiently. It supports various cloud providers like Azure, AWS, and Google Cloud. Terraform uses declarative configuration files that describe the desired state of your infrastructure. + +**Key Concepts** + +Infrastructure as Code (IaC): Manage infrastructure using configuration files rather than through manual processes. + +Providers: Plugins that interact with APIs of cloud providers, services, or other tools (e.g., Azure, AWS). +Resources: Components of your infrastructure such as virtual networks, compute instances, or higher-level components like DNS records. +Modules: Reusable, encapsulated Terraform configurations for creating sets of resources that are used together. +State: Terraform records information about what infrastructure is created in a state file, allowing for consistent management of resources. +Terraform Workflow +Initialize: + +Run terraform init in your project directory. +This command sets up Terraform's working directory, downloads providers, and prepares the backend for state storage. +Writing Configuration: + +Define your infrastructure in configuration files (.tf). +Resources, variables, outputs, and provider configurations are declared here. +Planning: + +Execute terraform plan. +Terraform reads configuration files and creates an execution plan, detailing what actions it will perform to reach the desired state. +Applying: + +Run terraform apply. +Terraform will execute the plan to create, update, or delete resources as per the configuration. +Maintaining State: + +Terraform maintains a state file to map resources to the configuration and keep track of metadata. +The state file is critical for Terraform to function correctly and should be handled with care. +Modifying Infrastructure: + +Update configuration files as needed. +Rerun terraform plan and terraform apply to implement changes. +Destroying Infrastructure: + +To remove all resources managed by Terraform, use terraform destroy. + +**Best Practices** + +Version Control: Keep your Terraform configurations in a version control system (like Git). +Modularization: Use modules to organize and reuse code. +Secrets Management: Avoid hardcoding sensitive information. Use environment variables or secret management tools. +Review Plans: Carefully review execution plans before applying changes. + + + + + + + ## Contributors - [Maya Iuga]([https://github.com/yourusername](https://github.com/maya-a-iuga)) +- C.Ugorji (AI core DevOps Student) ## License From 19868222a68939f81828cb6e5cab24c8ccf9e241 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji <73576282+chyjuls@users.noreply.github.com> Date: Tue, 16 Jan 2024 20:35:32 +0000 Subject: [PATCH 07/47] Update README.md --- README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/README.md b/README.md index 02e69d0a..1dd35e1c 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ To run the application, you simply need to run the `app.py` script in this repos - **Database:** The application employs an Azure SQL Database as its database system to store order-related data. + ## Terraform Project Documentation @@ -105,6 +106,57 @@ Secrets Management: Avoid hardcoding sensitive information. Use environment vari Review Plans: Carefully review execution plans before applying changes. +## AKS Cluster Provisioning with Terraform + +**Overview** + +This project automates the deployment of an Azure Kubernetes Service (AKS) cluster using Terraform, an Infrastructure as Code tool. The project is structured into modules, with specific focus on the aks-cluster-module for creating and managing the AKS cluster. + +**Prerequisites** + +Azure account and Azure CLI installed and configured +Terraform v0.12+ installed + +**Module Structure** + +aks-cluster-module: Contains Terraform configurations to set up the AKS cluster in Azure. +Usage + +**Step 1: Initialize the Module** + +Navigate to the aks-cluster-module directory and run the initialization command: + +cd modules/aks-cluster-module +terraform init + +**Step 2: Configuration** + +Edit the variables.tf file to configure the desired settings for your AKS cluster. + +**Step 3: Apply the Configuration** + +Run the following commands to apply the configuration: + +terraform plan +terraform apply + +### Inputs and Outputs + +**Input Variables** + +aks_cluster_name: Name of the AKS cluster. +cluster_location: Azure region where the AKS cluster will be deployed. +dns_prefix: DNS prefix for the AKS cluster. +kubernetes_version: Version of Kubernetes for the AKS cluster. +service_principal_client_id: Client ID for the service principal. +service_principal_secret: Client Secret for the service principal. +Additional networking-related variables. + +**Output Variables** + +aks_cluster_name: The name of the provisioned AKS cluster. +aks_cluster_id: The ID of the provisioned AKS cluster. +aks_kubeconfig: Kubernetes configuration file for the AKS cluster. From 21842aa22abe9f0a5bb90eacd43fee8f050bcf11 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji Date: Tue, 16 Jan 2024 20:38:35 +0000 Subject: [PATCH 08/47] Updates the terraform project folder with aks-cluster-module directory --- .../aks-cluster-module/.terraform.lock.hcl | 21 ++++++++ .../modules/aks-cluster-module/main.tf | 28 ++++++++++ .../modules/aks-cluster-module/outputs.tf | 15 ++++++ .../modules/aks-cluster-module/variables.tf | 54 +++++++++++++++++++ .../modules/networking-module/outputs.tf | 2 +- 5 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 aks-terraform/modules/aks-cluster-module/.terraform.lock.hcl create mode 100644 aks-terraform/modules/aks-cluster-module/main.tf create mode 100644 aks-terraform/modules/aks-cluster-module/outputs.tf create mode 100644 aks-terraform/modules/aks-cluster-module/variables.tf diff --git a/aks-terraform/modules/aks-cluster-module/.terraform.lock.hcl b/aks-terraform/modules/aks-cluster-module/.terraform.lock.hcl new file mode 100644 index 00000000..39f75cb6 --- /dev/null +++ b/aks-terraform/modules/aks-cluster-module/.terraform.lock.hcl @@ -0,0 +1,21 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/hashicorp/azurerm" { + version = "3.87.0" + hashes = [ + "h1:PfnDrSQo5bwN6KV1nVj+5MHnNxeD3bglvFahgJctQHY=", + "zh:1547ed020fa6ca25d940b28601442c7e4495fdea9fb1ead7affb867383f5f40b", + "zh:325e6d636b5ab09a24837194647617c9fabd42f0fb2c7e18ae8d2a8b2d890a55", + "zh:3abb0074de1dc3b723f8c209354ba93e717ba52003847484b19369e8f54735f4", + "zh:52d2b1700108d5093113a986aa10757834e48083c1358a2c7d8d0360e2689390", + "zh:5fe377d5cc80e26766ff411dbcb227728709fe34b14ad106c9e374df653086a4", + "zh:747fe80de4fb88b17cac93ff05d62909d3563325c8ed5a461641b48579c328f8", + "zh:b40142e4041b7f000ab2dda58309755395a4018d5d00218f6a601f737389865a", + "zh:bca622818c221cec81d636879e376c15696a8d091703298195d728b3c1eae7db", + "zh:bfaecd203137ff9eb3228b1cbd3191e1d84d7c019855eb5f3071bbf6eb060a51", + "zh:d197f04b54f2be07f827ced220954d723039c84793a4ce91894b622982c25811", + "zh:e831601ea1f67c5e745946ed3ac0cac772ed8e95ca7d7314d3f0ed631e6eefb1", + "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", + ] +} diff --git a/aks-terraform/modules/aks-cluster-module/main.tf b/aks-terraform/modules/aks-cluster-module/main.tf new file mode 100644 index 00000000..6ae8c8cc --- /dev/null +++ b/aks-terraform/modules/aks-cluster-module/main.tf @@ -0,0 +1,28 @@ +resource "azurerm_kubernetes_cluster" "aks_cluster" { + name = var.aks_cluster_name + location = var.cluster_location + resource_group_name = var.networking_resource_group_name # Reference the variable here + dns_prefix = var.dns_prefix + kubernetes_version = var.kubernetes_version + + default_node_pool { + name = "default" + node_count = 1 + vm_size = "Standard_DS2_v2" + } + + service_principal { + client_id = var.service_principal_client_id + client_secret = var.service_principal_secret + } + + network_profile { + network_plugin = "azure" + network_policy = "calico" + } + + tags = { + Environment = "Development" + } +} + diff --git a/aks-terraform/modules/aks-cluster-module/outputs.tf b/aks-terraform/modules/aks-cluster-module/outputs.tf new file mode 100644 index 00000000..a34d9686 --- /dev/null +++ b/aks-terraform/modules/aks-cluster-module/outputs.tf @@ -0,0 +1,15 @@ +output "aks_cluster_name" { + value = azurerm_kubernetes_cluster.aks_cluster.name + description = "The name of the provisioned AKS cluster." +} + +output "aks_cluster_id" { + value = azurerm_kubernetes_cluster.aks_cluster.id + description = "The ID of the provisioned AKS cluster." +} + +output "aks_kubeconfig" { + value = azurerm_kubernetes_cluster.aks_cluster.kube_config_raw + description = "The Kubernetes configuration file for managing the AKS cluster with kubectl." +} + diff --git a/aks-terraform/modules/aks-cluster-module/variables.tf b/aks-terraform/modules/aks-cluster-module/variables.tf new file mode 100644 index 00000000..b7182952 --- /dev/null +++ b/aks-terraform/modules/aks-cluster-module/variables.tf @@ -0,0 +1,54 @@ +variable "aks_cluster_name" { + type = string + description = "The name of the AKS cluster." +} + +variable "cluster_location" { + type = string + description = "The Azure region where the AKS cluster will be deployed." +} + +variable "dns_prefix" { + type = string + description = "The DNS prefix for the AKS cluster." +} + +variable "kubernetes_version" { + type = string + description = "The specific version of Kubernetes to use for the AKS cluster." +} + +variable "service_principal_client_id" { + type = string + description = "The Client ID for the service principal associated with the AKS cluster." +} + +variable "service_principal_secret" { + type = string + description = "The Client Secret for the service principal associated with the AKS cluster." +} + +# Variables from networking module +variable "resource_group_name" { + type = string + description = "The name of the Azure Resource Group for networking resources." +} + +variable "vnet_id" { + type = string + description = "The ID of the Virtual Network where the AKS cluster is deployed." +} + +variable "control_plane_subnet_id" { + type = string + description = "The ID of the subnet for the AKS cluster control plane." +} + +variable "worker_node_subnet_id" { + type = string + description = "The ID of the subnet for the AKS cluster worker nodes." +} + + + + diff --git a/aks-terraform/modules/networking-module/outputs.tf b/aks-terraform/modules/networking-module/outputs.tf index 99a42897..1d9fd79c 100644 --- a/aks-terraform/modules/networking-module/outputs.tf +++ b/aks-terraform/modules/networking-module/outputs.tf @@ -13,7 +13,7 @@ output "worker_node_subnet_id" { description = "The ID of the worker node subnet within the VNet." } -output "networking_resource_group_name" { +output "resource_group_name" { value = azurerm_resource_group.aks_rg.name description = "The name of the Azure Resource Group where the networking resources were provisioned." } From 2734c931c9c8a8c069d89b101d3a669fb1b892e5 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji Date: Wed, 17 Jan 2024 01:57:06 +0000 Subject: [PATCH 09/47] Terraform project updated, app now provisioned on aks --- .gitignore | 0 aks-terraform/.terraform.lock.hcl | 21 ++ aks-terraform/main.tf | 46 ++++ .../modules/aks-cluster-module/main.tf | 6 +- .../modules/aks-cluster-module/outputs.tf | 2 +- .../modules/aks-cluster-module/variables.tf | 4 +- aks-terraform/terraform.tfstate.backup | 240 ++++++++++++++++++ aks-terraform/variables.tf | 18 ++ 8 files changed, 331 insertions(+), 6 deletions(-) create mode 100644 .gitignore create mode 100644 aks-terraform/.terraform.lock.hcl create mode 100644 aks-terraform/main.tf create mode 100644 aks-terraform/terraform.tfstate.backup create mode 100644 aks-terraform/variables.tf diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/aks-terraform/.terraform.lock.hcl b/aks-terraform/.terraform.lock.hcl new file mode 100644 index 00000000..3124ba0a --- /dev/null +++ b/aks-terraform/.terraform.lock.hcl @@ -0,0 +1,21 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/hashicorp/azurerm" { + version = "2.99.0" + constraints = "~> 2.0" + hashes = [ + "h1:/M8yLHqv0uOm9IbHRa4yZvQORr9ir1QyJyIyjGs4ryQ=", + "zh:08d81e72e97351538ab4d15548942217bf0c4d3b79ad3f4c95d8f07f902d2fa6", + "zh:11fdfa4f42d6b6f01371f336fea56f28a1db9e7b490c5ca0b352f6bbca5a27f1", + "zh:12376e2c4b56b76098d5d713d1a4e07e748a926c4d165f0bd6f52157b1f7a7e9", + "zh:31f1cb5b88ed1307625050e3ee7dd9948773f522a3f3bf179195d607de843ea3", + "zh:767971161405d38412662a73ea40a422125cdc214c72fbc569bcfbea6e66c366", + "zh:973c402c3728b68c980ea537319b703c009b902a981b0067fbc64e04a90e434c", + "zh:9ec62a4f82ec1e92bceeff80dd8783f61de0a94665c133f7c7a7a68bda9cdbd6", + "zh:bbb3b7e1229c531c4634338e4fc81b28bce58312eb843a931a4420abe42d5b7e", + "zh:cbbe02cd410d21476b3a081b5fa74b4f1b3d9d79b00214009028d60e859c19a3", + "zh:cc00ecc7617a55543b60a0da1196ea92df48c399bcadbedf04c783e3d47c6e08", + "zh:eecb9fd0e7509c7fd4763e546ef0933f125770cbab2b46152416e23d5ec9dd53", + ] +} diff --git a/aks-terraform/main.tf b/aks-terraform/main.tf new file mode 100644 index 00000000..46e5e087 --- /dev/null +++ b/aks-terraform/main.tf @@ -0,0 +1,46 @@ +terraform { + required_providers { + azurerm = { + source = "hashicorp/azurerm" + version = "~> 2.0" + } + } +} + + + + +provider "azurerm" { + features {} + + client_id = var.client_id + client_secret = var.client_secret + subscription_id = var.subscription_id + tenant_id = var.tenant_id +} + +module "networking" { + source = "./modules/networking-module" + + resource_group_name = "networking-resource-group" + location = "UK South" + vnet_address_space = ["10.0.0.0/16"] +} + +module "aks_cluster" { + source = "./modules/aks-cluster-module" # Update this path to your AKS cluster module + + cluster_name = "terraform-aks-cluster" + location = "UK South" + dns_prefix = "myaks-project" + kubernetes_version = "1.26.6" + service_principal_client_id = var.client_id + service_principal_secret = var.client_secret + + resource_group_name = module.networking.resource_group_name + vnet_id = module.networking.vnet_id + control_plane_subnet_id = module.networking.control_plane_subnet_id + worker_node_subnet_id = module.networking.worker_node_subnet_id + +} + diff --git a/aks-terraform/modules/aks-cluster-module/main.tf b/aks-terraform/modules/aks-cluster-module/main.tf index 6ae8c8cc..ce0143d3 100644 --- a/aks-terraform/modules/aks-cluster-module/main.tf +++ b/aks-terraform/modules/aks-cluster-module/main.tf @@ -1,7 +1,7 @@ resource "azurerm_kubernetes_cluster" "aks_cluster" { - name = var.aks_cluster_name - location = var.cluster_location - resource_group_name = var.networking_resource_group_name # Reference the variable here + name = var.cluster_name + location = var.location + resource_group_name = var.resource_group_name # Reference the variable here dns_prefix = var.dns_prefix kubernetes_version = var.kubernetes_version diff --git a/aks-terraform/modules/aks-cluster-module/outputs.tf b/aks-terraform/modules/aks-cluster-module/outputs.tf index a34d9686..7b01afff 100644 --- a/aks-terraform/modules/aks-cluster-module/outputs.tf +++ b/aks-terraform/modules/aks-cluster-module/outputs.tf @@ -1,4 +1,4 @@ -output "aks_cluster_name" { +output "cluster_name" { value = azurerm_kubernetes_cluster.aks_cluster.name description = "The name of the provisioned AKS cluster." } diff --git a/aks-terraform/modules/aks-cluster-module/variables.tf b/aks-terraform/modules/aks-cluster-module/variables.tf index b7182952..5497e311 100644 --- a/aks-terraform/modules/aks-cluster-module/variables.tf +++ b/aks-terraform/modules/aks-cluster-module/variables.tf @@ -1,9 +1,9 @@ -variable "aks_cluster_name" { +variable "cluster_name" { type = string description = "The name of the AKS cluster." } -variable "cluster_location" { +variable "location" { type = string description = "The Azure region where the AKS cluster will be deployed." } diff --git a/aks-terraform/terraform.tfstate.backup b/aks-terraform/terraform.tfstate.backup new file mode 100644 index 00000000..560c4751 --- /dev/null +++ b/aks-terraform/terraform.tfstate.backup @@ -0,0 +1,240 @@ +{ + "version": 4, + "terraform_version": "1.6.6", + "serial": 10, + "lineage": "9fa196a3-ac0b-6f73-b86d-6aea533f1be0", + "outputs": {}, + "resources": [ + { + "module": "module.networking", + "mode": "managed", + "type": "azurerm_network_security_group", + "name": "aks_nsg", + "provider": "provider[\"registry.terraform.io/hashicorp/azurerm\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "id": "/subscriptions/9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f/resourceGroups/networking-resource-group/providers/Microsoft.Network/networkSecurityGroups/aks-nsg", + "location": "uksouth", + "name": "aks-nsg", + "resource_group_name": "networking-resource-group", + "security_rule": [], + "tags": null, + "timeouts": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInJlYWQiOjMwMDAwMDAwMDAwMCwidXBkYXRlIjoxODAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "module.networking.azurerm_resource_group.aks_rg" + ] + } + ] + }, + { + "module": "module.networking", + "mode": "managed", + "type": "azurerm_network_security_rule", + "name": "kube_apiserver_rule", + "provider": "provider[\"registry.terraform.io/hashicorp/azurerm\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "access": "Allow", + "description": "", + "destination_address_prefix": "*", + "destination_address_prefixes": null, + "destination_application_security_group_ids": null, + "destination_port_range": "443", + "destination_port_ranges": null, + "direction": "Inbound", + "id": "/subscriptions/9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f/resourceGroups/networking-resource-group/providers/Microsoft.Network/networkSecurityGroups/aks-nsg/securityRules/kube-apiserver-rule", + "name": "kube-apiserver-rule", + "network_security_group_name": "aks-nsg", + "priority": 100, + "protocol": "Tcp", + "resource_group_name": "networking-resource-group", + "source_address_prefix": "0.0.0.0/0", + "source_address_prefixes": null, + "source_application_security_group_ids": null, + "source_port_range": "*", + "source_port_ranges": null, + "timeouts": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInJlYWQiOjMwMDAwMDAwMDAwMCwidXBkYXRlIjoxODAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "module.networking.azurerm_network_security_group.aks_nsg", + "module.networking.azurerm_resource_group.aks_rg" + ] + } + ] + }, + { + "module": "module.networking", + "mode": "managed", + "type": "azurerm_network_security_rule", + "name": "ssh_rule", + "provider": "provider[\"registry.terraform.io/hashicorp/azurerm\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "access": "Allow", + "description": "", + "destination_address_prefix": "*", + "destination_address_prefixes": null, + "destination_application_security_group_ids": null, + "destination_port_range": "22", + "destination_port_ranges": null, + "direction": "Inbound", + "id": "/subscriptions/9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f/resourceGroups/networking-resource-group/providers/Microsoft.Network/networkSecurityGroups/aks-nsg/securityRules/ssh-rule", + "name": "ssh-rule", + "network_security_group_name": "aks-nsg", + "priority": 101, + "protocol": "Tcp", + "resource_group_name": "networking-resource-group", + "source_address_prefix": "0.0.0.0/0", + "source_address_prefixes": null, + "source_application_security_group_ids": null, + "source_port_range": "*", + "source_port_ranges": null, + "timeouts": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInJlYWQiOjMwMDAwMDAwMDAwMCwidXBkYXRlIjoxODAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "module.networking.azurerm_network_security_group.aks_nsg", + "module.networking.azurerm_resource_group.aks_rg" + ] + } + ] + }, + { + "module": "module.networking", + "mode": "managed", + "type": "azurerm_resource_group", + "name": "aks_rg", + "provider": "provider[\"registry.terraform.io/hashicorp/azurerm\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "id": "/subscriptions/9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f/resourceGroups/networking-resource-group", + "location": "uksouth", + "name": "networking-resource-group", + "tags": null, + "timeouts": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo1NDAwMDAwMDAwMDAwLCJkZWxldGUiOjU0MDAwMDAwMDAwMDAsInJlYWQiOjMwMDAwMDAwMDAwMCwidXBkYXRlIjo1NDAwMDAwMDAwMDAwfX0=" + } + ] + }, + { + "module": "module.networking", + "mode": "managed", + "type": "azurerm_subnet", + "name": "control_plane_subnet", + "provider": "provider[\"registry.terraform.io/hashicorp/azurerm\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "address_prefix": "10.0.1.0/24", + "address_prefixes": [ + "10.0.1.0/24" + ], + "delegation": [], + "enforce_private_link_endpoint_network_policies": false, + "enforce_private_link_service_network_policies": false, + "id": "/subscriptions/9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f/resourceGroups/networking-resource-group/providers/Microsoft.Network/virtualNetworks/aks-vnet/subnets/control-plane-subnet", + "name": "control-plane-subnet", + "resource_group_name": "networking-resource-group", + "service_endpoint_policy_ids": null, + "service_endpoints": null, + "timeouts": null, + "virtual_network_name": "aks-vnet" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInJlYWQiOjMwMDAwMDAwMDAwMCwidXBkYXRlIjoxODAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "module.networking.azurerm_resource_group.aks_rg", + "module.networking.azurerm_virtual_network.aks_vnet" + ] + } + ] + }, + { + "module": "module.networking", + "mode": "managed", + "type": "azurerm_subnet", + "name": "worker_node_subnet", + "provider": "provider[\"registry.terraform.io/hashicorp/azurerm\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "address_prefix": "10.0.2.0/24", + "address_prefixes": [ + "10.0.2.0/24" + ], + "delegation": [], + "enforce_private_link_endpoint_network_policies": false, + "enforce_private_link_service_network_policies": false, + "id": "/subscriptions/9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f/resourceGroups/networking-resource-group/providers/Microsoft.Network/virtualNetworks/aks-vnet/subnets/worker-node-subnet", + "name": "worker-node-subnet", + "resource_group_name": "networking-resource-group", + "service_endpoint_policy_ids": null, + "service_endpoints": null, + "timeouts": null, + "virtual_network_name": "aks-vnet" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInJlYWQiOjMwMDAwMDAwMDAwMCwidXBkYXRlIjoxODAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "module.networking.azurerm_resource_group.aks_rg", + "module.networking.azurerm_virtual_network.aks_vnet" + ] + } + ] + }, + { + "module": "module.networking", + "mode": "managed", + "type": "azurerm_virtual_network", + "name": "aks_vnet", + "provider": "provider[\"registry.terraform.io/hashicorp/azurerm\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "address_space": [ + "10.0.0.0/16" + ], + "bgp_community": "", + "ddos_protection_plan": [], + "dns_servers": [], + "flow_timeout_in_minutes": 0, + "guid": "029f0d3a-d7e7-43d5-b310-6157890d507a", + "id": "/subscriptions/9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f/resourceGroups/networking-resource-group/providers/Microsoft.Network/virtualNetworks/aks-vnet", + "location": "uksouth", + "name": "aks-vnet", + "resource_group_name": "networking-resource-group", + "subnet": [], + "tags": null, + "timeouts": null, + "vm_protection_enabled": false + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInJlYWQiOjMwMDAwMDAwMDAwMCwidXBkYXRlIjoxODAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "module.networking.azurerm_resource_group.aks_rg" + ] + } + ] + } + ], + "check_results": null +} diff --git a/aks-terraform/variables.tf b/aks-terraform/variables.tf new file mode 100644 index 00000000..36054580 --- /dev/null +++ b/aks-terraform/variables.tf @@ -0,0 +1,18 @@ +variable "client_id" { + description = "The Client ID for the Azure Service Principal" +} + +variable "client_secret" { + description = "The Client Secret for the Azure Service Principal" +} + + + +variable "subscription_id" { + description = "The Azure Subscription ID" + +} +variable "tenant_id" { + description = " The tenant ID for the Azure Service Principal" + +} From 00f3f8060568584bd877e9e463294f38fa270aef Mon Sep 17 00:00:00 2001 From: Chichi Ugorji <73576282+chyjuls@users.noreply.github.com> Date: Wed, 17 Jan 2024 02:04:29 +0000 Subject: [PATCH 10/47] Update README.md Updates README with aks cluster provisioning documentation --- README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/README.md b/README.md index 1dd35e1c..aae53917 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,41 @@ aks_cluster_id: The ID of the provisioned AKS cluster. aks_kubeconfig: Kubernetes configuration file for the AKS cluster. +# Infrastructure Provisioning with Terraform + +**Overview** + +This project utilizes Terraform for the automated provisioning of infrastructure in Azure, specifically focusing on setting up an Azure Kubernetes Service (AKS) cluster and associated networking resources. + +**Infrastructure Components** + +Azure Resource Group: Serves as a logical container for grouping related resources. +Virtual Network (VNet): Provides networking for AKS, including control plane and worker node subnets. +Subnets: Two subnets, one for the control plane and one for the worker nodes. +Network Security Group (NSG): Manages network security rules for secure access to the AKS cluster. +AKS Cluster: The central Kubernetes cluster managed by Azure. +Setup and Configuration +Terraform is used to define and manage the above resources. +The configuration is divided into modules for better organization and reusability. +Variables are used to ensure configurability and flexibility of the setup. +Troubleshooting Steps Undertaken +Throughout the setup, several issues were encountered and resolved: + +Service Principal Authentication: Initially faced issues with Azure Service Principal permissions. Resolved by assigning the appropriate roles to the Service Principal. + +Resource Provider Registration: Encountered a MissingSubscriptionRegistration error. This was fixed by manually registering the Microsoft.ContainerService provider with the Azure subscription. + +Permission Issues for Resource Group Creation: Faced AuthorizationFailed errors when attempting to create resource groups. This was resolved by ensuring the Service Principal had sufficient permissions. + +Namespace Registration: Addressed errors related to the subscription not being registered to use certain Azure services (namespaces). + +**Commands Used** + +terraform init: To initialize the Terraform environment. +terraform plan: To preview the changes before applying. +terraform apply: To apply the changes and provision the infrastructure. +Conclusion +The project demonstrates the power of Infrastructure as Code (IaC) using Terraform, showcasing how complex infrastructure can be provisioned, managed, and troubleshooted systematically. From eaf1308b31ac16e1a26b989dc6ad058d0437523b Mon Sep 17 00:00:00 2001 From: Chichi Ugorji Date: Thu, 18 Jan 2024 23:31:36 +0000 Subject: [PATCH 11/47] Updates app deployment with AKS --- aks-terraform/.DS_Store | Bin 6148 -> 6148 bytes aks-terraform/application-manifest.yaml | 40 ++++ aks-terraform/terraform.tfstate.backup | 247 +++++++++++++++++++++--- 3 files changed, 265 insertions(+), 22 deletions(-) create mode 100644 aks-terraform/application-manifest.yaml diff --git a/aks-terraform/.DS_Store b/aks-terraform/.DS_Store index 85511bd6f87a7f59da1843f17c32efb95794f22a..91830f70ccb7e2d0e346d414b60a8c9dbb99d02f 100644 GIT binary patch delta 103 zcmZoMXfc=|&e%S&P;8=}q9_vs0|O%ig8&0V5kn$F8bdyi&YieXeX@ZFiyRk&9zzL3 wDo_YXGNm{?m@Wd13<#0NgwpAOHXW delta 74 zcmZoMXfc=|&e%4wP;8=}q9`K+0|O8XFfimWq%stz6es5-&2a227 bIRrQu+csYO&ODi4M3)t$;lO5Fk;BXY;&&9C diff --git a/aks-terraform/application-manifest.yaml b/aks-terraform/application-manifest.yaml new file mode 100644 index 00000000..b2f531b5 --- /dev/null +++ b/aks-terraform/application-manifest.yaml @@ -0,0 +1,40 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: flask-app-deployment +spec: + replicas: 2 + selector: + matchLabels: + app: flask-app + template: + metadata: + labels: + app: flask-app + spec: + containers: + - name: flask-app + image: chyjuls/web-delivery:v1 + ports: + - containerPort: 5000 + strategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 1 + maxSurge: 1 + +--- + +apiVersion: v1 +kind: Service +metadata: + name: flask-app-service +spec: + selector: + app: flask-app + ports: + - protocol: TCP + port: 80 + targetPort: 5000 + type: ClusterIP + diff --git a/aks-terraform/terraform.tfstate.backup b/aks-terraform/terraform.tfstate.backup index 560c4751..172f83dc 100644 --- a/aks-terraform/terraform.tfstate.backup +++ b/aks-terraform/terraform.tfstate.backup @@ -1,10 +1,163 @@ { "version": 4, "terraform_version": "1.6.6", - "serial": 10, + "serial": 12, "lineage": "9fa196a3-ac0b-6f73-b86d-6aea533f1be0", "outputs": {}, "resources": [ + { + "module": "module.aks_cluster", + "mode": "managed", + "type": "azurerm_kubernetes_cluster", + "name": "aks_cluster", + "provider": "provider[\"registry.terraform.io/hashicorp/azurerm\"]", + "instances": [ + { + "schema_version": 2, + "attributes": { + "aci_connector_linux": [], + "addon_profile": [], + "api_server_authorized_ip_ranges": null, + "auto_scaler_profile": [], + "automatic_channel_upgrade": "", + "azure_active_directory_role_based_access_control": [], + "azure_policy_enabled": false, + "default_node_pool": [ + { + "availability_zones": null, + "enable_auto_scaling": false, + "enable_host_encryption": false, + "enable_node_public_ip": false, + "fips_enabled": false, + "kubelet_config": [], + "kubelet_disk_type": "OS", + "linux_os_config": [], + "max_count": 0, + "max_pods": 30, + "min_count": 0, + "name": "default", + "node_count": 1, + "node_labels": {}, + "node_public_ip_prefix_id": "", + "node_taints": null, + "only_critical_addons_enabled": false, + "orchestrator_version": "1.26.6", + "os_disk_size_gb": 128, + "os_disk_type": "Managed", + "os_sku": "Ubuntu", + "pod_subnet_id": "", + "proximity_placement_group_id": "", + "tags": null, + "type": "VirtualMachineScaleSets", + "ultra_ssd_enabled": false, + "upgrade_settings": [], + "vm_size": "Standard_DS2_v2", + "vnet_subnet_id": "" + } + ], + "disk_encryption_set_id": "", + "dns_prefix": "myaks-project", + "dns_prefix_private_cluster": "", + "enable_pod_security_policy": false, + "fqdn": "myaks-project-bw1tx0x1.hcp.uksouth.azmk8s.io", + "http_application_routing_enabled": false, + "http_application_routing_zone_name": "", + "http_proxy_config": [], + "id": "/subscriptions/9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f/resourceGroups/networking-resource-group/providers/Microsoft.ContainerService/managedClusters/terraform-aks-cluster", + "identity": [], + "ingress_application_gateway": [], + "key_vault_secrets_provider": [], + "kube_admin_config": [], + "kube_admin_config_raw": "", + "kube_config": [ + { + "client_certificate": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUZIakNDQXdhZ0F3SUJBZ0lSQUlZRXpkMmNzTHg1ZStKRmhGTkk5Tk13RFFZSktvWklodmNOQVFFTEJRQXcKRFRFTE1Ba0dBMVVFQXhNQ1kyRXdI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FNTUd4bWJyS0JKQnlBSWRKWkVmQ2pEN1pOeGZ0TGE1ODQzU3ZOVGlabWw4emF6RklYSVJWCjY4Y3RseWNUWDNMOXdaSityanhvWUhDOHhDQlE0aVdBU0NxUGFlUC8yS1FoVW9aR2lGNEdRVDRuTlNEWUVFK3IKa1VzeVhCcHoxeEFnT2VIdlZwTjNUaWNSUnluTHlVQS81SG9wbFc3ay92UEJ3SU43V0QvMnliVWtjUHpYYXBwbApxaDBpS1p0dXZVeHZvRysxTUwwWWpiVys0cWlxRTJUM2sxQ0t5WW5GZml0YlRlVTVVZWV6ZG5PYkF4bEEwelB1ClgvZGoxSXM5TExvamxGT3ZIRzNUcVNYeGxoZ1JBaFhucFZNV3ZHbyt5dmQyckFWV1luNmx0NG1FRGs1UGFRd1MKRkNpMnAydWFZVXVCZlUyVUxoVWJnejRXZjZrellNTVdUZWdLNU1aSnhDV3YyKy80L2UxS1Z0UlBBWGlrbWJoSQpIZ2J5RmNzMzEwMnNhZ2dRCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K", + "host": "https://myaks-project-bw1tx0x1.hcp.uksouth.azmk8s.io:443", + "password": "87b3kaq5d2rhiulbptnyajwyu3amukcuvmk11b5jol6e8jgy8r3um45aodzk3j5a1xp9mbeo3u0zxxa1stoy8xsqn6szekhx5yt1o3vzflm8a79m7icsxt13omn6ea2b", + "username": "clusterUser_networking-resource-group_terraform-aks-cluster" + } + ], + "kube_config_raw": "apiVersion: v1\nclusters:\n- cluster:\n certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUU2RENDQXRDZ0F3SUJBZ0lRY2RscUNWUEprbmxYV1g2NWVwSTh4ekFOQmdrcWhraUc5dzBCQVFzRkFEQU4KTVFzd0NRWURWUVFERXdKallUQWdGdzB5TkRBeE1UY3dNVEkzTWpkYUdBOHlNRFUwTURFeE56QXhNemN5TjFvdwpEVEVMTUFrR0ExVUVBeE1DWTJFd2dnSWlNQTBHQ1N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ks-project-bw1tx0x1.hcp.uksouth.azmk8s.io:443\n name: terraform-aks-cluster\ncontexts:\n- context:\n cluster: terraform-aks-cluster\n user: clusterUser_networking-resource-group_terraform-aks-cluster\n name: terraform-aks-cluster\ncurrent-context: terraform-aks-cluster\nkind: Config\npreferences: {}\nusers:\n- name: clusterUser_networking-resource-group_terraform-aks-cluster\n user:\n client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUZIakNDQXdhZ0F3SUJBZ0lSQUlZRXpkMmNzTHg1ZStKRmhGTkk5Tk13RFFZSktvWklodmNOQVFFTEJRQXcKRFRFTE1Ba0dBMVVFQXhNQ1kyRXdIaGNOTWpRd01URTNNREV5TnpJM1doY05Nall3TVRFM01ERXpOekkzV2pBdwpNUmN3RlFZRFZRUUtFdzV6ZVhOMFpXMDZiV0Z6ZEdWeWN6RVZNQk1HQTFVRUF4TU1iV0Z6ZEdWeVkyeHBaVzUwCk1JSUNJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBZzhBTUlJQ0NnS0NBZ0VBckFCM3dOSEVLU0h2QUtBOFY3a0kKczgvNnVkUzgzOW1XKzJpakY4Q28wVFJUOUxWTFBLS0R4akpTUS9Gc0ZoZzl6bE13VjBPakhwRllVczYrSlBkRApNRnhtT3FWdS96YzVuTmFlNURFQVJkaVc2UGlwYXZQWXhzQk8yRXMwTlRIK0pYTlRHVkdHRHlSS3BJYXZweDFsCmp2RWpkY055R3RSN0U5TjJrSkdxSXQ1dGZxSVdudHpyRmc2VlAwNVVkbmFjOEZJb0cyOWtjRURPK1JTcmVhL0gKWmtTb0c3dHAzanN4bm9hMTlPZWNSaG1YRW5CVjM0Zm0xeUNqMjBRaytmRVFRRFBCVG51Y3dpYnlGcDNEODExVAp3MU1OWVN6aXFDbHBvREdHYWdNc1E3aUgxNytWc3I2UkhVcHNkZWdCSlZRRkxMZitrR21MK2JsTlVYQXlXUzF6CmdEc3lTOUxCYnY5WnBVK3lhVFlDVC9DbT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m9lazJvOXZwTGlRMQpZMlhWZkJ6T0Q0WXEzeVFQbDVvZGNpSCt3MWY2NXBXSE0rQ3lEL1RwODFvSElJd3l5Q3VqWWRDZW9QU0J0RXAvCjFhWktPSGtjSDZOT2VlVG1tdkVkZldaRWNEdTAyVE1DZ2dFQUR2KzUwWERoQUlDMUw4N3hUVGtvU0Z4dmhTMWgKNHdZSDlUdGFhOFAvNTQ3Tm1TcGp0cFg2N2dwOUpkNmsxSzdXZDlYSFdtbGlIMzcybFFYdndrRGRDaHlyVjI2SApDaGxsQTBGNWlHbUxnMzRWNUFqT3krbDRPOHZzMkVYUDdJS3dCVzVVLzRIZWVPTlJhRG1haEhDcUVxSnBDKzVvCjRqRFJEM2lrSWZBTU5va3paZktoTUVPT1dQVkpzb21ZaFZHcHRUMmV5a0JXVUtKM0NabUhNclVLc2JyY1AybmcKRE1uTVhvcDQrNElpNVdzRlJiUWRXOGhvUi9wMWl2d25aVzVjdE9rbmRHL2NEaUo5YWJCWmU5WlQ0WktoNDBCSwo5Sjc5QlFLeThLU29GYTJTek1XMHNydEMvcC9XSXFlWGFjVk5TZlI0YU4xVlhiL2ZDeWZJNktmUGRnPT0KLS0tLS1FTkQgUlNBIFBSSVZBVEUgS0VZLS0tLS0K\n token: 87b3kaq5d2rhiulbptnyajwyu3amukcuvmk11b5jol6e8jgy8r3um45aodzk3j5a1xp9mbeo3u0zxxa1stoy8xsqn6szekhx5yt1o3vzflm8a79m7icsxt13omn6ea2b\n", + "kubelet_identity": [], + "kubernetes_version": "1.26.6", + "linux_profile": [], + "local_account_disabled": false, + "location": "uksouth", + "maintenance_window": [], + "name": "terraform-aks-cluster", + "network_profile": [ + { + "dns_service_ip": "10.0.0.10", + "docker_bridge_cidr": "172.17.0.1/16", + "load_balancer_profile": [ + { + "effective_outbound_ips": [ + "/subscriptions/9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f/resourceGroups/MC_networking-resource-group_terraform-aks-cluster_uksouth/providers/Microsoft.Network/publicIPAddresses/c63ba9ed-2180-4f27-830c-a3edc3e18412" + ], + "idle_timeout_in_minutes": 0, + "managed_outbound_ip_count": 1, + "outbound_ip_address_ids": [], + "outbound_ip_prefix_ids": [], + "outbound_ports_allocated": 0 + } + ], + "load_balancer_sku": "standard", + "nat_gateway_profile": [], + "network_mode": "", + "network_plugin": "azure", + "network_policy": "calico", + "outbound_type": "loadBalancer", + "pod_cidr": "", + "service_cidr": "10.0.0.0/16" + } + ], + "node_resource_group": "MC_networking-resource-group_terraform-aks-cluster_uksouth", + "oms_agent": [], + "open_service_mesh_enabled": false, + "portal_fqdn": "myaks-project-bw1tx0x1.portal.hcp.uksouth.azmk8s.io", + "private_cluster_enabled": false, + "private_cluster_public_fqdn_enabled": false, + "private_dns_zone_id": "", + "private_fqdn": "", + "private_link_enabled": false, + "public_network_access_enabled": true, + "resource_group_name": "networking-resource-group", + "role_based_access_control": [ + { + "azure_active_directory": [], + "enabled": true + } + ], + "role_based_access_control_enabled": true, + "service_principal": [ + { + "client_id": "f76d28cf-7db6-44df-9038-e382d25a625c", + "client_secret": "Xhr8Q~9oPe0_kpOz1rFsz9ihZTx90EWKugifQah4" + } + ], + "sku_tier": "Free", + "tags": { + "Environment": "Development" + }, + "timeouts": null, + "windows_profile": [ + { + "admin_password": "", + "admin_username": "azureuser", + "license": "" + } + ] + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo1NDAwMDAwMDAwMDAwLCJkZWxldGUiOjU0MDAwMDAwMDAwMDAsInJlYWQiOjMwMDAwMDAwMDAwMCwidXBkYXRlIjo1NDAwMDAwMDAwMDAwfSwic2NoZW1hX3ZlcnNpb24iOiIyIn0=", + "dependencies": [ + "module.networking.azurerm_resource_group.aks_rg" + ] + } + ] + }, { "module": "module.networking", "mode": "managed", @@ -19,8 +172,45 @@ "location": "uksouth", "name": "aks-nsg", "resource_group_name": "networking-resource-group", - "security_rule": [], - "tags": null, + "security_rule": [ + { + "access": "Allow", + "description": "", + "destination_address_prefix": "*", + "destination_address_prefixes": [], + "destination_application_security_group_ids": [], + "destination_port_range": "22", + "destination_port_ranges": [], + "direction": "Inbound", + "name": "ssh-rule", + "priority": 101, + "protocol": "Tcp", + "source_address_prefix": "0.0.0.0/0", + "source_address_prefixes": [], + "source_application_security_group_ids": [], + "source_port_range": "*", + "source_port_ranges": [] + }, + { + "access": "Allow", + "description": "", + "destination_address_prefix": "*", + "destination_address_prefixes": [], + "destination_application_security_group_ids": [], + "destination_port_range": "443", + "destination_port_ranges": [], + "direction": "Inbound", + "name": "kube-apiserver-rule", + "priority": 100, + "protocol": "Tcp", + "source_address_prefix": "0.0.0.0/0", + "source_address_prefixes": [], + "source_application_security_group_ids": [], + "source_port_range": "*", + "source_port_ranges": [] + } + ], + "tags": {}, "timeouts": null }, "sensitive_attributes": [], @@ -44,10 +234,10 @@ "access": "Allow", "description": "", "destination_address_prefix": "*", - "destination_address_prefixes": null, - "destination_application_security_group_ids": null, + "destination_address_prefixes": [], + "destination_application_security_group_ids": [], "destination_port_range": "443", - "destination_port_ranges": null, + "destination_port_ranges": [], "direction": "Inbound", "id": "/subscriptions/9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f/resourceGroups/networking-resource-group/providers/Microsoft.Network/networkSecurityGroups/aks-nsg/securityRules/kube-apiserver-rule", "name": "kube-apiserver-rule", @@ -56,10 +246,10 @@ "protocol": "Tcp", "resource_group_name": "networking-resource-group", "source_address_prefix": "0.0.0.0/0", - "source_address_prefixes": null, - "source_application_security_group_ids": null, + "source_address_prefixes": [], + "source_application_security_group_ids": [], "source_port_range": "*", - "source_port_ranges": null, + "source_port_ranges": [], "timeouts": null }, "sensitive_attributes": [], @@ -84,10 +274,10 @@ "access": "Allow", "description": "", "destination_address_prefix": "*", - "destination_address_prefixes": null, - "destination_application_security_group_ids": null, + "destination_address_prefixes": [], + "destination_application_security_group_ids": [], "destination_port_range": "22", - "destination_port_ranges": null, + "destination_port_ranges": [], "direction": "Inbound", "id": "/subscriptions/9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f/resourceGroups/networking-resource-group/providers/Microsoft.Network/networkSecurityGroups/aks-nsg/securityRules/ssh-rule", "name": "ssh-rule", @@ -96,10 +286,10 @@ "protocol": "Tcp", "resource_group_name": "networking-resource-group", "source_address_prefix": "0.0.0.0/0", - "source_address_prefixes": null, - "source_application_security_group_ids": null, + "source_address_prefixes": [], + "source_application_security_group_ids": [], "source_port_range": "*", - "source_port_ranges": null, + "source_port_ranges": [], "timeouts": null }, "sensitive_attributes": [], @@ -124,7 +314,7 @@ "id": "/subscriptions/9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f/resourceGroups/networking-resource-group", "location": "uksouth", "name": "networking-resource-group", - "tags": null, + "tags": {}, "timeouts": null }, "sensitive_attributes": [], @@ -152,8 +342,8 @@ "id": "/subscriptions/9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f/resourceGroups/networking-resource-group/providers/Microsoft.Network/virtualNetworks/aks-vnet/subnets/control-plane-subnet", "name": "control-plane-subnet", "resource_group_name": "networking-resource-group", - "service_endpoint_policy_ids": null, - "service_endpoints": null, + "service_endpoint_policy_ids": [], + "service_endpoints": [], "timeouts": null, "virtual_network_name": "aks-vnet" }, @@ -186,8 +376,8 @@ "id": "/subscriptions/9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f/resourceGroups/networking-resource-group/providers/Microsoft.Network/virtualNetworks/aks-vnet/subnets/worker-node-subnet", "name": "worker-node-subnet", "resource_group_name": "networking-resource-group", - "service_endpoint_policy_ids": null, - "service_endpoints": null, + "service_endpoint_policy_ids": [], + "service_endpoints": [], "timeouts": null, "virtual_network_name": "aks-vnet" }, @@ -222,8 +412,21 @@ "location": "uksouth", "name": "aks-vnet", "resource_group_name": "networking-resource-group", - "subnet": [], - "tags": null, + "subnet": [ + { + "address_prefix": "10.0.1.0/24", + "id": "/subscriptions/9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f/resourceGroups/networking-resource-group/providers/Microsoft.Network/virtualNetworks/aks-vnet/subnets/control-plane-subnet", + "name": "control-plane-subnet", + "security_group": "" + }, + { + "address_prefix": "10.0.2.0/24", + "id": "/subscriptions/9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f/resourceGroups/networking-resource-group/providers/Microsoft.Network/virtualNetworks/aks-vnet/subnets/worker-node-subnet", + "name": "worker-node-subnet", + "security_group": "" + } + ], + "tags": {}, "timeouts": null, "vm_protection_enabled": false }, From 07da4435345bd8412e7ea35ea8397cb4f20abeca Mon Sep 17 00:00:00 2001 From: Chichi Ugorji <73576282+chyjuls@users.noreply.github.com> Date: Thu, 18 Jan 2024 23:41:22 +0000 Subject: [PATCH 12/47] Updates README.md --- README.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/README.md b/README.md index aae53917..ed46a3f3 100644 --- a/README.md +++ b/README.md @@ -195,6 +195,55 @@ terraform apply: To apply the changes and provision the infrastructure. Conclusion The project demonstrates the power of Infrastructure as Code (IaC) using Terraform, showcasing how complex infrastructure can be provisioned, managed, and troubleshooted systematically. +## Kubernetes Deployment Documentation + +### Deployment and Service Manifests** + +This application is deployed on Azure Kubernetes Service (AKS) using Kubernetes manifests. These manifests define the desired state of our application's deployment and service in the cluster. + +### Key Components: +Deployment Manifest: The deployment manifest (deployment.yaml) specifies our application's deployment configuration. It includes the following key settings: + +**Pod Template**: Defines the container image to use (chyjuls/web-delivery:v1) and necessary environment variables. +**Replicas**: Sets the number of pod replicas for high availability. +**Resource Requests/Limits**: Configures CPU and memory resources for each pod. +**Readiness and Liveness Probes**: Ensures that the application is running correctly and is ready to receive traffic. +**Service Manifest**: The service manifest (service.yaml) defines how the application's pods are exposed within the cluster. It includes: +**Type**: Determines how the service is exposed. For internal use, we use ClusterIP; for external access, LoadBalancer can be used. +**Port Mapping**: Maps the port from the pod to the service. + +### Deployment Strategy + +For our application, we've chosen a rolling update deployment strategy. This approach ensures zero downtime during updates, gradually replacing instances of the older version of our application with the new version. + +**Benefits**: +Zero Downtime: Ensures that the application remains available to users during deployment. +Rollback Capabilities: Allows for easy rollback to the previous version if issues arise. +Testing and Validation +Post-deployment, we conducted several tests to ensure the application's functionality and reliability: + +**Connectivity Test**: Verified that the application's pods are accessible and running as expected using kubectl get pods. +**Functionality Test**: Used port forwarding (kubectl port-forward) to temporarily access the application and test its core functionalities, including the orders table and Add Order feature. + +### Internal and External Access + +**Internal Access**: +For internal users, the application can be accessed through an internal load balancer or ingress controller within the AKS cluster. This approach allows employees to access the application without exposing it to the public internet. + +We plan to set up an ingress controller that routes internal traffic to the application based on URL paths. + +**External Access**: + +To make the application accessible to external users, we can expose it through an external load balancer or ingress controller with proper security measures in place. + +**Key considerations for external access include**: +- TLS/SSL Certificates: For secure HTTPS access. +- Authentication and Authorization: To control access to the application. +- Monitoring and Logging: To track usage and potential security incidents. + + + + ## Contributors From 261354fa346e401c8e356d976fd11baa06fb2238 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji <73576282+chyjuls@users.noreply.github.com> Date: Thu, 18 Jan 2024 23:42:03 +0000 Subject: [PATCH 13/47] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ed46a3f3..08181523 100644 --- a/README.md +++ b/README.md @@ -195,7 +195,7 @@ terraform apply: To apply the changes and provision the infrastructure. Conclusion The project demonstrates the power of Infrastructure as Code (IaC) using Terraform, showcasing how complex infrastructure can be provisioned, managed, and troubleshooted systematically. -## Kubernetes Deployment Documentation +# Kubernetes Deployment Documentation ### Deployment and Service Manifests** From 83d16f5ca450cef45a493e548eab918f5164fb02 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji <73576282+chyjuls@users.noreply.github.com> Date: Fri, 19 Jan 2024 00:08:56 +0000 Subject: [PATCH 14/47] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 219d96f5..8d35c42b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -13,7 +13,7 @@ steps: - task: Docker@2 inputs: containerRegistry: 'Docker Hub' - repository: 'mayaaiuga/devops-web-app' + repository: 'chyjuls/Web-App-DevOps-Project' command: 'buildAndPush' Dockerfile: '**/Dockerfile' tags: 'latest' @@ -24,5 +24,5 @@ steps: connectionType: 'azureResourceManager' azureSubscriptionConnection: 'aks-service-connection' azureResourceGroup: 'aks-rg' - kubernetesCluster: 'aks-demo' - manifests: 'deployment.yaml' \ No newline at end of file + kubernetesCluster: 'terraform-aks-cluster' + manifests: 'application-manifest.yaml' \ No newline at end of file From aa4dab3b5aab36b545d091db143ea06ae35d1699 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji <73576282+chyjuls@users.noreply.github.com> Date: Fri, 19 Jan 2024 00:32:51 +0000 Subject: [PATCH 15/47] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8d35c42b..f03fb527 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -11,9 +11,10 @@ pool: steps: - task: Docker@2 + displayName: 'Build and Push Docker Image' inputs: - containerRegistry: 'Docker Hub' - repository: 'chyjuls/Web-App-DevOps-Project' + containerRegistry: 'chyjuls' + repository: 'chyjuls/web-delivery:v1' command: 'buildAndPush' Dockerfile: '**/Dockerfile' tags: 'latest' From 8394061aea5ebba2b3aff9ae635ab6bfd64b29a9 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji <73576282+chyjuls@users.noreply.github.com> Date: Fri, 19 Jan 2024 00:43:06 +0000 Subject: [PATCH 16/47] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f03fb527..5faab0bc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -13,7 +13,7 @@ steps: - task: Docker@2 displayName: 'Build and Push Docker Image' inputs: - containerRegistry: 'chyjuls' + containerRegistry: 'azure DevOps web-app project' repository: 'chyjuls/web-delivery:v1' command: 'buildAndPush' Dockerfile: '**/Dockerfile' From eb2acb84814bdb8ff2d2ff97729e59b82a8a4449 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji <73576282+chyjuls@users.noreply.github.com> Date: Fri, 19 Jan 2024 00:43:54 +0000 Subject: [PATCH 17/47] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5faab0bc..673480cf 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -24,6 +24,6 @@ steps: action: 'deploy' connectionType: 'azureResourceManager' azureSubscriptionConnection: 'aks-service-connection' - azureResourceGroup: 'aks-rg' + azureResourceGroup: 'networking-resource-group' kubernetesCluster: 'terraform-aks-cluster' manifests: 'application-manifest.yaml' \ No newline at end of file From 91041351cc04134ab1113b9271bb5b2657534f81 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji <73576282+chyjuls@users.noreply.github.com> Date: Fri, 19 Jan 2024 00:59:28 +0000 Subject: [PATCH 18/47] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 673480cf..f37598b7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -19,11 +19,15 @@ steps: Dockerfile: '**/Dockerfile' tags: 'latest' -- task: KubernetesManifest@1 +- task: Kubernetes@1 inputs: - action: 'deploy' - connectionType: 'azureResourceManager' - azureSubscriptionConnection: 'aks-service-connection' - azureResourceGroup: 'networking-resource-group' + connectionType: 'Azure Resource Manager' + azureSubscriptionEndpoint: 'kubernetes_deploh' + azureResourceGroup: 'networking-resource-group>' kubernetesCluster: 'terraform-aks-cluster' - manifests: 'application-manifest.yaml' \ No newline at end of file + command: 'apply' + arguments: '-f $(System.DefaultWorkingDirectory)/aks-terraform/application-manifest.yaml' + +git add azure-pipelines.yml +git commit -m "Add Deploy to Kubernetes task to pipeline" +git push From 7ef3ab5f58a31993ba051cf2247ab37301019e60 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji <73576282+chyjuls@users.noreply.github.com> Date: Fri, 19 Jan 2024 01:00:26 +0000 Subject: [PATCH 19/47] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f37598b7..90995e58 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -28,6 +28,3 @@ steps: command: 'apply' arguments: '-f $(System.DefaultWorkingDirectory)/aks-terraform/application-manifest.yaml' -git add azure-pipelines.yml -git commit -m "Add Deploy to Kubernetes task to pipeline" -git push From ac85d0c0714a55e121361f481085a0ef8b6f0046 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji <73576282+chyjuls@users.noreply.github.com> Date: Fri, 19 Jan 2024 01:00:58 +0000 Subject: [PATCH 20/47] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 90995e58..5891202c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -22,7 +22,7 @@ steps: - task: Kubernetes@1 inputs: connectionType: 'Azure Resource Manager' - azureSubscriptionEndpoint: 'kubernetes_deploh' + azureSubscriptionEndpoint: 'kubernetes_deploy' azureResourceGroup: 'networking-resource-group>' kubernetesCluster: 'terraform-aks-cluster' command: 'apply' From a23ddf7cf30b8cd4d2d11f3b28650112b500e385 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji <73576282+chyjuls@users.noreply.github.com> Date: Mon, 22 Jan 2024 11:16:44 +0000 Subject: [PATCH 21/47] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5891202c..31d557df 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -14,10 +14,10 @@ steps: displayName: 'Build and Push Docker Image' inputs: containerRegistry: 'azure DevOps web-app project' - repository: 'chyjuls/web-delivery:v1' + repository: 'chyjuls/web-delivery' command: 'buildAndPush' Dockerfile: '**/Dockerfile' - tags: 'latest' + tags: 'v1' - task: Kubernetes@1 inputs: From dec22980cee75888a960d8abee0d1239953dd171 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji <73576282+chyjuls@users.noreply.github.com> Date: Mon, 22 Jan 2024 17:11:05 +0000 Subject: [PATCH 22/47] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 31d557df..c86a2de4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,7 +17,7 @@ steps: repository: 'chyjuls/web-delivery' command: 'buildAndPush' Dockerfile: '**/Dockerfile' - tags: 'v1' + tags: 'v2.0' - task: Kubernetes@1 inputs: From a8aed4ffa4924a1f8242c6125ea7488a295a153d Mon Sep 17 00:00:00 2001 From: Chichi Ugorji Date: Mon, 22 Jan 2024 17:47:21 +0000 Subject: [PATCH 23/47] Updates Dockerfile --- Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a2e4c015..774d07a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,9 @@ # Use an official Python runtime as a parent image # Using a specific image for M1/M2 chip Mac users -FROM --platform=linux/amd64/v8 public.ecr.aws/docker/library/python:3.9.10-slim-buster +ARG ARCH +FROM ${ARCH}/ubuntu +FROM python:3.9 +FROM --platform=linux/amd64 public.ecr.aws/docker/library/python:3.9.10-slim-buster # Set the working directory in the container WORKDIR /app @@ -17,7 +20,7 @@ RUN apt-get update && apt-get install -y \ wget -qO- https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list && \ apt-get update && \ ACCEPT_EULA=Y apt-get install -y msodbcsql18 && \ - # apt-get purge -y --auto-remove wget && \ + # apt-get purge -y --auto-remove wget && \ apt-get clean # Install pip and setuptools From 43caf1781ce5ff0c5172d8571792e110357ea652 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji Date: Mon, 22 Jan 2024 18:10:43 +0000 Subject: [PATCH 24/47] Removes the incorrect syntax /ubuntu from file --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 774d07a9..02e97f8a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # Use an official Python runtime as a parent image # Using a specific image for M1/M2 chip Mac users ARG ARCH -FROM ${ARCH}/ubuntu + FROM python:3.9 FROM --platform=linux/amd64 public.ecr.aws/docker/library/python:3.9.10-slim-buster From 914f6e54edf00e21e40b4aa7458ef4f8b1cfb6a7 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji <73576282+chyjuls@users.noreply.github.com> Date: Mon, 22 Jan 2024 18:51:39 +0000 Subject: [PATCH 25/47] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c86a2de4..1816d29c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -22,8 +22,8 @@ steps: - task: Kubernetes@1 inputs: connectionType: 'Azure Resource Manager' - azureSubscriptionEndpoint: 'kubernetes_deploy' - azureResourceGroup: 'networking-resource-group>' + azureSubscriptionEndpoint: 'terraform-aks-cluster' + azureResourceGroup: 'networking-resource-group' kubernetesCluster: 'terraform-aks-cluster' command: 'apply' arguments: '-f $(System.DefaultWorkingDirectory)/aks-terraform/application-manifest.yaml' From 522fe1e6d8caa6b4ffa1465a7e7b59d1e4be19ac Mon Sep 17 00:00:00 2001 From: Chichi Ugorji <73576282+chyjuls@users.noreply.github.com> Date: Mon, 22 Jan 2024 19:35:57 +0000 Subject: [PATCH 26/47] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1816d29c..8db9ad19 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -21,10 +21,10 @@ steps: - task: Kubernetes@1 inputs: + action: 'deploy' connectionType: 'Azure Resource Manager' azureSubscriptionEndpoint: 'terraform-aks-cluster' azureResourceGroup: 'networking-resource-group' kubernetesCluster: 'terraform-aks-cluster' command: 'apply' arguments: '-f $(System.DefaultWorkingDirectory)/aks-terraform/application-manifest.yaml' - From 0e2e0662ce6bf7c2a85ad13bea4c37c1a993f142 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji <73576282+chyjuls@users.noreply.github.com> Date: Mon, 22 Jan 2024 21:07:42 +0000 Subject: [PATCH 27/47] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8db9ad19..61ba81be 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -19,12 +19,12 @@ steps: Dockerfile: '**/Dockerfile' tags: 'v2.0' -- task: Kubernetes@1 - inputs: - action: 'deploy' - connectionType: 'Azure Resource Manager' - azureSubscriptionEndpoint: 'terraform-aks-cluster' - azureResourceGroup: 'networking-resource-group' - kubernetesCluster: 'terraform-aks-cluster' - command: 'apply' - arguments: '-f $(System.DefaultWorkingDirectory)/aks-terraform/application-manifest.yaml' + + - task: KubernetesManifest@1 + inputs: + action: 'deploy' + connectionType: 'azureResourceManager' + azureSubscriptionConnection: 'Chinyere Ugorji DevOps(9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f)' + azureResourceGroup: 'networking-resource-group' + kubernetesCluster: 'terraform-aks-cluster' + manifests: 'application-manifest.yaml' From 36a2466f4f4b38600a6d585583d9829e852134b1 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji <73576282+chyjuls@users.noreply.github.com> Date: Mon, 22 Jan 2024 21:08:24 +0000 Subject: [PATCH 28/47] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 61ba81be..95ba3934 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -20,8 +20,8 @@ steps: tags: 'v2.0' - - task: KubernetesManifest@1 - inputs: +- task: KubernetesManifest@1 + inputs: action: 'deploy' connectionType: 'azureResourceManager' azureSubscriptionConnection: 'Chinyere Ugorji DevOps(9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f)' From 259d33cef706879f252c50be7b381ea501885634 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji Date: Mon, 22 Jan 2024 21:28:00 +0000 Subject: [PATCH 29/47] Updates the application-manifest.yaml file --- application-manifest.yaml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 application-manifest.yaml diff --git a/application-manifest.yaml b/application-manifest.yaml new file mode 100644 index 00000000..54dd980e --- /dev/null +++ b/application-manifest.yaml @@ -0,0 +1,39 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: flask-app-deployment +spec: + replicas: 2 + selector: + matchLabels: + app: flask-app + template: + metadata: + labels: + app: flask-app + spec: + containers: + - name: flask-app + image: chyjuls/web-delivery:v2.0 + ports: + - containerPort: 5000 + strategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 1 + maxSurge: 1 + +--- + +apiVersion: v1 +kind: Service +metadata: + name: flask-app-service +spec: + selector: + app: flask-app + ports: + - protocol: TCP + port: 80 + targetPort: 5000 + type: ClusterIP From 3fe9d4ab4531eacf55726d612f8aa7eab856474b Mon Sep 17 00:00:00 2001 From: Chichi Ugorji Date: Mon, 22 Jan 2024 21:42:07 +0000 Subject: [PATCH 30/47] Remove azure-pipelines-1.yml --- azure-pipelines-1.yml | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 azure-pipelines-1.yml diff --git a/azure-pipelines-1.yml b/azure-pipelines-1.yml deleted file mode 100644 index da4a24bb..00000000 --- a/azure-pipelines-1.yml +++ /dev/null @@ -1,27 +0,0 @@ -# Starter pipeline -# Start with a minimal pipeline that you can customize to build and deploy your code. -# Add steps that build, run tests, deploy, and more: -# https://aka.ms/yaml - -trigger: -- main - -pool: - vmImage: ubuntu-latest - -steps: -- task: Docker@2 - inputs: - containerRegistry: 'Docker Hub' - repository: 'mayaaiuga/test-run-image' - command: 'buildAndPush' - Dockerfile: '**/Dockerfile' - tags: 'latest' -- task: KubernetesManifest@1 - inputs: - action: 'deploy' - connectionType: 'azureResourceManager' - azureSubscriptionConnection: 'aks-service-connection' - azureResourceGroup: 'aks-rg' - kubernetesCluster: 'aks-demo' - manifests: 'deployment.yaml' \ No newline at end of file From dab6c26d8a412a966760509c1c356268870b9752 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji <73576282+chyjuls@users.noreply.github.com> Date: Mon, 22 Jan 2024 22:03:41 +0000 Subject: [PATCH 31/47] Updates README.md with latest project tasks --- README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/README.md b/README.md index 08181523..5d2cdb7e 100644 --- a/README.md +++ b/README.md @@ -243,6 +243,46 @@ To make the application accessible to external users, we can expose it through a +# CI/CD Pipeline Setup + +## Overview +This project includes a Continuous Integration/Continuous Deployment (CI/CD) pipeline, which automates the process of testing, building, and deploying the application. The pipeline is defined in the azure-pipeline.yaml file and utilizes Azure DevOps for execution. + +### azure-pipeline.yaml** + +The azure-pipeline.yaml file defines the pipeline's stages, jobs, and steps. It is structured as follows: + +**Trigger**: Specifies the branch(es) that will trigger the pipeline. +**Variables**: Defines the variables used across the pipeline. +**Stages**: Organizes the pipeline into distinct stages such as Build, Test, and Deploy. +**Build Stage**: Compiles the code, runs tests, and builds the Docker image. The image is then pushed to a Docker registry. +**Deploy Stage**: Handles the deployment of the built image to the Kubernetes cluster. + +### Kubernetes Manifest File + +The Kubernetes manifest file, located at [path-to-manifest-file], is crucial for the deployment process. It defines the desired state of the application in the Kubernetes cluster. Key components include: + +**Deployment**: Specifies the container image to use, the number of replicas, and configuration like environment variables and resource limits. +**Service**: Defines how the application is exposed within the Kubernetes cluster or to the outside world, like LoadBalancer or NodePort services. + +### CI/CD Pipeline Flow + +**Code Commit**: A commit to the specified branch triggers the pipeline. +**Build**: The application is built, and a Docker image is created. +**Test**: Automated tests are run to ensure code reliability. +**Docker Push**: The Docker image is pushed to the registry. +**Deployment**: The application is deployed to the AKS cluster using the Kubernetes manifest file. +**Post-Deployment**: The pipeline performs any post-deployment steps like health checks or notifications. + +### Conclusion +The CI/CD pipeline ensures that every code change is automatically tested and deployed, maintaining the reliability and stability of the application. This automation streamlines the development process, reduces manual errors, and ensures quicker delivery of features and fixes. + + + + + + + From 120d9760ed8c9768cab2cea9c7085877a8df4c9d Mon Sep 17 00:00:00 2001 From: Chichi Ugorji <73576282+chyjuls@users.noreply.github.com> Date: Mon, 22 Jan 2024 22:04:24 +0000 Subject: [PATCH 32/47] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5d2cdb7e..29fa8a6b 100644 --- a/README.md +++ b/README.md @@ -197,7 +197,7 @@ The project demonstrates the power of Infrastructure as Code (IaC) using Terrafo # Kubernetes Deployment Documentation -### Deployment and Service Manifests** +### Deployment and Service Manifests This application is deployed on Azure Kubernetes Service (AKS) using Kubernetes manifests. These manifests define the desired state of our application's deployment and service in the cluster. From 2ae0fc554acd02b234f9f4379844183e1a540c7c Mon Sep 17 00:00:00 2001 From: Chichi Ugorji <73576282+chyjuls@users.noreply.github.com> Date: Sat, 27 Jan 2024 13:22:34 +0000 Subject: [PATCH 33/47] Update README.md Updates README, with more information. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 29fa8a6b..329f9a18 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Web-App-DevOps-Project -Welcome to the Web App DevOps Project repo! This application allows you to efficiently manage and track orders for a potential business. It provides an intuitive user interface for viewing existing orders and adding new ones. +Welcome to the Web App DevOps Project repo! This application allows you to efficiently manage and track orders for a potential business. It provides an intuitive user interface for viewing existing orders and adding new ones. This is the finally project for AI core students who are on the DevOps pathway.Although the repo is forked, files have been replaced with my personal project files. ## Table of Contents From 21b198d1bb2660907c4a14c32bdbe9a6179ad482 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji <73576282+chyjuls@users.noreply.github.com> Date: Sun, 28 Jan 2024 01:08:32 +0000 Subject: [PATCH 34/47] Update README.md --- README.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/README.md b/README.md index 329f9a18..e8c3279a 100644 --- a/README.md +++ b/README.md @@ -278,10 +278,55 @@ The Kubernetes manifest file, located at [path-to-manifest-file], is crucial for The CI/CD pipeline ensures that every code change is automatically tested and deployed, maintaining the reliability and stability of the application. This automation streamlines the development process, reduces manual errors, and ensures quicker delivery of features and fixes. + +# Monitoring Strategy for AKS Cluster +## Metrics Explorer Charts +The AKS cluster monitoring utilizes Azure Monitor's Metrics Explorer to visualize key performance indicators. Below are the specific charts utilized, their significance, and interpretation guidelines: +1. Average Node CPU Usage + +**Significance**: This chart tracks the CPU usage across all nodes, providing insights into the computational load and identifying potential bottlenecks. +**Metrics Tracked**: CPU utilization percentage. +Interpretation: Values nearing 100% indicate high CPU load, suggesting the need for scaling or optimization. + +2. Average Node Memory Usage + +**Significance**: Monitors memory consumption, crucial for ensuring applications have sufficient resources and for detecting memory leaks. +**Metrics Tracked**: Memory utilization percentage. +Interpretation: High memory usage close to the node capacity may require scaling or investigating potential memory leaks. + +3. Pod Count by Phase + +**Significance**: Offers a snapshot of pod distribution by their lifecycle phase, useful for understanding cluster workload and deployment health. +**Metrics Tracked**: Count of pods in phases like Running, Pending, Failed, etc. +Interpretation: An unusual increase in Pending or Failed pods may indicate issues with scheduling or application errors. + +## Log Analytics + +Azure Log Analytics is used to parse and analyze logs from the AKS cluster. Key logs include: + +1. Node and Pod Logs +**Content**: Include metrics on operations, performance, and errors at both the node and pod levels. +**Relevance**: Helps in diagnosing system-level and application-level issues. + +2. Container Logs +**Content**: Capture stdout and stderr from containers, including application logs. +**Relevance**: Critical for troubleshooting application-specific issues. + + +## Alarm Configurations + +1. CPU Usage Alarm +**Condition**: Triggered when CPU usage exceeds 80% for over 5 minutes. +**Threshold**: >80% CPU utilization. +**Response Strategy**: Investigate running pods and services for optimization or scale up the cluster. +2. Memory Usage Alarm +**Condition**: Fires when memory usage surpasses 80% for a continuous 5-minute window. +**Threshold**: >80% memory utilization. +**Response Strategy**: Check for memory-intensive applications, consider scaling or optimizing pod configurations. From 2be901e4b2813590b0e4c1fbd5de8870c89ed972 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji Date: Mon, 29 Jan 2024 14:12:26 +0000 Subject: [PATCH 35/47] Updates app.py and requirements.txt with azure key vault packages and dependencies --- app.py | 37 +++++++++++++++++++++++++++---------- requirements.txt | 2 ++ 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/app.py b/app.py index 50f4e29d..5652b43a 100644 --- a/app.py +++ b/app.py @@ -5,19 +5,32 @@ from sqlalchemy import create_engine import pyodbc import os +from azure.identity import DefaultAzureCredential +from azure.keyvault.secrets import SecretClient + # Initialise Flask App app = Flask(__name__) # database connection -server = 'devops-project-server.database.windows.net' -database = 'orders-db' -username = 'maya' -password = 'AiCore1237' -driver= '{ODBC Driver 18 for SQL Server}' + +# Azure Key Vault settings + +key_vault_name = os.environ["KEY_VAULT_NAME"] +kv_uri = f"https://{key_vault_name}.vault.azure.net" + +credential = DefaultAzureCredential() +client = SecretClient(vault_url=kv_uri, credential=credential) + +# Retrieve secrets from Azure Key Vault +server = client.get_secret("server-name").value +database = client.get_secret("database-name").value +username = client.get_secret("username").value +password = client.get_secret("database-password").value +driver = '{ODBC Driver 18 for SQL Server}' # Create the connection string -connection_string=f'Driver={driver};\ +connection_string = f'Driver={driver};\ Server=tcp:{server},1433;\ Database={database};\ Uid={username};\ @@ -36,6 +49,7 @@ # Define the Order data model Base = declarative_base() + class Order(Base): __tablename__ = 'orders' date_uuid = Column('date_uuid', String, primary_key=True) @@ -47,11 +61,11 @@ class Order(Base): order_date = Column('Order Date', DateTime) shipping_date = Column('Shipping Date', DateTime) + # define routes -# route to display orders +# to display orders @app.route('/') def display_orders(): - page = int(request.args.get('page', 1)) rows_per_page = 25 @@ -63,7 +77,8 @@ def display_orders(): session = Session() # Fetch a subset of data for the current page - current_page_orders = session.query(Order).order_by(Order.user_id, Order.date_uuid).slice(start_index, end_index).all() + current_page_orders = session.query(Order).order_by(Order.user_id, Order.date_uuid).slice(start_index, + end_index).all() # Calculate the total number of pages total_rows = session.query(Order).count() @@ -74,6 +89,7 @@ def display_orders(): return render_template('orders.html', orders=current_page_orders, page=page, total_pages=total_pages) + # route to add orders @app.route('/add_order', methods=['POST']) def add_order(): @@ -85,7 +101,7 @@ def add_order(): product_quantity = request.form.get('product_quantity') order_date = request.form.get('order_date') shipping_date = request.form.get('shipping_date') - + # Create a session to interact with the database session = Session() @@ -107,6 +123,7 @@ def add_order(): return redirect(url_for('display_orders')) + # run the app if __name__ == '__main__': app.run(host='0.0.0.0', port=5000, debug=True) diff --git a/requirements.txt b/requirements.txt index 47ec762e..067f6f64 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,5 @@ +azure-identity +azure-keyvault-secrets flask==2.2.2 pyodbc==4.0.39 SQLAlchemy==2.0.21 From f7829af0dd2de8049f62ca4c975ef7a2b077289a Mon Sep 17 00:00:00 2001 From: Chichi Ugorji Date: Mon, 29 Jan 2024 14:30:39 +0000 Subject: [PATCH 36/47] Updates all files in the directory --- aks-terraform/application-manifest.yaml | 40 -- .../modules/aks-cluster-module/main.tf | 11 +- aks-terraform/terraform.tfstate.backup | 438 +----------------- 3 files changed, 9 insertions(+), 480 deletions(-) delete mode 100644 aks-terraform/application-manifest.yaml diff --git a/aks-terraform/application-manifest.yaml b/aks-terraform/application-manifest.yaml deleted file mode 100644 index b2f531b5..00000000 --- a/aks-terraform/application-manifest.yaml +++ /dev/null @@ -1,40 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: flask-app-deployment -spec: - replicas: 2 - selector: - matchLabels: - app: flask-app - template: - metadata: - labels: - app: flask-app - spec: - containers: - - name: flask-app - image: chyjuls/web-delivery:v1 - ports: - - containerPort: 5000 - strategy: - type: RollingUpdate - rollingUpdate: - maxUnavailable: 1 - maxSurge: 1 - ---- - -apiVersion: v1 -kind: Service -metadata: - name: flask-app-service -spec: - selector: - app: flask-app - ports: - - protocol: TCP - port: 80 - targetPort: 5000 - type: ClusterIP - diff --git a/aks-terraform/modules/aks-cluster-module/main.tf b/aks-terraform/modules/aks-cluster-module/main.tf index ce0143d3..f04363ed 100644 --- a/aks-terraform/modules/aks-cluster-module/main.tf +++ b/aks-terraform/modules/aks-cluster-module/main.tf @@ -6,10 +6,13 @@ resource "azurerm_kubernetes_cluster" "aks_cluster" { kubernetes_version = var.kubernetes_version default_node_pool { - name = "default" - node_count = 1 - vm_size = "Standard_DS2_v2" - } + name = "default" + vm_size = "Standard_DS2_v2" + enable_auto_scaling = true + min_count = 1 + max_count = 5 +} + service_principal { client_id = var.service_principal_client_id diff --git a/aks-terraform/terraform.tfstate.backup b/aks-terraform/terraform.tfstate.backup index 172f83dc..a3b0b612 100644 --- a/aks-terraform/terraform.tfstate.backup +++ b/aks-terraform/terraform.tfstate.backup @@ -1,443 +1,9 @@ { "version": 4, "terraform_version": "1.6.6", - "serial": 12, + "serial": 31, "lineage": "9fa196a3-ac0b-6f73-b86d-6aea533f1be0", "outputs": {}, - "resources": [ - { - "module": "module.aks_cluster", - "mode": "managed", - "type": "azurerm_kubernetes_cluster", - "name": "aks_cluster", - "provider": "provider[\"registry.terraform.io/hashicorp/azurerm\"]", - "instances": [ - { - "schema_version": 2, - "attributes": { - "aci_connector_linux": [], - "addon_profile": [], - "api_server_authorized_ip_ranges": null, - "auto_scaler_profile": [], - "automatic_channel_upgrade": "", - "azure_active_directory_role_based_access_control": [], - "azure_policy_enabled": false, - "default_node_pool": [ - { - "availability_zones": null, - "enable_auto_scaling": false, - "enable_host_encryption": false, - "enable_node_public_ip": false, - "fips_enabled": false, - "kubelet_config": [], - "kubelet_disk_type": "OS", - "linux_os_config": [], - "max_count": 0, - "max_pods": 30, - "min_count": 0, - "name": "default", - "node_count": 1, - "node_labels": {}, - "node_public_ip_prefix_id": "", - "node_taints": null, - "only_critical_addons_enabled": false, - "orchestrator_version": "1.26.6", - "os_disk_size_gb": 128, - "os_disk_type": "Managed", - "os_sku": "Ubuntu", - "pod_subnet_id": "", - "proximity_placement_group_id": "", - "tags": null, - "type": "VirtualMachineScaleSets", - "ultra_ssd_enabled": false, - "upgrade_settings": [], - "vm_size": "Standard_DS2_v2", - "vnet_subnet_id": "" - } - ], - "disk_encryption_set_id": "", - "dns_prefix": "myaks-project", - "dns_prefix_private_cluster": "", - "enable_pod_security_policy": false, - "fqdn": "myaks-project-bw1tx0x1.hcp.uksouth.azmk8s.io", - "http_application_routing_enabled": false, - "http_application_routing_zone_name": "", - "http_proxy_config": [], - "id": "/subscriptions/9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f/resourceGroups/networking-resource-group/providers/Microsoft.ContainerService/managedClusters/terraform-aks-cluster", - "identity": [], - "ingress_application_gateway": [], - "key_vault_secrets_provider": [], - "kube_admin_config": [], - "kube_admin_config_raw": "", - "kube_config": [ - { - "client_certificate": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tL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TV1JZRU51VkdqRU5MMy90b1QKNS85Q0VqRWl6bXJxczIrWnRobzZMb25RSCtMNFRxNW5aZXYyMlRCZTFocDFGRUNBYlBBRnBVL1F1SEdqSEdpWgpiNm92T0t2OS83WUFNTUd4bWJyS0JKQnlBSWRKWkVmQ2pEN1pOeGZ0TGE1ODQzU3ZOVGlabWw4emF6RklYSVJWCjY4Y3RseWNUWDNMOXdaSityanhvWUhDOHhDQlE0aVdBU0NxUGFlUC8yS1FoVW9aR2lGNEdRVDRuTlNEWUVFK3IKa1VzeVhCcHoxeEFnT2VIdlZwTjNUaWNSUnluTHlVQS81SG9wbFc3ay92UEJ3SU43V0QvMnliVWtjUHpYYXBwbApxaDBpS1p0dXZVeHZvRysxTUwwWWpiVys0cWlxRTJUM2sxQ0t5WW5GZml0YlRlVTVVZWV6ZG5PYkF4bEEwelB1ClgvZGoxSXM5TExvamxGT3ZIRzNUcVNYeGxoZ1JBaFhucFZNV3ZHbyt5dmQyckFWV1luNmx0NG1FRGs1UGFRd1MKRkNpMnAydWFZVXVCZlUyVUxoVWJnejRXZjZrellNTVdUZWdLNU1aSnhDV3YyKy80L2UxS1Z0UlBBWGlrbWJoSQpIZ2J5RmNzMzEwMnNhZ2dRCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K", - "host": "https://myaks-project-bw1tx0x1.hcp.uksouth.azmk8s.io:443", - "password": "87b3kaq5d2rhiulbptnyajwyu3amukcuvmk11b5jol6e8jgy8r3um45aodzk3j5a1xp9mbeo3u0zxxa1stoy8xsqn6szekhx5yt1o3vzflm8a79m7icsxt13omn6ea2b", - "username": "clusterUser_networking-resource-group_terraform-aks-cluster" - } - ], - "kube_config_raw": "apiVersion: v1\nclusters:\n- cluster:\n certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUU2RENDQXRDZ0F3SUJBZ0lRY2RscUNWUEprbmxYV1g2NWVwSTh4ekFOQmdrcWhraUc5dzBCQVFzRkFEQU4KTV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XZjZrellNTVdUZWdLNU1aSnhDV3YyKy80L2UxS1Z0UlBBWGlrbWJoSQpIZ2J5RmNzMzEwMnNhZ2dRCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K\n server: https://myaks-project-bw1tx0x1.hcp.uksouth.azmk8s.io:443\n name: terraform-aks-cluster\ncontexts:\n- context:\n cluster: terraform-aks-cluster\n user: clusterUser_networking-resource-group_terraform-aks-cluster\n name: terraform-aks-cluster\ncurrent-context: terraform-aks-cluster\nkind: Config\npreferences: {}\nusers:\n- name: clusterUser_networking-resource-group_terraform-aks-cluster\n user:\n client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUZIakNDQXdhZ0F3SUJBZ0lSQUlZRXpkMmNzTHg1ZStKRmhGTkk5Tk13RFFZSktvWklodmNOQVFFTEJRQXcKRFRFTE1Ba0dBMVVFQXhNQ1kyRXdIaGNOTWpRd01URTNNREV5TnpJM1doY05Nall3TVRFM01ERXpOekkzV2pBdwpNUmN3RlFZRFZRUUtFdzV6ZVhOMFpXMDZiV0Z6ZEdWeWN6RVZNQk1HQTFVRUF4TU1iV0Z6ZEdWeVkyeHBaVzUwCk1JSUNJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBZzhBTUlJQ0NnS0NBZ0VBckFCM3dOSEVLU0h2QUtBOFY3a0kKczgvNnVkUzgzOW1XKzJpakY4Q28wVFJUOUxWTFBLS0R4akpTUS9Gc0ZoZzl6bE13VjBPakhwRllVczYrSlBkRApNRnhtT3FWdS96YzVuTmFlNURFQVJkaVc2UGlwYXZQWXhzQk8yRXMwTlRIK0pYTlRHVkdHRHlSS3BJYXZweDFsCmp2RWpkY055R3RSN0U5TjJrSkdxSXQ1dGZxSVdudHpyRmc2VlAwNVVkbmFjOEZJb0cyOWtjRURPK1JTcmVhL0gKWmtTb0c3dHAzanN4bm9hMTlPZWNSaG1YRW5CVjM0Zm0xeUNqMjBRaytmRVFRRFBCVG51Y3dpYnlGcDNEOD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BL2tWM0xycUZjbWJlRkRkcmVvMnZHN1c3UFJhTVVVZEJ6VUFoczdHdm0KdkZKelNFWnMveVBBUElCSVlyclNUVTk0WFM4QUNKU3hHa3F6UnZSbyszdUVOdWFYamNtUm9lazJvOXZwTGlRMQpZMlhWZkJ6T0Q0WXEzeVFQbDVvZGNpSCt3MWY2NXBXSE0rQ3lEL1RwODFvSElJd3l5Q3VqWWRDZW9QU0J0RXAvCjFhWktPSGtjSDZOT2VlVG1tdkVkZldaRWNEdTAyVE1DZ2dFQUR2KzUwWERoQUlDMUw4N3hUVGtvU0Z4dmhTMWgKNHdZSDlUdGFhOFAvNTQ3Tm1TcGp0cFg2N2dwOUpkNmsxSzdXZDlYSFdtbGlIMzcybFFYdndrRGRDaHlyVjI2SApDaGxsQTBGNWlHbUxnMzRWNUFqT3krbDRPOHZzMkVYUDdJS3dCVzVVLzRIZWVPTlJhRG1haEhDcUVxSnBDKzVvCjRqRFJEM2lrSWZBTU5va3paZktoTUVPT1dQVkpzb21ZaFZHcHRUMmV5a0JXVUtKM0NabUhNclVLc2JyY1AybmcKRE1uTVhvcDQrNElpNVdzRlJiUWRXOGhvUi9wMWl2d25aVzVjdE9rbmRHL2NEaUo5YWJCWmU5WlQ0WktoNDBCSwo5Sjc5QlFLeThLU29GYTJTek1XMHNydEMvcC9XSXFlWGFjVk5TZlI0YU4xVlhiL2ZDeWZJNktmUGRnPT0KLS0tLS1FTkQgUlNBIFBSSVZBVEUgS0VZLS0tLS0K\n token: 87b3kaq5d2rhiulbptnyajwyu3amukcuvmk11b5jol6e8jgy8r3um45aodzk3j5a1xp9mbeo3u0zxxa1stoy8xsqn6szekhx5yt1o3vzflm8a79m7icsxt13omn6ea2b\n", - "kubelet_identity": [], - "kubernetes_version": "1.26.6", - "linux_profile": [], - "local_account_disabled": false, - "location": "uksouth", - "maintenance_window": [], - "name": "terraform-aks-cluster", - "network_profile": [ - { - "dns_service_ip": "10.0.0.10", - "docker_bridge_cidr": "172.17.0.1/16", - "load_balancer_profile": [ - { - "effective_outbound_ips": [ - "/subscriptions/9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f/resourceGroups/MC_networking-resource-group_terraform-aks-cluster_uksouth/providers/Microsoft.Network/publicIPAddresses/c63ba9ed-2180-4f27-830c-a3edc3e18412" - ], - "idle_timeout_in_minutes": 0, - "managed_outbound_ip_count": 1, - "outbound_ip_address_ids": [], - "outbound_ip_prefix_ids": [], - "outbound_ports_allocated": 0 - } - ], - "load_balancer_sku": "standard", - "nat_gateway_profile": [], - "network_mode": "", - "network_plugin": "azure", - "network_policy": "calico", - "outbound_type": "loadBalancer", - "pod_cidr": "", - "service_cidr": "10.0.0.0/16" - } - ], - "node_resource_group": "MC_networking-resource-group_terraform-aks-cluster_uksouth", - "oms_agent": [], - "open_service_mesh_enabled": false, - "portal_fqdn": "myaks-project-bw1tx0x1.portal.hcp.uksouth.azmk8s.io", - "private_cluster_enabled": false, - "private_cluster_public_fqdn_enabled": false, - "private_dns_zone_id": "", - "private_fqdn": "", - "private_link_enabled": false, - "public_network_access_enabled": true, - "resource_group_name": "networking-resource-group", - "role_based_access_control": [ - { - "azure_active_directory": [], - "enabled": true - } - ], - "role_based_access_control_enabled": true, - "service_principal": [ - { - "client_id": "f76d28cf-7db6-44df-9038-e382d25a625c", - "client_secret": "Xhr8Q~9oPe0_kpOz1rFsz9ihZTx90EWKugifQah4" - } - ], - "sku_tier": "Free", - "tags": { - "Environment": "Development" - }, - "timeouts": null, - "windows_profile": [ - { - "admin_password": "", - "admin_username": "azureuser", - "license": "" - } - ] - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo1NDAwMDAwMDAwMDAwLCJkZWxldGUiOjU0MDAwMDAwMDAwMDAsInJlYWQiOjMwMDAwMDAwMDAwMCwidXBkYXRlIjo1NDAwMDAwMDAwMDAwfSwic2NoZW1hX3ZlcnNpb24iOiIyIn0=", - "dependencies": [ - "module.networking.azurerm_resource_group.aks_rg" - ] - } - ] - }, - { - "module": "module.networking", - "mode": "managed", - "type": "azurerm_network_security_group", - "name": "aks_nsg", - "provider": "provider[\"registry.terraform.io/hashicorp/azurerm\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "id": "/subscriptions/9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f/resourceGroups/networking-resource-group/providers/Microsoft.Network/networkSecurityGroups/aks-nsg", - "location": "uksouth", - "name": "aks-nsg", - "resource_group_name": "networking-resource-group", - "security_rule": [ - { - "access": "Allow", - "description": "", - "destination_address_prefix": "*", - "destination_address_prefixes": [], - "destination_application_security_group_ids": [], - "destination_port_range": "22", - "destination_port_ranges": [], - "direction": "Inbound", - "name": "ssh-rule", - "priority": 101, - "protocol": "Tcp", - "source_address_prefix": "0.0.0.0/0", - "source_address_prefixes": [], - "source_application_security_group_ids": [], - "source_port_range": "*", - "source_port_ranges": [] - }, - { - "access": "Allow", - "description": "", - "destination_address_prefix": "*", - "destination_address_prefixes": [], - "destination_application_security_group_ids": [], - "destination_port_range": "443", - "destination_port_ranges": [], - "direction": "Inbound", - "name": "kube-apiserver-rule", - "priority": 100, - "protocol": "Tcp", - "source_address_prefix": "0.0.0.0/0", - "source_address_prefixes": [], - "source_application_security_group_ids": [], - "source_port_range": "*", - "source_port_ranges": [] - } - ], - "tags": {}, - "timeouts": null - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInJlYWQiOjMwMDAwMDAwMDAwMCwidXBkYXRlIjoxODAwMDAwMDAwMDAwfX0=", - "dependencies": [ - "module.networking.azurerm_resource_group.aks_rg" - ] - } - ] - }, - { - "module": "module.networking", - "mode": "managed", - "type": "azurerm_network_security_rule", - "name": "kube_apiserver_rule", - "provider": "provider[\"registry.terraform.io/hashicorp/azurerm\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "access": "Allow", - "description": "", - "destination_address_prefix": "*", - "destination_address_prefixes": [], - "destination_application_security_group_ids": [], - "destination_port_range": "443", - "destination_port_ranges": [], - "direction": "Inbound", - "id": "/subscriptions/9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f/resourceGroups/networking-resource-group/providers/Microsoft.Network/networkSecurityGroups/aks-nsg/securityRules/kube-apiserver-rule", - "name": "kube-apiserver-rule", - "network_security_group_name": "aks-nsg", - "priority": 100, - "protocol": "Tcp", - "resource_group_name": "networking-resource-group", - "source_address_prefix": "0.0.0.0/0", - "source_address_prefixes": [], - "source_application_security_group_ids": [], - "source_port_range": "*", - "source_port_ranges": [], - "timeouts": null - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInJlYWQiOjMwMDAwMDAwMDAwMCwidXBkYXRlIjoxODAwMDAwMDAwMDAwfX0=", - "dependencies": [ - "module.networking.azurerm_network_security_group.aks_nsg", - "module.networking.azurerm_resource_group.aks_rg" - ] - } - ] - }, - { - "module": "module.networking", - "mode": "managed", - "type": "azurerm_network_security_rule", - "name": "ssh_rule", - "provider": "provider[\"registry.terraform.io/hashicorp/azurerm\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "access": "Allow", - "description": "", - "destination_address_prefix": "*", - "destination_address_prefixes": [], - "destination_application_security_group_ids": [], - "destination_port_range": "22", - "destination_port_ranges": [], - "direction": "Inbound", - "id": "/subscriptions/9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f/resourceGroups/networking-resource-group/providers/Microsoft.Network/networkSecurityGroups/aks-nsg/securityRules/ssh-rule", - "name": "ssh-rule", - "network_security_group_name": "aks-nsg", - "priority": 101, - "protocol": "Tcp", - "resource_group_name": "networking-resource-group", - "source_address_prefix": "0.0.0.0/0", - "source_address_prefixes": [], - "source_application_security_group_ids": [], - "source_port_range": "*", - "source_port_ranges": [], - "timeouts": null - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInJlYWQiOjMwMDAwMDAwMDAwMCwidXBkYXRlIjoxODAwMDAwMDAwMDAwfX0=", - "dependencies": [ - "module.networking.azurerm_network_security_group.aks_nsg", - "module.networking.azurerm_resource_group.aks_rg" - ] - } - ] - }, - { - "module": "module.networking", - "mode": "managed", - "type": "azurerm_resource_group", - "name": "aks_rg", - "provider": "provider[\"registry.terraform.io/hashicorp/azurerm\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "id": "/subscriptions/9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f/resourceGroups/networking-resource-group", - "location": "uksouth", - "name": "networking-resource-group", - "tags": {}, - "timeouts": null - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo1NDAwMDAwMDAwMDAwLCJkZWxldGUiOjU0MDAwMDAwMDAwMDAsInJlYWQiOjMwMDAwMDAwMDAwMCwidXBkYXRlIjo1NDAwMDAwMDAwMDAwfX0=" - } - ] - }, - { - "module": "module.networking", - "mode": "managed", - "type": "azurerm_subnet", - "name": "control_plane_subnet", - "provider": "provider[\"registry.terraform.io/hashicorp/azurerm\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "address_prefix": "10.0.1.0/24", - "address_prefixes": [ - "10.0.1.0/24" - ], - "delegation": [], - "enforce_private_link_endpoint_network_policies": false, - "enforce_private_link_service_network_policies": false, - "id": "/subscriptions/9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f/resourceGroups/networking-resource-group/providers/Microsoft.Network/virtualNetworks/aks-vnet/subnets/control-plane-subnet", - "name": "control-plane-subnet", - "resource_group_name": "networking-resource-group", - "service_endpoint_policy_ids": [], - "service_endpoints": [], - "timeouts": null, - "virtual_network_name": "aks-vnet" - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInJlYWQiOjMwMDAwMDAwMDAwMCwidXBkYXRlIjoxODAwMDAwMDAwMDAwfX0=", - "dependencies": [ - "module.networking.azurerm_resource_group.aks_rg", - "module.networking.azurerm_virtual_network.aks_vnet" - ] - } - ] - }, - { - "module": "module.networking", - "mode": "managed", - "type": "azurerm_subnet", - "name": "worker_node_subnet", - "provider": "provider[\"registry.terraform.io/hashicorp/azurerm\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "address_prefix": "10.0.2.0/24", - "address_prefixes": [ - "10.0.2.0/24" - ], - "delegation": [], - "enforce_private_link_endpoint_network_policies": false, - "enforce_private_link_service_network_policies": false, - "id": "/subscriptions/9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f/resourceGroups/networking-resource-group/providers/Microsoft.Network/virtualNetworks/aks-vnet/subnets/worker-node-subnet", - "name": "worker-node-subnet", - "resource_group_name": "networking-resource-group", - "service_endpoint_policy_ids": [], - "service_endpoints": [], - "timeouts": null, - "virtual_network_name": "aks-vnet" - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInJlYWQiOjMwMDAwMDAwMDAwMCwidXBkYXRlIjoxODAwMDAwMDAwMDAwfX0=", - "dependencies": [ - "module.networking.azurerm_resource_group.aks_rg", - "module.networking.azurerm_virtual_network.aks_vnet" - ] - } - ] - }, - { - "module": "module.networking", - "mode": "managed", - "type": "azurerm_virtual_network", - "name": "aks_vnet", - "provider": "provider[\"registry.terraform.io/hashicorp/azurerm\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "address_space": [ - "10.0.0.0/16" - ], - "bgp_community": "", - "ddos_protection_plan": [], - "dns_servers": [], - "flow_timeout_in_minutes": 0, - "guid": "029f0d3a-d7e7-43d5-b310-6157890d507a", - "id": "/subscriptions/9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f/resourceGroups/networking-resource-group/providers/Microsoft.Network/virtualNetworks/aks-vnet", - "location": "uksouth", - "name": "aks-vnet", - "resource_group_name": "networking-resource-group", - "subnet": [ - { - "address_prefix": "10.0.1.0/24", - "id": "/subscriptions/9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f/resourceGroups/networking-resource-group/providers/Microsoft.Network/virtualNetworks/aks-vnet/subnets/control-plane-subnet", - "name": "control-plane-subnet", - "security_group": "" - }, - { - "address_prefix": "10.0.2.0/24", - "id": "/subscriptions/9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f/resourceGroups/networking-resource-group/providers/Microsoft.Network/virtualNetworks/aks-vnet/subnets/worker-node-subnet", - "name": "worker-node-subnet", - "security_group": "" - } - ], - "tags": {}, - "timeouts": null, - "vm_protection_enabled": false - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInJlYWQiOjMwMDAwMDAwMDAwMCwidXBkYXRlIjoxODAwMDAwMDAwMDAwfX0=", - "dependencies": [ - "module.networking.azurerm_resource_group.aks_rg" - ] - } - ] - } - ], + "resources": [], "check_results": null } From 5994611ff0d9a1a6cb9976f7ddaaea164f69f958 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji Date: Mon, 29 Jan 2024 15:00:53 +0000 Subject: [PATCH 37/47] Updates app.py file --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index 5652b43a..cd114e44 100644 --- a/app.py +++ b/app.py @@ -16,7 +16,7 @@ # Azure Key Vault settings -key_vault_name = os.environ["KEY_VAULT_NAME"] +key_vault_name = os.environ["Chy01245Vault"] kv_uri = f"https://{key_vault_name}.vault.azure.net" credential = DefaultAzureCredential() From dca8318e97882bdfb5ba5f037972bb3d9b2af330 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji Date: Wed, 31 Jan 2024 13:45:16 +0000 Subject: [PATCH 38/47] Updates app.py with vault name --- app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index cd114e44..1364626b 100644 --- a/app.py +++ b/app.py @@ -16,8 +16,8 @@ # Azure Key Vault settings -key_vault_name = os.environ["Chy01245Vault"] -kv_uri = f"https://{key_vault_name}.vault.azure.net" + +kv_uri = "https://chy01245vault.vault.azure.net/" credential = DefaultAzureCredential() client = SecretClient(vault_url=kv_uri, credential=credential) From b2de60b9e5680f5178ee32c8a9cf301dea5384ac Mon Sep 17 00:00:00 2001 From: Chichi Ugorji Date: Wed, 31 Jan 2024 15:11:58 +0000 Subject: [PATCH 39/47] Updates file with correct docker image name --- deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment.yaml b/deployment.yaml index a332a61c..48604e17 100644 --- a/deployment.yaml +++ b/deployment.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: flask-app-container - image: mayaaiuga/test-run-image:latest + image: chyjuls/web-delivery:v2.0 ports: - containerPort: 5000 # Expose the same port specified in your Dockerfile strategy: From 0c913c1d5486ec91beb62461a0e26ae7e60b3e60 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji <73576282+chyjuls@users.noreply.github.com> Date: Wed, 31 Jan 2024 15:15:02 +0000 Subject: [PATCH 40/47] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 219d96f5..56bb68d0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -13,10 +13,10 @@ steps: - task: Docker@2 inputs: containerRegistry: 'Docker Hub' - repository: 'mayaaiuga/devops-web-app' + repository: 'chyjuls/web-delivery' command: 'buildAndPush' Dockerfile: '**/Dockerfile' - tags: 'latest' + tags: 'v2.0' - task: KubernetesManifest@1 inputs: From 9d4db31d0c29c5578d7ccb9d25d6fdd6bbcef89a Mon Sep 17 00:00:00 2001 From: Chichi Ugorji <73576282+chyjuls@users.noreply.github.com> Date: Wed, 31 Jan 2024 15:26:53 +0000 Subject: [PATCH 41/47] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 95ba3934..0dff6548 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -23,6 +23,7 @@ steps: - task: KubernetesManifest@1 inputs: action: 'deploy' + rolloutStatusTimeout: 60s connectionType: 'azureResourceManager' azureSubscriptionConnection: 'Chinyere Ugorji DevOps(9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f)' azureResourceGroup: 'networking-resource-group' From 103924ae78cba02e0f4aeab08bc07edad213dede Mon Sep 17 00:00:00 2001 From: Chichi Ugorji <73576282+chyjuls@users.noreply.github.com> Date: Wed, 31 Jan 2024 15:40:16 +0000 Subject: [PATCH 42/47] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0dff6548..5c72db69 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -23,7 +23,7 @@ steps: - task: KubernetesManifest@1 inputs: action: 'deploy' - rolloutStatusTimeout: 60s + rolloutStatusTimeout: 60 connectionType: 'azureResourceManager' azureSubscriptionConnection: 'Chinyere Ugorji DevOps(9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f)' azureResourceGroup: 'networking-resource-group' From e1629fbd08405064545cf35326ed8cbc1abf7e28 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji <73576282+chyjuls@users.noreply.github.com> Date: Wed, 31 Jan 2024 15:43:56 +0000 Subject: [PATCH 43/47] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5c72db69..95ba3934 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -23,7 +23,6 @@ steps: - task: KubernetesManifest@1 inputs: action: 'deploy' - rolloutStatusTimeout: 60 connectionType: 'azureResourceManager' azureSubscriptionConnection: 'Chinyere Ugorji DevOps(9b6d204f-381b-4e09-8ce3-b10cfc7a5a4f)' azureResourceGroup: 'networking-resource-group' From 26523914645edc45748f7f0a779fe1c9dc061e42 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji <73576282+chyjuls@users.noreply.github.com> Date: Wed, 31 Jan 2024 15:49:09 +0000 Subject: [PATCH 44/47] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 95ba3934..40e95eb6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,7 +17,7 @@ steps: repository: 'chyjuls/web-delivery' command: 'buildAndPush' Dockerfile: '**/Dockerfile' - tags: 'v2.0' + tags: 'latest' - task: KubernetesManifest@1 From 90bb42e6b83842e06f59b16d3b6f30f5be74c387 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji Date: Wed, 31 Jan 2024 15:53:26 +0000 Subject: [PATCH 45/47] Updates both files with latest at image tag --- application-manifest.yaml | 2 +- deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application-manifest.yaml b/application-manifest.yaml index 54dd980e..2e7be5ab 100644 --- a/application-manifest.yaml +++ b/application-manifest.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: flask-app - image: chyjuls/web-delivery:v2.0 + image: chyjuls/web-delivery:latest ports: - containerPort: 5000 strategy: diff --git a/deployment.yaml b/deployment.yaml index 48604e17..7e9549f2 100644 --- a/deployment.yaml +++ b/deployment.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: flask-app-container - image: chyjuls/web-delivery:v2.0 + image: chyjuls/web-delivery:latest ports: - containerPort: 5000 # Expose the same port specified in your Dockerfile strategy: From 053fc4a30819754cad0ce3ad6e4baedf198ea186 Mon Sep 17 00:00:00 2001 From: Chichi Ugorji Date: Wed, 31 Jan 2024 16:04:03 +0000 Subject: [PATCH 46/47] Updates file with correct docker image tag --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 56bb68d0..939e97dc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -16,7 +16,7 @@ steps: repository: 'chyjuls/web-delivery' command: 'buildAndPush' Dockerfile: '**/Dockerfile' - tags: 'v2.0' + tags: 'latest' - task: KubernetesManifest@1 inputs: @@ -25,4 +25,4 @@ steps: azureSubscriptionConnection: 'aks-service-connection' azureResourceGroup: 'aks-rg' kubernetesCluster: 'aks-demo' - manifests: 'deployment.yaml' \ No newline at end of file + manifests: 'deployment.yaml' From b16375c4b6134bf33f71f3d5c99d225bdb20a3ac Mon Sep 17 00:00:00 2001 From: Chichi Ugorji Date: Wed, 31 Jan 2024 21:26:36 +0000 Subject: [PATCH 47/47] Updates the aks-terraform sub dir --- aks-terraform/terraform.tfstate.backup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aks-terraform/terraform.tfstate.backup b/aks-terraform/terraform.tfstate.backup index a3b0b612..a68a407b 100644 --- a/aks-terraform/terraform.tfstate.backup +++ b/aks-terraform/terraform.tfstate.backup @@ -1,7 +1,7 @@ { "version": 4, "terraform_version": "1.6.6", - "serial": 31, + "serial": 49, "lineage": "9fa196a3-ac0b-6f73-b86d-6aea533f1be0", "outputs": {}, "resources": [],