Skip to content

Commit

Permalink
feat: Add HA harbor database (#3012)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmidyson authored Jan 14, 2025
1 parent 549c5e8 commit dd6a1a9
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 2 deletions.
33 changes: 33 additions & 0 deletions services/harbor/1.16.0/database.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: harbor-database
namespace: ${releaseNamespace}
spec:
force: false
prune: true
wait: true
interval: 6h
retryInterval: 1m
path: ./services/harbor/1.16.0/database
dependsOn:
- name: ncr-system-namespace
- name: cloudnative-pg
sourceRef:
kind: GitRepository
name: management
namespace: kommander-flux
timeout: 1m
postBuild:
substituteFrom:
- kind: ConfigMap
name: substitution-vars
healthChecks:
- apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
name: harbor-database
namespace: ${releaseNamespace}
- apiVersion: postgresql.cnpg.io
kind: Cluster
name: harbor-database-cluster
namespace: ${releaseNamespace}
33 changes: 33 additions & 0 deletions services/harbor/1.16.0/database/cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: harbor-database
namespace: ${releaseNamespace}
spec:
chart:
spec:
chart: cluster
sourceRef:
kind: HelmRepository
name: cloudnative-pg.github.io-charts
namespace: kommander-flux
version: 0.2.0
interval: 15s
install:
crds: CreateReplace
remediation:
retries: 30
upgrade:
crds: CreateReplace
remediation:
retries: 30
timeout: 5m0s
releaseName: harbor-database
targetNamespace: ncr-system
valuesFrom:
- kind: ConfigMap
name: harbor-database-0.2.0-d2iq-defaults
- kind: ConfigMap
name: harbor-database-overrides
optional: true
4 changes: 4 additions & 0 deletions services/harbor/1.16.0/database/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- cluster.yaml
18 changes: 18 additions & 0 deletions services/harbor/1.16.0/defaults/database.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: harbor-database-0.2.0-d2iq-defaults
namespace: ${releaseNamespace}
data:
values.yaml: |
---
type: postgresql
mode: standalone
cluster:
instances: 3
storage:
size: 10Gi
initdb:
database: harbor
backups:
enabled: false
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ data:
type: internal
database:
type: internal
type: external
external:
host: "harbor-database-cluster-rw"
port: "5432"
username: "harbor"
coreDatabase: "harbor"
existingSecret: "harbor-database-cluster-app"
core:
priorityClassName: dkp-critical-priority
Expand Down
3 changes: 2 additions & 1 deletion services/harbor/1.16.0/defaults/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- cm.yaml
- harbor.yaml
- database.yaml
1 change: 1 addition & 0 deletions services/harbor/1.16.0/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ resources:
- release.yaml
- ncr-system-namespace.yaml
- pre-install.yaml
- database.yaml
1 change: 1 addition & 0 deletions services/harbor/1.16.0/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ spec:
dependsOn:
- name: ncr-system-namespace
- name: harbor-pre-install
- name: harbor-database
sourceRef:
kind: GitRepository
name: management
Expand Down
4 changes: 4 additions & 0 deletions services/harbor/1.16.0/release/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- harbor.yaml

0 comments on commit dd6a1a9

Please sign in to comment.