add kubernetes deployment files
This commit is contained in:
@@ -18,3 +18,6 @@ package-lock.json
|
||||
.env
|
||||
docker-push.sh
|
||||
docker-compose.yml
|
||||
output
|
||||
env.txt
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
# Kubernetes deployment
|
||||
|
||||
## TLDR; and do not care way
|
||||
```
|
||||
make
|
||||
sed -i s/localhost/myshinydomain.tld/g env.txt
|
||||
make prepare
|
||||
make deployment
|
||||
```
|
||||
|
||||
# Understanding way
|
||||
If you would like to deploy Mirotalk to kubernetes
|
||||
this set of files can help you in that task
|
||||
|
||||
Bellow is explanation of files in this folder which will form one output file in `output` folder
|
||||
## ../.env.template and your file env.txt that you should prepare
|
||||
Configuration file that is for now used to configure deployment
|
||||
you should copy `../.env.template` to current directory as `env.txt` and edit values inside to your liking
|
||||
```
|
||||
cp ../.env.template env.txt
|
||||
```
|
||||
Change values (if nothing else **HOST** variable must be changed so your ingress would recognize it and work as)
|
||||
```
|
||||
sed -i s/localhost/myshinydomain.tld/g env.txt
|
||||
```
|
||||
|
||||
## p2p-deployment.yaml
|
||||
Main deployment file where you change image file if you would like to use yours if not official one (`image`: tag)
|
||||
|
||||
## p2p-cert.yaml
|
||||
This file represent definition of certificate (request) when using [Cert Manager](cert-manager.io) to generate letsencrypt or private certificates for your domain will be pulled out from `env.txt`
|
||||
## p2p-ingress.yaml
|
||||
This is generic ingress object in kubernetes that is responsible to route external traffic to mirotalk deployed application and if used in conjuction with p2p-cert.yaml (default) will provide TLS enabled access to your mirotalk instance
|
||||
## p2p-service.yaml
|
||||
Service required for ingress to be able to know how to access deployment
|
||||
## Makefile
|
||||
Helper file that allows running it to configure application how you would like
|
||||
|
||||
after creating and changing configuration file (`env.txt`) run these two tasks, prepare will create deployment file
|
||||
and deployment will create configMap from prepared `env.txt` file.
|
||||
|
||||
Please run after reading all this:
|
||||
|
||||
```
|
||||
make
|
||||
# edit env.txt or use sed as in TLDR section :)
|
||||
make prepare
|
||||
make deployment
|
||||
```
|
||||
@@ -0,0 +1,15 @@
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: __DOMAIN_NAME_DASHED__-tls
|
||||
spec:
|
||||
duration: 2880h # 180d
|
||||
renewBefore: 360h # 15d
|
||||
commonName: __DOMAIN_NAME__
|
||||
dnsNames:
|
||||
- __DOMAIN_NAME__
|
||||
issuerRef:
|
||||
kind: ClusterIssuer
|
||||
name: letsencrypt
|
||||
secretName: __DOMAIN_NAME_DASHED__-tls
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app: p2p
|
||||
name: p2p
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: p2p
|
||||
strategy: {}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: p2p
|
||||
spec:
|
||||
containers:
|
||||
- image: mirotalk/p2p:latest
|
||||
name: mirotalk
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
volumeMounts:
|
||||
- name: p2p-env
|
||||
mountPath: /src/.env
|
||||
subPath: .env
|
||||
resources: {}
|
||||
volumes:
|
||||
- name: p2p-env
|
||||
configMap:
|
||||
name: p2p
|
||||
defaultMode: 0644
|
||||
restartPolicy: Always
|
||||
status: {}
|
||||
@@ -0,0 +1,26 @@
|
||||
apiVersion: v1
|
||||
kind: List
|
||||
metadata:
|
||||
resourceVersion: ""
|
||||
items:
|
||||
- apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: p2p-ingress
|
||||
spec:
|
||||
rules:
|
||||
- host: __DOMAIN_NAME__
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
service:
|
||||
name: p2p
|
||||
port:
|
||||
number: 3000
|
||||
path: /
|
||||
pathType: Prefix
|
||||
tls:
|
||||
- hosts:
|
||||
- __DOMAIN_NAME__
|
||||
secretName: __DOMAIN_NAME_DASHED__-tls
|
||||
status:
|
||||
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
app: p2p
|
||||
name: p2p
|
||||
spec:
|
||||
ports:
|
||||
- name: "3000"
|
||||
port: 3000
|
||||
targetPort: 3000
|
||||
selector:
|
||||
app: p2p
|
||||
status:
|
||||
loadBalancer: {}
|
||||
Reference in New Issue
Block a user