From cad527e644791c32bb328ba8636ff3b3c20c8ade Mon Sep 17 00:00:00 2001 From: Morten Olsen Date: Tue, 18 Nov 2025 15:18:17 +0100 Subject: [PATCH] fix: add http service to authentik --- .../authentik-server/authentik-server.ts | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/images/operator/src/resources/homelab/authentik-server/authentik-server.ts b/images/operator/src/resources/homelab/authentik-server/authentik-server.ts index c85d597..1426b9f 100644 --- a/images/operator/src/resources/homelab/authentik-server/authentik-server.ts +++ b/images/operator/src/resources/homelab/authentik-server/authentik-server.ts @@ -18,6 +18,7 @@ import { RepoService } from '#bootstrap/repos/repos.ts'; import { DestinationRule } from '#resources/istio/destination-rule/destination-rule.ts'; import { NotReadyError } from '#utils/errors.ts'; import { ExternalHttpService } from '../external-http-service.ts/external-http-service.ts'; +import { HttpService } from '../http-service/http-service.ts'; const specSchema = z.object({ environment: z.string(), @@ -44,6 +45,7 @@ class AuthentikServer extends CustomResource { #initSecret: Secret; #service: Service; #helmRelease: HelmRelease; + #httpService: HttpService; #externalHttpService: ExternalHttpService; #destinationRule: DestinationRule; @@ -72,6 +74,8 @@ class AuthentikServer extends CustomResource { this.#destinationRule.on('changed', this.queueReconcile); this.#externalHttpService = resourceService.get(ExternalHttpService, this.name, this.namespace); + + this.#httpService = resourceService.get(HttpService, this.name, this.namespace); } public get service() { @@ -253,6 +257,22 @@ class AuthentikServer extends CustomResource { }, }); + await this.#httpService.ensure({ + metadata: { + ownerReferences: [this.ref], + }, + spec: { + environment: this.spec.environment, + subdomain: this.spec.subdomain || 'authentik', + destination: { + host: this.#service.hostname, + port: { + number: 80, + }, + }, + }, + }); + await this.#externalHttpService.ensure({ metadata: { ownerReferences: [this.ref],