feat: Media | use single certificate for all services

This commit is contained in:
2026-02-27 14:53:56 +05:00
parent 2a0da5d27e
commit b91fc65d9e
6 changed files with 43 additions and 75 deletions

View File

@@ -2,11 +2,7 @@ import { Construct } from "constructs";
import { DeploymentV1 } from "@cdktf/provider-kubernetes/lib/deployment-v1";
import { ServiceV1 } from "@cdktf/provider-kubernetes/lib/service-v1";
import {
InternalIngressRoute,
LonghornPvc,
PrivateCertificate,
} from "../../utils";
import { InternalIngressRoute, LonghornPvc } from "../../utils";
import {
BaseMediaServiceOptions,
getAamil3NodeSelector,
@@ -18,6 +14,8 @@ type QBittorrentServerOptions = BaseMediaServiceOptions & {
downloadsPvcName: string;
/** Hostname for the ingress */
host: string;
/** Secret name for the TLS certificate */
certificateSecretName: string;
};
export class QBittorrentServer extends Construct {
@@ -137,15 +135,6 @@ export class QBittorrentServer extends Construct {
},
});
new PrivateCertificate(this, "certificate", {
provider,
namespace,
name,
commonName: host,
dnsNames: [host],
secretName: `${name}-tls`,
});
// Ingress
new InternalIngressRoute(this, "ingress", {
provider,
@@ -154,7 +143,7 @@ export class QBittorrentServer extends Construct {
host,
serviceName: name,
servicePort: 80,
tlsSecretName: `${name}-tls`,
tlsSecretName: options.certificateSecretName,
});
}
}