mirror of
https://github.com/morten-olsen/homelab-operator.git
synced 2026-02-08 01:36:28 +01:00
stuff
This commit is contained in:
42
src/resources/flux/helm-release/helm-release.ts
Normal file
42
src/resources/flux/helm-release/helm-release.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import type { KubernetesObject } from '@kubernetes/client-node';
|
||||
import type { K8SHelmReleaseV2 } from 'src/__generated__/resources/K8SHelmReleaseV2.ts';
|
||||
|
||||
import { Resource } from '#services/resources/resources.ts';
|
||||
|
||||
type SetOptions = {
|
||||
namespace?: string;
|
||||
values?: Record<string, unknown>;
|
||||
chart: {
|
||||
name: string;
|
||||
namespace?: string;
|
||||
};
|
||||
};
|
||||
|
||||
class HelmRelease extends Resource<KubernetesObject & K8SHelmReleaseV2> {
|
||||
public static readonly apiVersion = 'helm.toolkit.fluxcd.io/v2';
|
||||
public static readonly kind = 'HelmRelease';
|
||||
|
||||
public set = async (options: SetOptions) => {
|
||||
return await this.ensure({
|
||||
spec: {
|
||||
targetNamespace: options.namespace,
|
||||
interval: '1h',
|
||||
values: options.values,
|
||||
chart: {
|
||||
spec: {
|
||||
chart: 'cert-manager',
|
||||
version: 'v1.18.2',
|
||||
sourceRef: {
|
||||
apiVersion: 'source.toolkit.fluxcd.io/v1',
|
||||
kind: 'HelmRepository',
|
||||
name: options.chart.name,
|
||||
namespace: options.chart.namespace,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export { HelmRelease };
|
||||
Reference in New Issue
Block a user