Final changes

This commit is contained in:
Garrett Mills 2022-04-10 06:58:52 -05:00
parent c09941ebe9
commit 316d917f6e
4 changed files with 124 additions and 58 deletions

View File

@ -1,56 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mathy
spec:
selector:
matchLabels:
name: mathy
template:
metadata:
labels:
name: mathy
spec:
containers:
- name: mathy
image: glmdev/mathy:latest
imagePullPolicy: Always
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: mathy-service
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: 80
selector:
name: mathy
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: mathy-ingress
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
tls:
- hosts:
- mathy.glmdev.tech
secretName: mathy-tls
rules:
- host: "mathy.glmdev.tech"
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: mathy-service
port:
number: 80

122
deploy/deploy.yaml Normal file
View File

@ -0,0 +1,122 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mathy
spec:
selector:
matchLabels:
name: mathy
template:
metadata:
labels:
name: mathy
spec:
containers:
- name: mathy
image: glmdev/mathy:latest
imagePullPolicy: Always
ports:
- containerPort: 80
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mathy-api
spec:
selector:
matchLabels:
name: mathy-api
template:
metadata:
labels:
name: mathy-api
spec:
containers:
- name: mathy
image: glmdev/mathy-api:latest
imagePullPolicy: Always
env:
- name: REDIS_HOST
value: localhost
- name: DATABASE_HOST
valueFrom:
secretKeyRef:
name: psql-conn
key: host
optional: false
- name: DATABASE_USERNAME
value: postgres
- name: DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: psql-conn
key: password
optional: false
- name: DATABASE_NAME
value: mathy
ports:
- containerPort: 80
- name: redis
image: redis:latest
imagePullPolicy: Always
ports:
- containerPort: 6379
---
apiVersion: v1
kind: Service
metadata:
name: mathy-api-service
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: 80
selector:
name: mathy-api
---
apiVersion: v1
kind: Service
metadata:
name: mathy-service
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: 80
selector:
name: mathy
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: mathy-ingress
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
tls:
- hosts:
- crystalmath.tech
secretName: mathy-tls
rules:
- host: "crystalmath.tech"
http:
paths:
- pathType: Prefix
path: "/api"
backend:
service:
name: mathy-api-service
port:
number: 80
- pathType: Prefix
path: "/"
backend:
service:
name: mathy-service
port:
number: 80

View File

@ -11,7 +11,7 @@
"preview": "vite preview",
"cd:build": "pnpm run build && docker image build . -t glmdev/mathy",
"cd:push": "docker push glmdev/mathy",
"cd:deploy": "kubectl apply -f deploy.yaml",
"cd:deploy": "kubectl apply -f deploy/deploy.yaml",
"cd:rollout": "kubectl rollout restart deployment/mathy",
"cd": "pnpm run cd:build && pnpm run cd:push && pnpm run cd:rollout"
},

View File

@ -271,7 +271,7 @@ const removeRichTextBox = (id: number) => {
const makeNewImageBox = () => {
images.value.push(new ImageContainer(''));
imageID.value = images.value.length - 1;
imageURL.value = images.value[richEditID.value].url;
imageURL.value = images.value[imageID.value].url;
imageModal.value = true;
};