mirror of
https://github.com/morten-olsen/homelab-operator.git
synced 2026-02-08 01:36:28 +01:00
Compare commits
2 Commits
main
...
fix/auth-u
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cad527e644 | ||
|
|
ce2cebf77b |
@@ -31,11 +31,11 @@ class BootstrapService {
|
|||||||
|
|
||||||
public ensure = async () => {
|
public ensure = async () => {
|
||||||
await this.namespaces.ensure();
|
await this.namespaces.ensure();
|
||||||
// await this.repos.ensure();
|
await this.repos.ensure();
|
||||||
// await this.releases.ensure();
|
await this.releases.ensure();
|
||||||
// await this.cloudflareTunnel.ensure({
|
await this.cloudflareTunnel.ensure({
|
||||||
// spec: {},
|
spec: {},
|
||||||
//});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { homelab } from '#resources/homelab/homelab.ts';
|
|||||||
const services = new Services();
|
const services = new Services();
|
||||||
const resourceService = services.get(ResourceService);
|
const resourceService = services.get(ResourceService);
|
||||||
|
|
||||||
// await resourceService.install(...Object.values(homelab));
|
await resourceService.install(...Object.values(homelab));
|
||||||
await resourceService.register(...Object.values(resources));
|
await resourceService.register(...Object.values(resources));
|
||||||
|
|
||||||
const bootstrapService = services.get(BootstrapService);
|
const bootstrapService = services.get(BootstrapService);
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import { RepoService } from '#bootstrap/repos/repos.ts';
|
|||||||
import { DestinationRule } from '#resources/istio/destination-rule/destination-rule.ts';
|
import { DestinationRule } from '#resources/istio/destination-rule/destination-rule.ts';
|
||||||
import { NotReadyError } from '#utils/errors.ts';
|
import { NotReadyError } from '#utils/errors.ts';
|
||||||
import { ExternalHttpService } from '../external-http-service.ts/external-http-service.ts';
|
import { ExternalHttpService } from '../external-http-service.ts/external-http-service.ts';
|
||||||
|
import { HttpService } from '../http-service/http-service.ts';
|
||||||
|
|
||||||
const specSchema = z.object({
|
const specSchema = z.object({
|
||||||
environment: z.string(),
|
environment: z.string(),
|
||||||
@@ -44,6 +45,7 @@ class AuthentikServer extends CustomResource<typeof specSchema> {
|
|||||||
#initSecret: Secret<InitSecretData>;
|
#initSecret: Secret<InitSecretData>;
|
||||||
#service: Service;
|
#service: Service;
|
||||||
#helmRelease: HelmRelease;
|
#helmRelease: HelmRelease;
|
||||||
|
#httpService: HttpService;
|
||||||
#externalHttpService: ExternalHttpService;
|
#externalHttpService: ExternalHttpService;
|
||||||
#destinationRule: DestinationRule;
|
#destinationRule: DestinationRule;
|
||||||
|
|
||||||
@@ -72,6 +74,8 @@ class AuthentikServer extends CustomResource<typeof specSchema> {
|
|||||||
this.#destinationRule.on('changed', this.queueReconcile);
|
this.#destinationRule.on('changed', this.queueReconcile);
|
||||||
|
|
||||||
this.#externalHttpService = resourceService.get(ExternalHttpService, this.name, this.namespace);
|
this.#externalHttpService = resourceService.get(ExternalHttpService, this.name, this.namespace);
|
||||||
|
|
||||||
|
this.#httpService = resourceService.get(HttpService, this.name, this.namespace);
|
||||||
}
|
}
|
||||||
|
|
||||||
public get service() {
|
public get service() {
|
||||||
@@ -168,7 +172,7 @@ class AuthentikServer extends CustomResource<typeof specSchema> {
|
|||||||
chart: {
|
chart: {
|
||||||
spec: {
|
spec: {
|
||||||
chart: 'authentik',
|
chart: 'authentik',
|
||||||
version: '2025.10.3',
|
version: '2025.6.4',
|
||||||
sourceRef: {
|
sourceRef: {
|
||||||
apiVersion: 'source.toolkit.fluxcd.io/v1',
|
apiVersion: 'source.toolkit.fluxcd.io/v1',
|
||||||
kind: 'HelmRepository',
|
kind: 'HelmRepository',
|
||||||
@@ -253,6 +257,22 @@ class AuthentikServer extends CustomResource<typeof specSchema> {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
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({
|
await this.#externalHttpService.ensure({
|
||||||
metadata: {
|
metadata: {
|
||||||
ownerReferences: [this.ref],
|
ownerReferences: [this.ref],
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ const resources = {
|
|||||||
...flux,
|
...flux,
|
||||||
...certManager,
|
...certManager,
|
||||||
...istio,
|
...istio,
|
||||||
// ...homelab,
|
...homelab,
|
||||||
} satisfies Record<string, ResourceClass<ExpectedAny>>;
|
} satisfies Record<string, ResourceClass<ExpectedAny>>;
|
||||||
|
|
||||||
export { resources };
|
export { resources };
|
||||||
|
|||||||
Reference in New Issue
Block a user