Add namespace to Cluster

This commit is contained in:
Daniel Cosme
2026-04-30 14:35:35 -04:00
parent a8ca536177
commit f1b73cffba
7 changed files with 15 additions and 16 deletions
+2 -2
View File
@@ -4,7 +4,7 @@ metadata:
name: linking name: linking
namespace: linkding namespace: linkding
resources: resources:
- pvc.yaml
- deployment.yaml
- namespace.yaml - namespace.yaml
- srv.yaml - srv.yaml
- pvc.yaml
- deployment.yaml
+1 -1
View File
@@ -3,7 +3,7 @@ module danicos.dev/daniel/homelab
go 1.26.2 go 1.26.2
require ( require (
danicos.dev/daniel/go-kube v1.11.0 danicos.dev/daniel/go-kube v1.12.1
github.com/cloudnative-pg/api v1.29.0 github.com/cloudnative-pg/api v1.29.0
github.com/fatih/color v1.19.0 github.com/fatih/color v1.19.0
github.com/fluxcd/helm-controller/api v1.5.4 github.com/fluxcd/helm-controller/api v1.5.4
+2 -2
View File
@@ -1,5 +1,5 @@
danicos.dev/daniel/go-kube v1.11.0 h1:MGWB8bGOZuGv+HaRwTxWirngdtYerp+PpOk/YptRCqg= danicos.dev/daniel/go-kube v1.12.1 h1:JQBW2zgx1g2OwAuuSyEspAm709YLBSFZs8sWVv73sGs=
danicos.dev/daniel/go-kube v1.11.0/go.mod h1:zOhFK+bE4t14yOokp+yqh8Pht1/U102JV/29QoKBjjc= danicos.dev/daniel/go-kube v1.12.1/go.mod h1:zOhFK+bE4t14yOokp+yqh8Pht1/U102JV/29QoKBjjc=
github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0= github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0=
github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
github.com/cloudnative-pg/api v1.29.0 h1:mNx6yJ5qi+Xrjs0NYrUy6V4MlXBkVJxGKwvTJZIuTX4= github.com/cloudnative-pg/api v1.29.0 h1:mNx6yJ5qi+Xrjs0NYrUy6V4MlXBkVJxGKwvTJZIuTX4=
@@ -2,6 +2,7 @@ apiVersion: postgresql.cnpg.io/v1
kind: Cluster kind: Cluster
metadata: metadata:
name: cnpg-cluster name: cnpg-cluster
namespace: cnpg-cluster
spec: spec:
affinity: {} affinity: {}
instances: 3 instances: 3
@@ -4,16 +4,16 @@ metadata:
name: truenas-csi name: truenas-csi
namespace: truenas-csi namespace: truenas-csi
resources: resources:
- iscsi-storage-class.yaml
- controller-service-account.yaml - controller-service-account.yaml
- controller-binding.yaml - controller-binding.yaml
- node-service-account.yaml
- node-cluster-role.yaml - node-cluster-role.yaml
- node-binding.yaml
- node-deamonset.yaml - node-deamonset.yaml
- CSIDriver.yaml
- iscsi-storage-class.yaml
- namespace.yaml - namespace.yaml
- controller-deployment.yaml - controller-deployment.yaml
- controller-cluster-role.yaml - controller-cluster-role.yaml
- node-service-account.yaml - CSIDriver.yaml
- node-binding.yaml
- config.yaml - config.yaml
- nfs-storage-class.yaml - nfs-storage-class.yaml
+3 -1
View File
@@ -28,6 +28,8 @@ func Stack() stack.Stack {
} }
func Cluster() pg.Cluster { func Cluster() pg.Cluster {
namespace := kube.Namespace(root.CloudNativePG + "-cluster")
meta = kube.NewMetadata(root.CloudNativePG+"-cluster", namespace)
spec := pg.ClusterSpec{ spec := pg.ClusterSpec{
Instances: 3, Instances: 3,
StorageConfiguration: pg.StorageConfiguration{ StorageConfiguration: pg.StorageConfiguration{
@@ -39,5 +41,5 @@ func Cluster() pg.Cluster {
}, },
}, },
} }
return kube_cnpg.NewCluster(root.CloudNativePG+"-cluster", spec) return kube_cnpg.NewCluster(meta, spec)
} }
+2 -6
View File
@@ -35,12 +35,8 @@ func HelmRelease() helm.HelmRelease {
}, },
}, },
}, },
Install: &helm.Install{ Install: &helm.Install{CRDs: helm.Create},
CRDs: helm.Create, Upgrade: &helm.Upgrade{CRDs: helm.CreateReplace},
},
Upgrade: &helm.Upgrade{
CRDs: helm.CreateReplace,
},
} }
return flux.NewFluxHelmRelease(meta, spec) return flux.NewFluxHelmRelease(meta, spec)
} }