2023-12-24 01:18:54 +00:00
|
|
|
let
|
|
|
|
appName = "pterodactyl-panel";
|
|
|
|
pterodactyl-panel-Image = "git.gmem.ca/arch/pterodactyl-panel:latest";
|
|
|
|
in
|
2024-02-05 13:13:44 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
kubenix,
|
|
|
|
...
|
|
|
|
}: {
|
2023-12-24 01:18:54 +00:00
|
|
|
kubernetes.resources.services.pterodactyl-panel = {
|
|
|
|
spec = {
|
2024-02-05 13:13:44 +00:00
|
|
|
selector.app = appName;
|
|
|
|
ports.http = {
|
|
|
|
port = 8080;
|
|
|
|
targetPort = 8080;
|
2023-12-24 01:18:54 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-02-05 13:13:44 +00:00
|
|
|
kubernetes.resources.statefulSets.pterodactyl-panel.spec = {
|
|
|
|
selector.matchLabels.app = appName;
|
|
|
|
serviceName = appName;
|
|
|
|
template = {
|
|
|
|
metadata.labels.app = appName;
|
2023-12-24 01:18:54 +00:00
|
|
|
spec = {
|
2024-02-05 13:13:44 +00:00
|
|
|
containers = {
|
|
|
|
pterodactyl-panel = {
|
|
|
|
image = pterodactyl-panel-Image;
|
|
|
|
imagePullPolicy = "Always";
|
|
|
|
ports.http.containerPort = 8080;
|
|
|
|
volumeMounts = [
|
|
|
|
{
|
|
|
|
name = "data";
|
|
|
|
mountPath = "/var/www/pterodactyl/storage/app";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
envFrom = [{secretRef.name = "pterodactyl";}];
|
|
|
|
};
|
|
|
|
};
|
2023-12-24 01:18:54 +00:00
|
|
|
};
|
|
|
|
};
|
2024-02-05 13:13:44 +00:00
|
|
|
volumeClaimTemplates = [
|
2023-12-24 01:18:54 +00:00
|
|
|
{
|
2024-02-05 13:13:44 +00:00
|
|
|
metadata.name = "data";
|
|
|
|
spec = {
|
|
|
|
storageClassName = "nfs-client";
|
|
|
|
accessModes = ["ReadWriteOnce"];
|
|
|
|
resources.requests.storage = "1Gi";
|
|
|
|
};
|
2023-12-24 01:18:54 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2024-02-05 13:13:44 +00:00
|
|
|
kubernetes.helm.releases.pterodactyl-redis = {
|
|
|
|
chart = kubenix.lib.helm.fetch {
|
|
|
|
repo = "https://charts.bitnami.com/bitnami";
|
|
|
|
chart = "redis";
|
|
|
|
version = "18.6.1";
|
|
|
|
sha256 = "CyvGHc1v1BtbzDx6hbbPah2uWpUhlNIUQowephT6hmM=";
|
|
|
|
};
|
|
|
|
values = {
|
|
|
|
auth.enabled = false;
|
|
|
|
architecture = "standalone";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
kubernetes.resources.ingresses.pterodactyl-panel = {
|
|
|
|
metadata = {
|
|
|
|
name = appName;
|
|
|
|
annotations = {
|
|
|
|
"cert-manager.io/issuer" = "le-issuer";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
spec = {
|
|
|
|
tls = [
|
|
|
|
{
|
|
|
|
hosts = ["games.gmem.ca"];
|
|
|
|
secretName = "gmem-ca-wildcard";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
rules = [
|
|
|
|
{
|
|
|
|
host = "games.gmem.ca";
|
|
|
|
http.paths = [
|
|
|
|
{
|
|
|
|
path = "/";
|
|
|
|
pathType = "Prefix";
|
|
|
|
backend.service = {
|
|
|
|
name = appName;
|
|
|
|
port.name = "http";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|