initial commit with minimal deployment configured
This commit is contained in:
commit
6aaa8fc1b3
25
README.md
Normal file
25
README.md
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Backend deployment
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
This repository contains the necessary files for deploying the backend application to a kubernetes environment.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
Before deploying the backend application, ensure that you have the following prerequisites:
|
||||||
|
|
||||||
|
- Kubernetes cluster with the following components:
|
||||||
|
- ingress controller
|
||||||
|
- storage class
|
||||||
|
- `kubectl` installed (`kustomize` is usually bundled)
|
||||||
|
|
||||||
|
## Deployment Steps
|
||||||
|
|
||||||
|
To deploy the backend application, follow these steps:
|
||||||
|
|
||||||
|
1. Clone this repository: `git clone https://github.com/your-repo.git`
|
||||||
|
1. Apply the kustomization: `kubectl apply -k .`
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
The kustomization allows for easy configuration of the backend application. To customize the deployment, modify the `kustomization.yaml` file.
|
40
deployment.yaml
Normal file
40
deployment.yaml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: nav-backend
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: nav-backend
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: nav-backend
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: worker
|
||||||
|
image: backend-image
|
||||||
|
ports:
|
||||||
|
- containerPort: 8000
|
||||||
|
env:
|
||||||
|
- name: NUM_WORKERS
|
||||||
|
value: "3"
|
||||||
|
- name: OSM_CACHE_DIR
|
||||||
|
value: "/osm-cache"
|
||||||
|
volumeMounts:
|
||||||
|
- name: osm-cache
|
||||||
|
mountPath: /osm-cache
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 100Mi
|
||||||
|
limits:
|
||||||
|
cpu: 4
|
||||||
|
memory: 10Gi
|
||||||
|
volumes:
|
||||||
|
- name: osm-cache
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: osm-cache
|
||||||
|
|
||||||
|
|
15
ingress.yaml
Normal file
15
ingress.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
kind: IngressRoute
|
||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
metadata:
|
||||||
|
name: nav-ingress
|
||||||
|
spec:
|
||||||
|
entryPoints:
|
||||||
|
- websecure
|
||||||
|
routes:
|
||||||
|
- match: Host(`anyway.kluster.moll.re`)
|
||||||
|
kind: Rule
|
||||||
|
services:
|
||||||
|
- name: nav-service
|
||||||
|
port: 8000
|
||||||
|
tls:
|
||||||
|
certResolver: default-tls
|
16
kustomization.yaml
Normal file
16
kustomization.yaml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
|
||||||
|
|
||||||
|
namespace: anyway-backend
|
||||||
|
resources:
|
||||||
|
- namespace.yaml
|
||||||
|
- pvc.yaml
|
||||||
|
- deployment.yaml
|
||||||
|
- service.yaml
|
||||||
|
- ingress.yaml
|
||||||
|
|
||||||
|
images:
|
||||||
|
- name: backend-image
|
||||||
|
newName: git.kluster.moll.re/anydev/anyway-backend
|
||||||
|
newTag: latest
|
4
namespace.yaml
Normal file
4
namespace.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: placeholder
|
11
pvc.yaml
Normal file
11
pvc.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: osm-cache
|
||||||
|
spec:
|
||||||
|
storageClassName: "nfs-client"
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: "5Gi"
|
11
service.yaml
Normal file
11
service.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: nav-service
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: nav-backend
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: 8000
|
||||||
|
targetPort: 8000
|
Loading…
x
Reference in New Issue
Block a user