Add k8s configuration

This commit is contained in:
Garrett Mills 2022-04-09 09:08:40 -05:00
parent 57c62f9f98
commit 4450d63964
2 changed files with 56 additions and 2 deletions

52
deploy.yaml Normal file
View File

@ -0,0 +1,52 @@
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: "false"
spec:
rules:
- host: "mathy.glmdev.tech"
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: mathy-service
port:
number: 80

View File

@ -9,8 +9,10 @@
"lint": "eslint . --ext .ts", "lint": "eslint . --ext .ts",
"lint:fix": "eslint --fix . --ext .ts", "lint:fix": "eslint --fix . --ext .ts",
"preview": "vite preview", "preview": "vite preview",
"docker:build": "pnpm run build && docker image build . -t glmdev/mathy", "cd:build": "pnpm run build && docker image build . -t glmdev/mathy",
"docker:push": "docker push glmdev/mathy" "cd:push": "docker push glmdev/mathy",
"cd:deploy": "kubectl apply -f deploy.yaml",
"cd:rollout": "kubectl rollout restart deployment/mathy"
}, },
"dependencies": { "dependencies": {
"@vuetify/vite-plugin": "1.0.0-alpha.10", "@vuetify/vite-plugin": "1.0.0-alpha.10",