made kubernetes files woooo

This commit is contained in:
Michael Scalzetti 2023-01-21 16:43:27 -05:00
parent 631c7c9fae
commit 419712115a
4 changed files with 40 additions and 10 deletions

View File

@ -3,7 +3,7 @@ FROM rust:latest
RUN cargo install mdbook
RUN apt-get update && apt-get install -y vim git
RUN mkdir -p /mdbook
COPY ./blog /mdbook/
WORKDIR /mdbook
EXPOSE 3000

17
blog-balance.yaml Normal file
View File

@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: blog-balancer
labels:
app: blog-balancer
spec:
type: LoadBalancer
ports:
- name: blog-balancer
port: 80
protocol: TCP
targetPort: 3000
selector:
app: blog-dep
sessionAffinity: None

22
blog-deploy.yaml Normal file
View File

@ -0,0 +1,22 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: blog-dep
labels:
app: blog-dep
spec:
replicas: 2
selector:
matchLabels:
app: blog-dep
template:
metadata:
labels:
app: blog-dep
spec:
containers:
- name: mdblog
image: docker.scalz.cloud/blog
ports:
- containerPort: 3000

View File

@ -1,9 +0,0 @@
services:
mdbook:
build: .
container_name: mdbook
volumes:
- "./blog:/mdbook"
ports:
- 80:3000
restart: always