mirror of
https://github.com/morten-olsen/homelab-operator.git
synced 2026-02-08 01:36:28 +01:00
update
This commit is contained in:
3
charts/apps/charts/harbor/Chart.yaml
Normal file
3
charts/apps/charts/harbor/Chart.yaml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
apiVersion: v2
|
||||||
|
version: 1.0.0
|
||||||
|
name: monitoring
|
||||||
38
charts/apps/charts/harbor/templates/helm.yaml
Normal file
38
charts/apps/charts/harbor/templates/helm.yaml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
apiVersion: source.toolkit.fluxcd.io/v1
|
||||||
|
kind: HelmRepository
|
||||||
|
metadata:
|
||||||
|
name: '{{ .Release.Name }}'
|
||||||
|
spec:
|
||||||
|
interval: 1h
|
||||||
|
url: https://helm.goharbor.io
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: '{{ .Release.Name }}'
|
||||||
|
spec:
|
||||||
|
chart:
|
||||||
|
spec:
|
||||||
|
chart: harbor
|
||||||
|
reconcileStrategy: ChartVersion
|
||||||
|
sourceRef:
|
||||||
|
apiVersion: source.toolkit.fluxcd.io/v1
|
||||||
|
kind: HelmRepository
|
||||||
|
name: '{{ .Release.Name }}'
|
||||||
|
namespace: '{{ .Release.Namespace }}'
|
||||||
|
interval: 1h
|
||||||
|
values:
|
||||||
|
persistence:
|
||||||
|
persistentVolumeClaim:
|
||||||
|
registry:
|
||||||
|
storageClass: '{{ .Values.globals.environment }}'
|
||||||
|
jobservice:
|
||||||
|
jobLog:
|
||||||
|
storageClass: '{{ .Values.globals.environment }}'
|
||||||
|
database:
|
||||||
|
storageClass: '{{ .Values.globals.environment }}'
|
||||||
|
redis:
|
||||||
|
storageClass: '{{ .Values.globals.environment }}'
|
||||||
|
trivy:
|
||||||
|
storageClass: '{{ .Values.globals.environment }}'
|
||||||
11
charts/apps/charts/harbor/templates/http-service.yaml
Normal file
11
charts/apps/charts/harbor/templates/http-service.yaml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: homelab.mortenolsen.pro/v1
|
||||||
|
kind: HttpService
|
||||||
|
metadata:
|
||||||
|
name: '{{ .Release.Name }}'
|
||||||
|
spec:
|
||||||
|
environment: '{{ .Values.globals.environment }}'
|
||||||
|
subdomain: '{{ .Values.subdomain }}'
|
||||||
|
destination:
|
||||||
|
host: '{{ .Release.Name }}.{{ .Release.Namespace }}.svc.cluster.local'
|
||||||
|
port:
|
||||||
|
number: 80
|
||||||
3
charts/apps/charts/harbor/values.yaml
Normal file
3
charts/apps/charts/harbor/values.yaml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
globals:
|
||||||
|
environment: prod
|
||||||
|
subdomain: harbor
|
||||||
@@ -4,6 +4,7 @@ import { StorageClass } from '../storage-class/storage-class.ts';
|
|||||||
import { PersistentVolume } from '../pv/pv.ts';
|
import { PersistentVolume } from '../pv/pv.ts';
|
||||||
|
|
||||||
import { Resource, ResourceService, type ResourceOptions } from '#services/resources/resources.ts';
|
import { Resource, ResourceService, type ResourceOptions } from '#services/resources/resources.ts';
|
||||||
|
import { chmod, mkdir } from 'fs/promises';
|
||||||
|
|
||||||
const PROVISIONER = 'homelab-operator';
|
const PROVISIONER = 'homelab-operator';
|
||||||
|
|
||||||
@@ -41,6 +42,12 @@ class PVC extends Resource<V1PersistentVolumeClaim> {
|
|||||||
const resourceService = this.services.get(ResourceService);
|
const resourceService = this.services.get(ResourceService);
|
||||||
const pv = resourceService.get(PersistentVolume, pvName);
|
const pv = resourceService.get(PersistentVolume, pvName);
|
||||||
|
|
||||||
|
try {
|
||||||
|
await mkdir(target, { recursive: true });
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error creating directory', error);
|
||||||
|
}
|
||||||
|
|
||||||
await pv.ensure({
|
await pv.ensure({
|
||||||
metadata: {
|
metadata: {
|
||||||
name: pvName,
|
name: pvName,
|
||||||
@@ -74,6 +81,11 @@ class PVC extends Resource<V1PersistentVolumeClaim> {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
try {
|
||||||
|
await chmod(target, 0o777);
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error changing directory permissions', error);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user