You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
128 lines
2.5 KiB
128 lines
2.5 KiB
2 years ago
|
---
|
||
|
apiVersion: apps/v1
|
||
|
kind: Deployment
|
||
|
metadata:
|
||
|
name: mathy
|
||
2 years ago
|
namespace: mathy
|
||
2 years ago
|
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
|
||
2 years ago
|
namespace: mathy
|
||
2 years ago
|
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
|
||
2 years ago
|
value: mathy
|
||
2 years ago
|
- name: DATABASE_PASSWORD
|
||
|
valueFrom:
|
||
|
secretKeyRef:
|
||
|
name: psql-conn
|
||
|
key: password
|
||
|
optional: false
|
||
|
- name: DATABASE_NAME
|
||
|
value: mathy
|
||
|
ports:
|
||
2 years ago
|
- containerPort: 8000
|
||
2 years ago
|
|
||
|
- name: redis
|
||
|
image: redis:latest
|
||
|
imagePullPolicy: Always
|
||
|
ports:
|
||
|
- containerPort: 6379
|
||
|
---
|
||
|
apiVersion: v1
|
||
|
kind: Service
|
||
|
metadata:
|
||
|
name: mathy-api-service
|
||
2 years ago
|
namespace: mathy
|
||
2 years ago
|
spec:
|
||
|
ports:
|
||
|
- name: http
|
||
|
port: 80
|
||
|
protocol: TCP
|
||
2 years ago
|
targetPort: 8000
|
||
2 years ago
|
selector:
|
||
|
name: mathy-api
|
||
|
---
|
||
|
apiVersion: v1
|
||
|
kind: Service
|
||
|
metadata:
|
||
|
name: mathy-service
|
||
2 years ago
|
namespace: mathy
|
||
2 years ago
|
spec:
|
||
|
ports:
|
||
|
- name: http
|
||
|
port: 80
|
||
|
protocol: TCP
|
||
|
targetPort: 80
|
||
|
selector:
|
||
|
name: mathy
|
||
|
---
|
||
|
apiVersion: networking.k8s.io/v1
|
||
|
kind: Ingress
|
||
|
metadata:
|
||
|
name: mathy-ingress
|
||
2 years ago
|
namespace: mathy
|
||
2 years ago
|
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
|