adding devops

used gemini to create the k8s/dockerfiles faster
This commit is contained in:
Smigz 2025-05-02 16:47:07 +00:00
parent 5c09c5a22f
commit 6c14a968c3
74 changed files with 2061 additions and 16 deletions

77
.github/workflows/build.yml vendored Normal file
View file

@ -0,0 +1,77 @@
name: Build Docker Images
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
# Checkout the repository
- name: Checkout code
uses: actions/checkout@v4
# Log into the GitHub Container Registry
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Define the list of project directories
- name: Set project list
id: set_projects
run: |
echo "projects<<EOF" >> $GITHUB_OUTPUT
echo "admin-dashboard" >> $GITHUB_OUTPUT
echo "battleship" >> $GITHUB_OUTPUT
echo "calculator" >> $GITHUB_OUTPUT
echo "cv" >> $GITHUB_OUTPUT
echo "cv-project" >> $GITHUB_OUTPUT
echo "inventory" >> $GITHUB_OUTPUT
echo "library" >> $GITHUB_OUTPUT
echo "messages" >> $GITHUB_OUTPUT
echo "nodejs-mini-message-board" >> $GITHUB_OUTPUT
echo "portfolio" >> $GITHUB_OUTPUT
echo "restaurant" >> $GITHUB_OUTPUT
echo "shopping-cart" >> $GITHUB_OUTPUT
echo "signup_form" >> $GITHUB_OUTPUT
echo "tictactoe" >> $GITHUB_OUTPUT
echo "todo" >> $GITHUB_OUTPUT
echo "weather" >> $GITHUB_OUTPUT
echo "auth-expressjs" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
# Build and push Docker images for changed projects
- name: Build and push Docker images
id: build_push
env:
PROJECTS: ${{ steps.set_projects.outputs.projects }}
run: |
# Loop through each project directory
for project in $(cat <<< "$PROJECTS"); do
# Check if the project has changes
if git diff --quiet HEAD^ HEAD -- "$project" || git diff --quiet HEAD^ HEAD -- "${project}/devops"; then
echo "Changes detected in project: $project"
# Set the image name dynamically using github context
image_name="ghcr.io/${{ github.repository_owner }}/$project:${{ github.sha }}"
# Build the docker image
echo "Building image: $image_name"
docker build -t "$image_name" "$project/devops"
# Push the docker image to the github container registry
echo "Pushing image: $image_name"
docker push "$image_name"
else
echo "No changes detected in project: $project"
fi
done

53
admin-dashboard/README.md Normal file
View file

@ -0,0 +1,53 @@
# Admin Dashboard Project
## Description
This project is a web application designed to display an admin dashboard. It utilizes HTML for structure, CSS for styling, and JavaScript for interactivity. The dashboard provides an overview of various metrics and data relevant to an administrator.
## Project Structure
- `index.html`: Main HTML file for the dashboard layout.
- `css/`: Directory containing CSS files for styling.
- `style.css`: Main stylesheet for the dashboard.
- `js/`: Directory containing JavaScript files for interactivity.
- `script.js`: JavaScript file for dashboard logic.
- `static/`: Directory containing static assets.
- `logo.png`: Dashboard logo.
## Local Development
### Prerequisites
- A web browser (e.g., Chrome, Firefox, Safari).
- A code editor (e.g., VS Code, Sublime Text).
### Build and Serve
This project is a static web application, so there is no build step involved. You can simply open the `index.html` file in your web browser to view the dashboard.
1. **Navigate to the Project Directory:**
```
bash
cd admin-dashboard
```
2. **Open `index.html` in Your Browser:**
Open `index.html` with your favorite browser.
You can navigate to the `index.html` file in your file explorer and then double click it to open it in your default browser.
### Development Workflow
1. **Edit Files:**
- Modify `index.html` to change the structure of the dashboard.
- Edit `css/style.css` to update the look and feel of the dashboard.
- Modify `js/script.js` to add or modify dashboard features.
2. **View Changes:**
- After making changes to the code, save the files.
- Refresh your browser to see the changes.
## Additional Notes
- Since this is a static web application, no server is required for local development.
- All changes made to the HTML, CSS, or JavaScript files will be immediately reflected in the browser upon refresh.
- To use this dashboard, simply open index.html.

View file

@ -0,0 +1,14 @@
# Use an official Nginx image as the base image
FROM nginx:alpine
# Set the working directory to /app inside the container
WORKDIR /app
# Copy the HTML, CSS, and JS files to the Nginx default directory
COPY . /usr/share/nginx/html
# Expose port 80 for the Nginx server
EXPOSE 80
# Command to start Nginx
CMD ["nginx", "-g", "daemon off;"]

View file

@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: admin-dashboard-deployment
spec:
replicas: 3
selector:
matchLabels:
app: admin-dashboard
template:
metadata:
labels:
app: admin-dashboard
spec:
containers:
- name: admin-dashboard
image: admin-dashboard:latest # Replace with your image name and tag
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: admin-dashboard-service
spec:
type: LoadBalancer
selector:
app: admin-dashboard
ports:
- protocol: TCP
port: 80
targetPort: 80

62
auth-expressjs/README.md Normal file
View file

@ -0,0 +1,62 @@
# Auth-ExpressJS Project
## Description
This project is a web application built with Express.js and Node.js, serving as an authentication server. It allows users to sign up and log in, managing user sessions and providing basic user authentication functionality.
## Prerequisites
- Node.js (v14 or later recommended)
- npm (usually comes with Node.js)
- PostgreSQL
## Installation
1. **Clone the repository:**
```
bash
git clone <repository-url>
cd auth-expressjs
```
2. **Install dependencies:**
```
bash
npm install
```
3. **Create database:**
Create a database in postgres
4. **Set up the database**
```
bash
psql -d <database-name> -f migrations/init.sql
```
## Running the Project
1. **Start the application:**
```
bash
npm start
```
This command starts the server, and you can access the application in your browser at `http://localhost:3000`.
- Make sure you change the db password and username in the app.js file
## Project Structure
- `src/`: Contains the main application code.
- `app.js`: The main application file where the Express.js server is set up.
- `views/`: Contains the EJS templates for the views.
- `migrations/`: Contains the sql file used to setup the database
- `package.json`: Lists the project dependencies and scripts.
- `package-lock.json`: Ensures consistent dependency versions across installations.
- `migrations`: database configuration files
## Usage
- **Sign Up:** Navigate to `http://localhost:3000/sign-up` to create a new account.
- **Log In:** Navigate to `http://localhost:3000/log-in` to log in with your credentials.
- **Home:** Navigate to `http://localhost:3000` to access the home page.

View file

@ -0,0 +1,20 @@
# Use an official Node.js runtime as the base image
FROM node:18-alpine
# Set the working directory in the container
WORKDIR /app
# Copy package.json and package-lock.json to the working directory
COPY package*.json ./
# Install production dependencies
RUN npm install --omit=dev
# Copy the rest of the application code to the working directory
COPY . .
# Expose the port the app runs on
EXPOSE 3000
# Define the command to run the application
CMD [ "npm", "start" ]

View file

@ -0,0 +1,41 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: auth-expressjs-deployment
spec:
replicas: 3
selector:
matchLabels:
app: auth-expressjs
template:
metadata:
labels:
app: auth-expressjs
spec:
containers:
- name: auth-expressjs
image: auth-expressjs:latest # Replace with your image name and tag
ports:
- containerPort: 3000
env:
- name: NODE_ENV
value: production
volumeMounts:
- mountPath: /app/src/data
name: data
volumes:
- name: data
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: auth-expressjs-service
spec:
selector:
app: auth-expressjs
type: LoadBalancer
ports:
- protocol: TCP
port: 80
targetPort: 3000

57
battleship/README.md Normal file
View file

@ -0,0 +1,57 @@
# Battleship
## Description
Battleship is a web-based game where players strategically place ships on a grid and attempt to sink their opponent's ships by guessing their locations. This project is a digital implementation of the classic board game, built using JavaScript.
## Local Development
### Prerequisites
- Node.js (with npm)
### Installation
1. **Navigate to the project directory:**
```
bash
cd battleship
```
2. **Install dependencies:**
```
bash
npm install
```
### Build
1. **Build the project:**
This project uses webpack to bundle the code.
```
bash
npm run build
```
### Run
1. **Start the development server:**
```
bash
npm start
```
2. **Open the game:**
Open your web browser and navigate to `http://localhost:8080` to play the game.
### Tests
1. **Run the test suite:**
```
bash
npm test
```
This command will run the test suite using jest.

View file

@ -0,0 +1,20 @@
# Stage 1: Build the application
FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build -- --config webpack.prod.js
# Stage 2: Serve the application with Nginx
FROM nginx:stable-alpine
COPY --from=builder /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

View file

@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: battleship-deployment
spec:
replicas: 3
selector:
matchLabels:
app: battleship
template:
metadata:
labels:
app: battleship
spec:
containers:
- name: battleship
image: ghcr.io/smiggiddy/odin-codeprojects/battleship:latest
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: battleship-service
spec:
type: LoadBalancer
selector:
app: battleship
ports:
- protocol: TCP
port: 80
targetPort: 80

52
calculator/README.md Normal file
View file

@ -0,0 +1,52 @@
# Calculator Project
## Description
This project is a web-based calculator application built using HTML, CSS, and JavaScript. It allows users to perform basic arithmetic operations like addition, subtraction, multiplication, and division.
## Features
- **Basic Operations:** Perform addition, subtraction, multiplication, and division.
- **Clear Functionality:** Clear the display with a press of a button.
- **Responsive Design:** Designed to work on various screen sizes.
## Local Development
### Prerequisites
- Web browser (e.g., Chrome, Firefox, Safari)
### Setup
1. **Clone the repository:**
If you haven't already, clone this repository to your local machine.
2. **Navigate to the project directory:**
```
bash
cd calculator
```
### Running the Project
1. **Open `index.html`:**
- Open the `index.html` file in your web browser.
- You can do this by right-clicking the file and selecting "Open with" and then your preferred browser.
2. **Interact with the Calculator:**
- Use your mouse or keyboard to interact with the calculator buttons.
- The result will be displayed on the calculator's display area.
### File Structure
```
calculator/
├── css/
│ └── style.css # CSS styles for the calculator
├── js/
│ └── script.js # JavaScript code for calculator logic
├── index.html # Main HTML file
└── faviocon.svg # icon
```
## Contributing
Contributions are welcome! If you'd like to contribute, please fork the repository and submit a pull request.

View file

@ -0,0 +1,14 @@
# Use an official Nginx image as the base image
FROM nginx:latest
# Remove default Nginx files
RUN rm -rf /usr/share/nginx/html/*
# Copy the project files to the Nginx default directory
COPY . /usr/share/nginx/html
# Expose port 80
EXPOSE 80
# Start Nginx when the container starts
CMD ["nginx", "-g", "daemon off;"]

View file

@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: calculator-deployment
spec:
replicas: 3
selector:
matchLabels:
app: calculator
template:
metadata:
labels:
app: calculator
spec:
containers:
- name: calculator
image: ghcr.io/smiggiddy/odin-codeprojects/calculator:latest
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: calculator-service
spec:
type: LoadBalancer
selector:
app: calculator
ports:
- protocol: TCP
port: 80
targetPort: 80

44
csci/README.md Normal file
View file

@ -0,0 +1,44 @@
# CSCI Project
This project contains various JavaScript implementations of common computer science algorithms and data structures.
## Files
- **fib.js**: Contains code related to the Fibonacci sequence.
- **knightsTravials.js**: Contains code related to the Knight's Travails problem.
- **linkedList.js**: Contains code related to Linked List data structures.
- **mergeSort.js**: Contains code related to the Merge Sort algorithm.
- **projectBTS.js**: Contains code related to Binary Tree Structures
- **projectHashMap.js**: Contains code related to HashMap data structure.
- **projectHashSet.js**: Contains code related to HashSet data structures.
## Running the Project
To run the code in this project, you will need to have Node.js installed on your system.
1. **Install Node.js**: If you do not already have Node.js installed, download it from the official website and follow the installation instructions.
2. **Navigate to the Directory**: Open your terminal or command prompt and navigate to the `csci` directory.
```
bash
cd csci
```
3. **Run the Files**: You can run each JavaScript file individually using Node.js. For example, to run `fib.js`, use the following command:
```
bash
node fib.js
```
Repeat this step for each file you want to run:
```
bash
node knightsTravials.js
node linkedList.js
node mergeSort.js
node projectBTS.js
node projectHashMap.js
node projectHashSet.js
```
Each file contains its own set of operations and instructions, follow the console output in order to see the results of the operation.

View file

@ -1,8 +1,10 @@
# React + Vite # CV Project
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. This project is a web application built using React. It is designed to showcase a digital CV or resume.
Currently, two official plugins are available: ## Local Development
To run this project locally, follow these steps:
1. **Clone the repository:**
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

View file

@ -0,0 +1,35 @@
# Use a Node.js image as the base for building the React app
FROM node:18-alpine AS builder
# Set the working directory
WORKDIR /app
# Copy package.json and package-lock.json to install dependencies
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application code
COPY . .
# Build the React app using Vite
RUN npm run build
# Use an official Nginx image to serve the static files
FROM nginx:stable-alpine
# Set the working directory
WORKDIR /usr/share/nginx/html
# Remove default Nginx static files
RUN rm -rf ./*
# Copy the build output from the builder stage
COPY --from=builder /app/dist .
# Expose port 80
EXPOSE 80
# Start Nginx
CMD ["nginx", "-g", "daemon off;"]

View file

@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: cv-project-deployment
spec:
replicas: 2
selector:
matchLabels:
app: cv-project
template:
metadata:
labels:
app: cv-project
spec:
containers:
- name: cv-project
image: ghcr.io/smiggiddy/odin-codeprojects/cv-project:latest
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: cv-project-service
spec:
selector:
app: cv-project
ports:
- protocol: TCP
port: 80
targetPort: 80
type: LoadBalancer

30
cv/README.md Normal file
View file

@ -0,0 +1,30 @@
# CV Project
This project is a web application designed to display a curriculum vitae (CV) or resume. It's built using HTML, CSS, and JavaScript to provide a dynamic and interactive presentation of personal and professional information.
## Project Structure
- `index.html`: The main HTML file that structures the web page content.
- `css/style.css`: The stylesheet used to visually format the CV.
- `js/script.js`: Contains JavaScript code for interactive elements and functionality.
- `assets/`: This folder contains the compiled production react code.
- `icon.svg`: The icon for the project.
- `vite.svg`: The vite logo used in the project.
## Running the Project Locally
To view and run this CV project on your local machine, follow these steps:
1. **Clone the Repository**
If you haven't already, clone the project repository to your local machine using git.
2. **Open `index.html`**
Navigate to the project directory in your file explorer and double-click on the `index.html` file. This will open the CV in your default web browser.
## Project Overview
This project provides a clean and modern way to present a CV online. It leverages web technologies to create a visually appealing and functional document.
## Additional Notes
- No specific server setup is required to run this project locally, as it is primarily a client-side application.
- All dependencies and code are self-contained within the project directory.

16
cv/devops/Dockerfile Normal file
View file

@ -0,0 +1,16 @@
# Use an official Nginx image as the base image
FROM nginx:latest
# Set the working directory to /app
WORKDIR /app
# Copy the HTML, CSS, and JavaScript files to the Nginx default directory
COPY index.html /usr/share/nginx/html/
COPY css/ /usr/share/nginx/html/css/
COPY assets/ /usr/share/nginx/html/assets/
# Expose port 80 to the outside world
EXPOSE 80
# Start Nginx
CMD ["nginx", "-g", "daemon off;"]

32
cv/devops/deployment.yaml Normal file
View file

@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: cv-deployment
spec:
replicas: 1
selector:
matchLabels:
app: cv
template:
metadata:
labels:
app: cv
spec:
containers:
- name: cv-app
image: ghcr.io/smiggiddy/odin-codeprojects/cv:latest
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: cv-service
spec:
type: LoadBalancer
selector:
app: cv
ports:
- protocol: TCP
port: 80
targetPort: 80

6
deploy/chart/Chart.yaml Normal file
View file

@ -0,0 +1,6 @@
apiVersion: v2
name: odin-projects-root
description: A Helm chart for deploying the root Argo CD application to manage Odin projects.
type: application
version: 0.1.0
appVersion: "1.0.0"

View file

@ -0,0 +1,19 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: admin-dashboard
namespace: argocd
spec:
project: default
source:
repoURL: {{ .Values.repoUrl }}
path: admin-dashboard/devops
targetRevision: {{ .Values.targetRevision }}
destination:
server: {{ .Values.targetServer }}
namespace: {{ .Values.targetNamespace }}
syncPolicy:
automated:
prune: true
syncOptions:
- CreateNamespace=true

View file

@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: auth-expressjs
namespace: argocd
spec:
project: default
source:
repoURL: {{ .Values.repoUrl }}
path: auth-expressjs/devops
targetRevision: {{ .Values.targetRevision }}
destination:
server: {{ .Values.targetServer }}
namespace: {{ .Values.targetNamespace }}
syncPolicy:
automated:
prune: true
selfHeal: true

View file

@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: battleship
namespace: argocd
spec:
project: default
source:
repoURL: {{ .Values.repoUrl }}
path: battleship/devops
targetRevision: {{ .Values.targetRevision }}
destination:
server: {{ .Values.targetServer }}
namespace: {{ .Values.targetNamespace }}
syncPolicy:
automated:
prune: true
selfHeal: true

View file

@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: calculator
namespace: argocd
spec:
project: default
source:
repoURL: {{ .Values.repoUrl }}
path: calculator/devops
targetRevision: {{ .Values.targetRevision }}
destination:
server: {{ .Values.targetServer }}
namespace: {{ .Values.targetNamespace }}
syncPolicy:
automated:
prune: true
selfHeal: true

View file

@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: cv # Updated to match instruction
namespace: argocd
spec:
project: default
source:
repoURL: {{ .Values.repoUrl }} # Updated to match instruction
path: cv/devops
targetRevision: {{ .Values.targetRevision }} # Updated to match instruction
destination:
server: {{ .Values.targetServer }}
namespace: {{ .Values.targetNamespace }} # Updated to match instruction
syncPolicy:
automated:
prune: true
selfHeal: true

View file

@ -0,0 +1,19 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: cv-project
namespace: argocd
spec:
project: default
source:
repoURL: {{ .Values.repoUrl }}
path: cv-project/devops
targetRevision: {{ .Values.targetRevision }}
destination:
server: {{ .Values.targetServer }}
namespace: {{ .Values.targetNamespace }}
syncPolicy:
automated:
prune: true
syncOptions:
- CreateNamespace=true

View file

@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: inventory # this will be set to the project name
namespace: argocd
spec:
project: default
source:
repoURL: {{ .Values.repoUrl }}
path: inventory/devops
targetRevision: {{ .Values.targetRevision }}
destination:
server: {{ .Values.targetServer }}
namespace: {{ .Values.targetNamespace }}
syncPolicy:
automated:
prune: true
selfHeal: true

View file

@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: library
namespace: argocd
spec:
project: default
source:
repoURL: {{ .Values.repoUrl }}
path: library/devops
targetRevision: {{ .Values.targetRevision }}
destination:
server: {{ .Values.targetServer }}
namespace: {{ .Values.targetNamespace }}
syncPolicy:
automated:
prune: true
selfHeal: true

View file

@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: messages # Updated name
namespace: argocd
spec:
project: default
source:
repoURL: {{ .Values.repoUrl }} #Templated repo URL
path: messages/devops
targetRevision: {{ .Values.targetRevision }} # Templated target revision
destination:
server: {{ .Values.targetServer }}
namespace: {{ .Values.targetNamespace }} # Templated destination namespace
syncPolicy:
automated:
prune: true
selfHeal: true

View file

@ -0,0 +1,20 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: nodejs-mini-message-board
namespace: argocd
spec:
project: default
source:
repoURL: {{ .Values.repoUrl }}
path: nodejs-mini-message-board/devops
targetRevision: {{ .Values.targetRevision }}
destination:
server: {{ .Values.targetServer }}
namespace: {{ .Values.targetNamespace }}
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true

View file

@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: portfolio
namespace: argocd
spec:
project: default
source:
repoURL: {{ .Values.repoUrl }}
path: portfolio/devops
targetRevision: {{ .Values.targetRevision }}
destination:
server: {{ .Values.targetServer }}
namespace: {{ .Values.targetNamespace }}
syncPolicy:
automated:
prune: true
selfHeal: true

View file

@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: restaurant
namespace: argocd
spec:
project: default
source:
repoURL: {{ .Values.repoUrl }}
path: restaurant/devops
targetRevision: {{ .Values.targetRevision }}
destination:
server: {{ .Values.targetServer }}
namespace: {{ .Values.targetNamespace }}
syncPolicy:
automated:
prune: true
selfHeal: true

View file

@ -0,0 +1,19 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: shopping-cart
namespace: argocd
spec:
project: default
source:
repoURL: {{ .Values.repoUrl }}
path: shopping-cart/devops
targetRevision: {{ .Values.targetRevision }}
destination:
server: {{ .Values.targetServer }}
namespace: {{ .Values.targetNamespace }}
syncPolicy:
automated:
prune: true
syncOptions:
- CreateNamespace=true

View file

@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: signup-form
namespace: argocd
spec:
project: default
source:
repoURL: '{{ .Values.repoUrl }}'
path: signup_form/devops
targetRevision: '{{ .Values.targetRevision }}'
destination:
server: '{{ .Values.targetServer }}'
namespace: '{{ .Values.targetNamespace }}'
syncPolicy:
automated:
prune: true
selfHeal: true

View file

@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: tictactoe
namespace: argocd
spec:
project: default
source:
repoURL: {{ .Values.repoUrl }}
path: tictactoe/devops
targetRevision: {{ .Values.targetRevision }}
destination:
server: {{ .Values.targetServer }}
namespace: {{ .Values.targetNamespace }}
syncPolicy:
automated:
prune: true
selfHeal: true

View file

@ -0,0 +1,19 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: todo
namespace: argocd
spec:
project: default
source:
repoURL: {{ .Values.repoUrl }}
path: todo/devops
targetRevision: {{ .Values.targetRevision }}
destination:
server: {{ .Values.targetServer }}
namespace: {{ .Values.targetNamespace }}
syncPolicy:
automated:
prune: true
selfHeal: true

View file

@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: weather
namespace: argocd
spec:
project: default
source:
repoURL: {{ .Values.repoUrl }}
path: weather/devops
targetRevision: {{ .Values.targetRevision }}
destination:
server: {{ .Values.targetServer }}
namespace: {{ .Values.targetNamespace }}
syncPolicy:
automated:
prune: true
selfHeal: true

4
deploy/chart/values.yaml Normal file
View file

@ -0,0 +1,4 @@
repoUrl: https://github.com/smiggiddy/odin-codeprojects
targetRevision: HEAD
targetNamespace: default
targetServer: https://kubernetes.default.svc

View file

@ -0,0 +1,20 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: odin-projects
namespace: argocd
spec:
project: default
source:
repoURL: {{ .Values.repoUrl }}
path: deploy
targetRevision: {{ .Values.targetRevision }}
destination:
server: https://kubernetes.default.svc
namespace: argocd
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- PruneLast=true

49
inventory/README.md Normal file
View file

@ -0,0 +1,49 @@
# Inventory Project
## Description
The Inventory project is a web application built with Node.js and Express.js. It's designed to manage and track inventory items. This application allows users to add, view, edit, and delete items in the inventory.
## Prerequisites
- Node.js (v18 or later)
- npm (comes with Node.js)
- PostgreSQL (version 13 or later)
## Setup
1. **Clone the repository:**
```
bash
git clone <repository-url>
cd inventory
```
2. **Install dependencies:**
```
bash
npm install
```
3. **Set up the database:**
- Ensure you have PostgreSQL running.
- Create a database named `inventory_db` (or you can name it whatever you want and update the `config.js` file).
- Update the database connection details in `src/config.js`.
- Run the database setup script:
```
bash
node src/db/setupDb.js
```
This will create the table and insert some sample data.
4. **Run the app**
```
bash
node src/app.js
```
5. **View the App**
Open a browser and go to: http://localhost:3000
## Project Structure

View file

@ -0,0 +1,32 @@
# Use an official Node.js runtime as the base image
FROM oven/bun:latest as builder
# Set the working directory in the container
WORKDIR /app
# Copy package.json and package-lock.json to the working directory
COPY package.json bun.lockb ./
# Install dependencies
RUN bun install --production
# Copy the rest of the application files to the working directory
COPY . .
# Build the application
# RUN bun run build
# Use an official Node.js runtime as the base image
FROM oven/bun:latest
# Set the working directory in the container
WORKDIR /app
# Copy the application files from the builder stage
COPY --from=builder /app .
# Expose the port that the app runs on
EXPOSE 3000
# Define the command to run your application
CMD ["bun", "run", "src/app.js"]

View file

@ -0,0 +1,35 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: inventory-deployment
spec:
replicas: 3
selector:
matchLabels:
app: inventory
template:
metadata:
labels:
app: inventory
spec:
containers:
- name: inventory
image: ghcr.io/smiggiddy/odin-codeprojects/inventory:latest
ports:
- containerPort: 3000
env:
- name: NODE_ENV
value: production
---
apiVersion: v1
kind: Service
metadata:
name: inventory-service
spec:
type: LoadBalancer
selector:
app: inventory
ports:
- protocol: TCP
port: 80
targetPort: 3000

24
library/README.md Normal file
View file

@ -0,0 +1,24 @@
# Library Project
## Description
This is a web application that allows users to manage a personal library of books. It's built using HTML, CSS, and JavaScript.
## How to Run Locally
1. **Open `index.html`:** Navigate to the `library` directory in your file explorer and open the `index.html` file in your web browser.
2. **View the Application:** The library application will now be running in your browser. You can interact with the application directly from the browser.
3. **Javascript Logic:** The logic for the application is within the `js/script.js` file.
4. **Styling:** The style for the application is in `css/style.css`
## Project Structure
* `index.html`: The main HTML file for the application.
* `css/`: Directory containing the CSS files.
* `style.css`: CSS file for styling the application.
* `js/`: Directory containing the JavaScript files.
* `script.js`: JavaScript file containing the application logic.
## Additional Notes
* No server or special environment is required to run this application locally. Simply open the `index.html` in your web browser.

20
library/devops/Dockerfile Normal file
View file

@ -0,0 +1,20 @@
# Use an official Nginx image as the base image
FROM nginx:latest
# Remove default Nginx configuration
RUN rm /etc/nginx/conf.d/default.conf
# Copy custom Nginx configuration
COPY nginx.conf /etc/nginx/conf.d
# Set the working directory in the container
WORKDIR /usr/share/nginx/html
# Copy the project files into the container's directory
COPY . .
# Expose port 80 to the outside world
EXPOSE 80
# Start Nginx when the container starts
CMD ["nginx", "-g", "daemon off;"]

View file

@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: library-deployment
spec:
replicas: 3
selector:
matchLabels:
app: library
template:
metadata:
labels:
app: library
spec:
containers:
- name: library
image: ghcr.io/smiggiddy/odin-codeprojects/library:latest
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: library-service
spec:
type: LoadBalancer
selector:
app: library
ports:
- protocol: TCP
port: 80
targetPort: 80

49
messages/README.md Normal file
View file

@ -0,0 +1,49 @@
# Messages Project
## Description
The Messages project is a simple web-based message board application built using Node.js and Express.js. It allows users to create and view messages.
## Local Development Setup
Follow these steps to run the project locally:
1. **Clone the Repository:**
```
bash
git clone <repository-url>
cd messages
```
2. **Install Dependencies:**
```
bash
npm install
```
3. **Database Setup**
The project utilizes a database to persist messages.
* Install postgres if not already present.
* Create a database and modify the config.js file accordingly
```
# In the project directory
psql < src/models/init.sql
```
4. **Run the Application:**
```
bash
node src/app.js
```
5. **View the Application:**
Open your web browser and go to `http://localhost:3000` to see the application.
## Additional Notes
* Ensure that Node.js and npm are installed on your machine.
* You can modify the application by editing the files in the `src` directory.
* Make sure to refer to `src/config.js` to configure the correct database and ports.

View file

@ -0,0 +1,20 @@
# Use an official Node.js runtime as the base image
FROM node:18-alpine
# Set the working directory to /app inside the container
WORKDIR /app
# Copy package.json and package-lock.json to the working directory
COPY package*.json ./
# Install any dependencies
RUN npm install --production
# Copy the rest of the application code
COPY . .
# Expose port 3000 for the Express app
EXPOSE 3000
# Define the command to start the application
CMD [ "npm", "start" ]

View file

@ -0,0 +1,36 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: messages-deployment
spec:
replicas: 3
selector:
matchLabels:
app: messages
template:
metadata:
labels:
app: messages
spec:
containers:
- name: messages
image: ghcr.io/smiggiddy/odin-codeprojects/messages:latest
ports:
- containerPort: 3000
env:
- name: NODE_ENV
value: production
# add any other needed environment variables here
---
apiVersion: v1
kind: Service
metadata:
name: messages-service
spec:
selector:
app: messages
type: LoadBalancer
ports:
- protocol: TCP
port: 80
targetPort: 3000

View file

@ -0,0 +1,60 @@
# Node.js Mini Message Board
## Description
This project is a simple message board web application built using Node.js and Express.js. Users can view messages and add their own.
## Installation and Setup
1. **Clone the repository:**
```
bash
git clone <repository-url>
```
2. **Navigate to the project directory:**
```
bash
cd nodejs-mini-message-board
```
3. **Install dependencies:**
```
bash
npm install
```
4. **Initialize the database:**
```
bash
node src/db/seedDb.js
```
## Running the Application
1. **Start the server:**
```
bash
npm start
```
2. **Open in browser:**
Open your web browser and go to `http://localhost:3000` to view the application.
## Usage
Once the application is running, you can:
* View existing messages on the main page.
* Add a new message by clicking the "New Message" button and filling out the form.
## Project Structure
* `src/`: Contains the source code of the application.
* `app.js`: The main application file.
* `controllers/`: Contains the controller files.
* `db/`: Contains files related to the database.
* `public/`: Contains static files (CSS, JavaScript).
* `routes/`: Contains the route files.
* `views/`: Contains the view files (EJS templates).
* `package.json`: Contains project metadata and dependencies.

View file

@ -0,0 +1,20 @@
# Use an official Node.js runtime as the base image
FROM node:18-alpine
# Set the working directory to /app inside the container
WORKDIR /app
# Copy package.json and package-lock.json to the working directory
COPY package*.json ./
# Install any needed dependencies using production command
RUN npm install --production
# Copy the rest of the application code to the working directory
COPY . .
# Expose the port the app runs on
EXPOSE 3000
# Define the command to run your app
CMD [ "node", "src/app.js" ]

View file

@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: nodejs-mini-message-board-deployment
spec:
replicas: 3
selector:
matchLabels:
app: nodejs-mini-message-board
template:
metadata:
labels:
app: nodejs-mini-message-board
spec:
containers:
- name: nodejs-mini-message-board
image: ghcr.io/smiggiddy/odin-codeprojects/nodejs-mini-message-board:latest
ports:
- containerPort: 3000
---
apiVersion: v1
kind: Service
metadata:
name: nodejs-mini-message-board-service
spec:
type: LoadBalancer
selector:
app: nodejs-mini-message-board
ports:
- protocol: TCP
port: 80
targetPort: 3000

12
portfolio/README.md Normal file
View file

@ -0,0 +1,12 @@
# Portfolio Project
This is a static portfolio website built using HTML and CSS. It showcases my skills and projects.
## Viewing Locally
To view the project locally, follow these steps:
1. **Clone the repository:** If you haven't already, clone the repository to your local machine.
2. **Open `index.html`:** Navigate to the project directory in your file explorer and open the `index.html` file in your preferred web browser.
That's it! You should now be able to view the portfolio website in your browser.

View file

@ -0,0 +1,11 @@
# Use the official nginx image as the base image
FROM nginx:latest
# Copy the HTML and CSS files to the default nginx directory
COPY . /usr/share/nginx/html
# Expose port 80 to the outside world
EXPOSE 80
# Start nginx when the container starts
CMD ["nginx", "-g", "daemon off;"]

View file

@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: portfolio-deployment
spec:
replicas: 3
selector:
matchLabels:
app: portfolio
template:
metadata:
labels:
app: portfolio
spec:
containers:
- name: portfolio
image: ghcr.io/smiggiddy/odin-codeprojects/portfolio:latest
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: portfolio-service
spec:
selector:
app: portfolio
ports:
- protocol: TCP
port: 80
targetPort: 80
type: LoadBalancer

60
restaurant/README.md Normal file
View file

@ -0,0 +1,60 @@
# Restaurant Project
## Description
This project is a multi-page web application for a restaurant. It utilizes HTML, CSS, and JavaScript to create a dynamic and interactive user experience. The application features several pages including a menu, contact and a home page.
## Getting Started
Follow these instructions to get the project up and running on your local machine.
### Prerequisites
- Web Browser (Chrome, Firefox, Safari, etc.)
- Text editor or IDE (VSCode, Sublime Text, Atom, etc.)
### Installation
1. **Clone the Repository**
```
bash
git clone [repository URL]
cd restaurant
```
2. **Install Dependencies**
```
bash
cd app
npm install
```
### Build
To build the application:
```
bash
npm run build
```
### Running Locally
To run the application:
```
bash
npm start
```
This command will bundle the application with webpack and serve the file to your browser at `http://localhost:8080`.
## Project Structure
- `index.html`: The main HTML file.
- `src/`: Contains the JavaScript, CSS, and asset files.
- `src/index.js`: The main javascript file.
- `dist/`: Contains the bundle.js file.
## Contributing
Contributions are welcome! Please read the contributing guidelines before getting started.
## License
This project is licensed under the MIT License - see the LICENSE.md file for details.

View file

@ -0,0 +1,35 @@
# Use a Node.js base image to build the project
FROM node:18-alpine AS builder
# Set the working directory
WORKDIR /app
# Copy package.json and package-lock.json (if present)
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application code
COPY . .
# Build the application using webpack
RUN npm run build -- --config app/webpack.config.js
# Use an Nginx base image to serve the static files
FROM nginx:alpine
# Set the working directory
WORKDIR /usr/share/nginx/html
# Remove default nginx static files
RUN rm -rf ./*
# Copy the built files from the builder stage
COPY --from=builder /app/dist .
# Expose port 80
EXPOSE 80
# Start Nginx
CMD ["nginx", "-g", "daemon off;"]

View file

@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: restaurant-deployment
spec:
replicas: 3
selector:
matchLabels:
app: restaurant
template:
metadata:
labels:
app: restaurant
spec:
containers:
- name: restaurant
image: ghcr.io/smiggiddy/odin-codeprojects/restaurant:latest
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: restaurant-service
spec:
selector:
app: restaurant
type: LoadBalancer
ports:
- protocol: TCP
port: 80
targetPort: 80

View file

@ -1,8 +1,17 @@
# React + Vite # Shopping Cart Project
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. ## Description
This project is a web application for an online shopping cart, built using React. It allows users to browse products, add them to a cart, and manage their cart contents.
Before you begin, ensure you have the following installed:
* **Node.js**: Make sure you have Node.js installed. You can download it from [https://nodejs.org/](https://nodejs.org/).
* **npm**: npm comes bundled with Node.js, so you should have it automatically.
## Getting Started
1. **Clone the repository**:
Currently, two official plugins are available:
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

View file

@ -0,0 +1,19 @@
# Stage 1: Build the React application
FROM node:18-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
# Stage 2: Serve the application with Nginx
FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

View file

@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: shopping-cart-deployment
spec:
replicas: 3
selector:
matchLabels:
app: shopping-cart
template:
metadata:
labels:
app: shopping-cart
spec:
containers:
- name: shopping-cart
image: ghcr.io/smiggiddy/odin-codeprojects/shopping-cart:latest
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: shopping-cart-service
spec:
selector:
app: shopping-cart
ports:
- protocol: TCP
port: 80
targetPort: 80
type: LoadBalancer

20
signup_form/README.md Normal file
View file

@ -0,0 +1,20 @@
# Signup Form Project
## Description
This project is a simple web-based signup form. It's built using HTML for structure, CSS for styling, and JavaScript for interactivity. The form allows users to enter their personal information and submit it.
## How to View Locally
1. **Open `index.html`:** Navigate to the project directory in your file explorer and open the `index.html` file in your preferred web browser.
2. **View in browser**: The page should automatically load.
## Project Structure
* `index.html`: The main HTML file containing the structure of the form.
* `css/style.css`: The CSS file for styling the form.
* `js/script.js`: The JavaScript file that handles form interactivity.
* `static/`: contains static files like images.
## Notes
The form does not include backend code to save data.

View file

@ -0,0 +1,17 @@
# Use an official Nginx image as the base image
FROM nginx:latest
# Set the working directory to /app inside the container
WORKDIR /app
# Copy the HTML, CSS, and JavaScript files from the current directory to /app
COPY . /app
# Copy the Nginx configuration file to /etc/nginx/conf.d/
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
# Expose port 80 for HTTP traffic
EXPOSE 80
# Command to run when the container starts
CMD ["nginx", "-g", "daemon off;"]

View file

@ -0,0 +1,33 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: signup-form-deployment
spec:
replicas: 3
selector:
matchLabels:
app: signup-form
template:
metadata:
labels:
app: signup-form
spec:
containers:
- name: signup-form
image: ghcr.io/smiggiddy/odin-codeprojects/signup-form:latest
ports:
- containerPort: 80
imagePullPolicy: IfNotPresent
---
apiVersion: v1
kind: Service
metadata:
name: signup-form-service
spec:
selector:
app: signup-form
type: LoadBalancer
ports:
- protocol: TCP
port: 80
targetPort: 80

View file

@ -1,5 +1,16 @@
# webpack-template # Testing Project
Vanilla template for webpack This project is a JavaScript testing suite designed to provide a framework for writing and running tests for JavaScript applications. It leverages Webpack for bundling and utilizes testing libraries for executing tests.
## Project Structure
- `src/`: Contains the source code for the application being tested and the test files themselves.
- `tests/`: test files are contained here.
- `webpack.common.js`: Common Webpack configuration.
- `webpack.dev.js`: Webpack configuration for development.
- `webpack.prod.js`: Webpack configuration for production.
## Setup
1. **Install Dependencies:**
sets up common utilities needed for vanilla JS/HTML/CSS development

22
tictactoe/README.md Normal file
View file

@ -0,0 +1,22 @@
# Tic Tac Toe
## Description
This is a simple Tic Tac Toe web application built using HTML, CSS, and JavaScript. Players can take turns marking spaces in a 3x3 grid, and the game will automatically detect a win or a draw.
## How to Run Locally
1. **Clone the Repository**
If you haven't already, clone the repository to your local machine.
2. **Open `index.html`**
Navigate to the project directory in your file explorer and open the `index.html` file in your web browser.
3. **Play**
You can now play Tic Tac Toe in your browser. Click on the empty cells to make your move.
## Project Structure
- `index.html`: The main HTML file for the game.
- `css/style.css`: Contains the styling for the game's interface.
- `js/main.js`: Contains the JavaScript code for the game logic.

View file

@ -0,0 +1,13 @@
# Use an official Nginx image as the base image
FROM nginx:latest
# Set the working directory to /app
WORKDIR /app
# Copy the HTML, CSS, and JavaScript files to the Nginx default directory
COPY . /usr/share/nginx/html
# Expose port 80 to allow external access
EXPOSE 80
# The Nginx server will start automatically when the container starts

View file

@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: tictactoe-deployment
spec:
replicas: 3
selector:
matchLabels:
app: tictactoe
template:
metadata:
labels:
app: tictactoe
spec:
containers:
- name: tictactoe-container
image: ghcr.io/smiggiddy/odin-codeprojects/tictactoe:latest
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: tictactoe-service
spec:
selector:
app: tictactoe
type: LoadBalancer
ports:
- protocol: TCP
port: 80
targetPort: 80

60
todo/README.md Normal file
View file

@ -0,0 +1,60 @@
# Todo Project
This is a web application that allows you to create and manage a todo list.
## Description
This project allows you to create, edit, and delete tasks from a todo list. The project utilizes Javascript, HTML, and CSS.
## Features
* Add new tasks to the todo list.
* Mark tasks as complete.
* Delete tasks from the todo list.
## Local Development
To run this project locally, follow these steps:
1. **Clone the repository:**
```
bash
git clone <repository_url>
```
2. **Navigate to the project directory:**
```
bash
cd todo
```
3. **Open `index.html`:** Open the `index.html` file in your web browser.
## Build
The build of this project is handled through webpack.
1. **Install Dependencies:**
```
bash
npm install
```
2. **Run Build:**
```
bash
npm run build
```
After running build, a `bundle.js` will be generated.
## Usage
Once you have the project running, you can use the interface in your browser to interact with the todo list.
## Technologies Used
* HTML
* CSS
* JavaScript
* webpack

38
todo/devops/Dockerfile Normal file
View file

@ -0,0 +1,38 @@
# Use an official Node.js runtime as the base image
FROM node:18-alpine as builder
# Set the working directory in the container
WORKDIR /app
# Copy package.json and package-lock.json to the working directory
COPY package*.json ./
# Install any needed dependencies
RUN npm install
# Copy the rest of the application code
COPY . .
# Build the application
RUN npm run build
# Use an official Nginx runtime as the base image
FROM nginx:stable-alpine
# Set the working directory in the container
WORKDIR /usr/share/nginx/html
# Remove default nginx static files
RUN rm -rf ./*
# Copy static files from the builder stage
COPY --from=builder /app/dist .
# Copy the nginx configuration file
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
# Expose port 80
EXPOSE 80
# Command to run when starting the container
CMD ["nginx", "-g", "daemon off;"]

View file

@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: todo-deployment
spec:
replicas: 3
selector:
matchLabels:
app: todo
template:
metadata:
labels:
app: todo
spec:
containers:
- name: todo
image: ghcr.io/smiggiddy/odin-codeprojects/todo:latest
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: todo-service
spec:
selector:
app: todo
ports:
- protocol: TCP
port: 80
targetPort: 80
type: LoadBalancer

View file

@ -1,5 +1,15 @@
# webpack-template # Weather Project
Vanilla template for webpack This project is a web application that allows you to search for weather information for different locations. It is built using HTML, CSS, and JavaScript.
## Features
* Search for weather by city name.
* Displays current weather conditions.
## Local Development
To run this project locally, follow these steps:
1. **Clone the repository:**
sets up common utilities needed for vanilla JS/HTML/CSS development

35
weather/devops/Dockerfile Normal file
View file

@ -0,0 +1,35 @@
# Use a Node.js base image to build the project
FROM node:18-alpine as builder
# Set the working directory
WORKDIR /app
# Copy package.json and package-lock.json (or yarn.lock)
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application code
COPY . .
# Build the project using webpack
RUN npm run build
# Use an official nginx image as the base image
FROM nginx:stable-alpine
# Set the working directory
WORKDIR /var/www/html
# Remove default nginx content
RUN rm -rf ./*
# Copy the built files from the builder stage to nginx's html directory
COPY --from=builder /app/dist .
# Expose port 80
EXPOSE 80
# Start nginx
CMD ["nginx", "-g", "daemon off;"]

View file

@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: weather-deployment
spec:
replicas: 3
selector:
matchLabels:
app: weather
template:
metadata:
labels:
app: weather
spec:
containers:
- name: weather
image: ghcr.io/smiggiddy/odin-codeprojects/weather:latest
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: weather-service
spec:
selector:
app: weather
ports:
- protocol: TCP
port: 80
targetPort: 80
type: LoadBalancer