[FEATURE] Initial Extra Ports
This commit is contained in:
parent
69018292b7
commit
2884709bb1
7 changed files with 81 additions and 7 deletions
|
@ -24,6 +24,14 @@ function payloadFilter(req, res) {
|
|||
if (!version) return res.status(400).send("Server version is required!");
|
||||
if (!serverType) return res.status(400).send("Server type is required!");
|
||||
if (!memory) return res.status(400).send("Memory is required!");
|
||||
if (
|
||||
!!extraPorts &&
|
||||
(!Array.isArray(extraPorts) ||
|
||||
extraPorts.find((e) => typeof e !== "string" || e.length > 5))
|
||||
)
|
||||
return res
|
||||
.status(400)
|
||||
.send("Extra ports must be a list of strings with length of 5!");
|
||||
// TODO: Impliment non creation time backups
|
||||
if (
|
||||
!!backupHost ||
|
||||
|
|
|
@ -13,6 +13,7 @@ CREATE TABLE servers (
|
|||
backup_id varchar(255) DEFAULT NULL,
|
||||
backup_key varchar(255) DEFAULT NULL,
|
||||
backup_interval varchar(255) DEFAULT NULL,
|
||||
extra_ports varchar(7)[] DEFAULT NULL,
|
||||
CONSTRAINT unique_host UNIQUE(host)
|
||||
);
|
||||
ALTER SEQUENCE servers_id_seq OWNED BY servers.id;
|
23
lib/k8s/configs/extra-svc.yml
Normal file
23
lib/k8s/configs/extra-svc.yml
Normal file
|
@ -0,0 +1,23 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
annotations:
|
||||
minecluster.dunemask.net/id: changeme-server-id
|
||||
labels:
|
||||
app: changeme-app
|
||||
name: changeme-extra
|
||||
namespace: changeme-namespace
|
||||
spec:
|
||||
internalTrafficPolicy: Cluster
|
||||
ipFamilies:
|
||||
- IPv4
|
||||
ipFamilyPolicy: SingleStack
|
||||
ports:
|
||||
- name: port-name
|
||||
port: 1234
|
||||
protocol: TCP
|
||||
targetPort: port-name
|
||||
selector:
|
||||
app: changeme-app
|
||||
sessionAffinity: None
|
||||
type: ClusterIP
|
Loading…
Add table
Add a link
Reference in a new issue