diff --git a/Dockerfile b/Dockerfile index 60ee7aa..96b2b29 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/blog-balance.yaml b/blog-balance.yaml new file mode 100644 index 0000000..29092b1 --- /dev/null +++ b/blog-balance.yaml @@ -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 diff --git a/blog-deploy.yaml b/blog-deploy.yaml new file mode 100644 index 0000000..23a94be --- /dev/null +++ b/blog-deploy.yaml @@ -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 + diff --git a/docker-compose.yaml b/docker-compose.yaml deleted file mode 100644 index 5ee3aa4..0000000 --- a/docker-compose.yaml +++ /dev/null @@ -1,9 +0,0 @@ -services: - mdbook: - build: . - container_name: mdbook - volumes: - - "./blog:/mdbook" - ports: - - 80:3000 - restart: always