mirror of
https://github.com/morten-olsen/homelab-operator.git
synced 2026-02-08 01:36:28 +01:00
updates
This commit is contained in:
7
src/instances/authentik-server.ts
Normal file
7
src/instances/authentik-server.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { authentikServerSpecSchema } from '../custom-resouces/authentik-server/authentik-server.schemas.ts';
|
||||
import type { CustomResourceObject } from '../services/custom-resources/custom-resources.custom-resource.ts';
|
||||
import { ResourceInstance } from '../services/resources/resources.instance.ts';
|
||||
|
||||
class AuthentikServerInstance extends ResourceInstance<CustomResourceObject<typeof authentikServerSpecSchema>> {}
|
||||
|
||||
export { AuthentikServerInstance };
|
||||
8
src/instances/certificate.ts
Normal file
8
src/instances/certificate.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import type { KubernetesObject } from '@kubernetes/client-node';
|
||||
|
||||
import { ResourceInstance } from '../services/resources/resources.instance.ts';
|
||||
import type { K8SCertificateV1 } from '../__generated__/resources/K8SCertificateV1.ts';
|
||||
|
||||
class CertificateInstance extends ResourceInstance<KubernetesObject & K8SCertificateV1> {}
|
||||
|
||||
export { CertificateInstance };
|
||||
12
src/instances/cluster-issuer.ts
Normal file
12
src/instances/cluster-issuer.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import type { KubernetesObject } from '@kubernetes/client-node';
|
||||
|
||||
import type { K8SClusterIssuerV1 } from '../__generated__/resources/K8SClusterIssuerV1.ts';
|
||||
import { ResourceInstance } from '../services/resources/resources.instance.ts';
|
||||
|
||||
class ClusterIssuerInstance extends ResourceInstance<KubernetesObject & K8SClusterIssuerV1> {
|
||||
public get ready() {
|
||||
return this.exists;
|
||||
}
|
||||
}
|
||||
|
||||
export { ClusterIssuerInstance };
|
||||
7
src/instances/custom-resource-definition.ts
Normal file
7
src/instances/custom-resource-definition.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { V1CustomResourceDefinition } from '@kubernetes/client-node';
|
||||
|
||||
import { ResourceInstance } from '../services/resources/resources.instance.ts';
|
||||
|
||||
class CustomDefinitionInstance extends ResourceInstance<V1CustomResourceDefinition> {}
|
||||
|
||||
export { CustomDefinitionInstance };
|
||||
11
src/instances/deployment.ts
Normal file
11
src/instances/deployment.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { V1Deployment } from '@kubernetes/client-node';
|
||||
|
||||
import { ResourceInstance } from '../services/resources/resources.ts';
|
||||
|
||||
class DeploymentInstance extends ResourceInstance<V1Deployment> {
|
||||
public get ready() {
|
||||
return this.exists && this.status?.readyReplicas === this.status?.replicas;
|
||||
}
|
||||
}
|
||||
|
||||
export { DeploymentInstance };
|
||||
12
src/instances/destination-rule.ts
Normal file
12
src/instances/destination-rule.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import type { KubernetesObject } from '@kubernetes/client-node';
|
||||
|
||||
import { ResourceInstance } from '../services/resources/resources.instance.ts';
|
||||
import type { K8SDestinationRuleV1 } from '../__generated__/resources/K8SDestinationRuleV1.ts';
|
||||
|
||||
class DestinationRuleInstance extends ResourceInstance<KubernetesObject & K8SDestinationRuleV1> {
|
||||
public get ready() {
|
||||
return this.exists;
|
||||
}
|
||||
}
|
||||
|
||||
export { DestinationRuleInstance };
|
||||
7
src/instances/environment.ts
Normal file
7
src/instances/environment.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { environmentSpecSchema } from '../custom-resouces/environment/environment.schemas.ts';
|
||||
import type { CustomResourceObject } from '../services/custom-resources/custom-resources.custom-resource.ts';
|
||||
import { ResourceInstance } from '../services/resources/resources.instance.ts';
|
||||
|
||||
class EnvironmentInstance extends ResourceInstance<CustomResourceObject<typeof environmentSpecSchema>> {}
|
||||
|
||||
export { EnvironmentInstance };
|
||||
8
src/instances/gateway.ts
Normal file
8
src/instances/gateway.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import type { KubernetesObject } from '@kubernetes/client-node';
|
||||
|
||||
import { ResourceInstance } from '../services/resources/resources.instance.ts';
|
||||
import type { K8SGatewayV1 } from '../__generated__/resources/K8SGatewayV1.ts';
|
||||
|
||||
class GatewayInstance extends ResourceInstance<KubernetesObject & K8SGatewayV1> {}
|
||||
|
||||
export { GatewayInstance };
|
||||
12
src/instances/git-repo.ts
Normal file
12
src/instances/git-repo.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import type { KubernetesObject } from '@kubernetes/client-node';
|
||||
|
||||
import { ResourceInstance } from '../services/resources/resources.ts';
|
||||
import type { K8SGitRepositoryV1 } from '../__generated__/resources/K8SGitRepositoryV1.ts';
|
||||
|
||||
class GitRepoInstance extends ResourceInstance<KubernetesObject & K8SGitRepositoryV1> {
|
||||
public get ready() {
|
||||
return this.exists;
|
||||
}
|
||||
}
|
||||
|
||||
export { GitRepoInstance };
|
||||
12
src/instances/helm-release.ts
Normal file
12
src/instances/helm-release.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import type { KubernetesObject } from '@kubernetes/client-node';
|
||||
|
||||
import { ResourceInstance } from '../services/resources/resources.ts';
|
||||
import type { K8SHelmReleaseV2 } from '../__generated__/resources/K8SHelmReleaseV2.ts';
|
||||
|
||||
class HelmReleaseInstance extends ResourceInstance<KubernetesObject & K8SHelmReleaseV2> {
|
||||
public get ready() {
|
||||
return this.exists;
|
||||
}
|
||||
}
|
||||
|
||||
export { HelmReleaseInstance };
|
||||
16
src/instances/helm-repo.ts
Normal file
16
src/instances/helm-repo.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import type { KubernetesObject } from '@kubernetes/client-node';
|
||||
|
||||
import { ResourceInstance } from '../services/resources/resources.ts';
|
||||
import type { K8SHelmRepositoryV1 } from '../__generated__/resources/K8SHelmRepositoryV1.ts';
|
||||
|
||||
class HelmRepoInstance extends ResourceInstance<KubernetesObject & K8SHelmRepositoryV1> {
|
||||
public get ready() {
|
||||
if (!this.exists) {
|
||||
return false;
|
||||
}
|
||||
const condition = this.getCondition('Ready');
|
||||
return condition?.status === 'True';
|
||||
}
|
||||
}
|
||||
|
||||
export { HelmRepoInstance };
|
||||
11
src/instances/namespace.ts
Normal file
11
src/instances/namespace.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { V1Namespace } from '@kubernetes/client-node';
|
||||
|
||||
import { ResourceInstance } from '../services/resources/resources.ts';
|
||||
|
||||
class NamespaceInstance extends ResourceInstance<V1Namespace> {
|
||||
public get ready() {
|
||||
return this.exists;
|
||||
}
|
||||
}
|
||||
|
||||
export { NamespaceInstance };
|
||||
7
src/instances/postgres-cluster.ts
Normal file
7
src/instances/postgres-cluster.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { postgresClusterSpecSchema } from '../custom-resouces/postgres-cluster/postgres-cluster.schemas.ts';
|
||||
import type { CustomResourceObject } from '../services/custom-resources/custom-resources.custom-resource.ts';
|
||||
import { ResourceInstance } from '../services/resources/resources.instance.ts';
|
||||
|
||||
class PostgresClusterInstance extends ResourceInstance<CustomResourceObject<typeof postgresClusterSpecSchema>> {}
|
||||
|
||||
export { PostgresClusterInstance };
|
||||
20
src/instances/secret.ts
Normal file
20
src/instances/secret.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import type { V1Secret } from '@kubernetes/client-node';
|
||||
|
||||
import { ResourceInstance } from '../services/resources/resources.instance.ts';
|
||||
import { decodeSecret, encodeSecret } from '../utils/secrets.ts';
|
||||
|
||||
class SecretInstance extends ResourceInstance<V1Secret> {
|
||||
public get values() {
|
||||
return decodeSecret(this.data);
|
||||
}
|
||||
|
||||
public ensureData = async (values: Record<string, string>) => {
|
||||
await this.ensure({
|
||||
data: encodeSecret(values),
|
||||
});
|
||||
};
|
||||
|
||||
public readonly ready = true;
|
||||
}
|
||||
|
||||
export { SecretInstance };
|
||||
11
src/instances/service.ts
Normal file
11
src/instances/service.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { V1Service } from '@kubernetes/client-node';
|
||||
|
||||
import { ResourceInstance } from '../services/resources/resources.ts';
|
||||
|
||||
class ServiceInstance extends ResourceInstance<V1Service> {
|
||||
public get ready() {
|
||||
return this.exists;
|
||||
}
|
||||
}
|
||||
|
||||
export { ServiceInstance };
|
||||
11
src/instances/stateful-set.ts
Normal file
11
src/instances/stateful-set.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { V1StatefulSet } from '@kubernetes/client-node';
|
||||
|
||||
import { ResourceInstance } from '../services/resources/resources.instance.ts';
|
||||
|
||||
class StatefulSetInstance extends ResourceInstance<V1StatefulSet> {
|
||||
public get ready() {
|
||||
return this.exists && this.manifest?.status?.readyReplicas === this.manifest?.status?.replicas;
|
||||
}
|
||||
}
|
||||
|
||||
export { StatefulSetInstance };
|
||||
7
src/instances/storageclass.ts
Normal file
7
src/instances/storageclass.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { V1StorageClass } from '@kubernetes/client-node';
|
||||
|
||||
import { ResourceInstance } from '../services/resources/resources.instance.ts';
|
||||
|
||||
class StorageClassInstance extends ResourceInstance<V1StorageClass> {}
|
||||
|
||||
export { StorageClassInstance };
|
||||
12
src/instances/virtual-service.ts
Normal file
12
src/instances/virtual-service.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import type { KubernetesObject } from '@kubernetes/client-node';
|
||||
|
||||
import { ResourceInstance } from '../services/resources/resources.instance.ts';
|
||||
import type { K8SVirtualServiceV1 } from '../__generated__/resources/K8SVirtualServiceV1.ts';
|
||||
|
||||
class VirtualServiceInstance extends ResourceInstance<KubernetesObject & K8SVirtualServiceV1> {
|
||||
public get ready() {
|
||||
return this.exists;
|
||||
}
|
||||
}
|
||||
|
||||
export { VirtualServiceInstance };
|
||||
Reference in New Issue
Block a user