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

View File

@@ -4,7 +4,7 @@ metadata:
name: linking
namespace: linkding
resources:
- pvc.yaml
- deployment.yaml
- namespace.yaml
- srv.yaml
- pvc.yaml
- deployment.yaml

2
go.mod
View File

@@ -3,7 +3,7 @@ module danicos.dev/daniel/homelab
go 1.26.2
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/fatih/color v1.19.0
github.com/fluxcd/helm-controller/api v1.5.4

4
go.sum
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.11.0/go.mod h1:zOhFK+bE4t14yOokp+yqh8Pht1/U102JV/29QoKBjjc=
danicos.dev/daniel/go-kube v1.12.1 h1:JQBW2zgx1g2OwAuuSyEspAm709YLBSFZs8sWVv73sGs=
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/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
github.com/cloudnative-pg/api v1.29.0 h1:mNx6yJ5qi+Xrjs0NYrUy6V4MlXBkVJxGKwvTJZIuTX4=

View File

@@ -2,6 +2,7 @@ apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: cnpg-cluster
namespace: cnpg-cluster
spec:
affinity: {}
instances: 3

View File

@@ -4,16 +4,16 @@ metadata:
name: truenas-csi
namespace: truenas-csi
resources:
- iscsi-storage-class.yaml
- controller-service-account.yaml
- controller-binding.yaml
- node-service-account.yaml
- node-cluster-role.yaml
- node-binding.yaml
- node-deamonset.yaml
- CSIDriver.yaml
- iscsi-storage-class.yaml
- namespace.yaml
- controller-deployment.yaml
- controller-cluster-role.yaml
- node-service-account.yaml
- node-binding.yaml
- CSIDriver.yaml
- config.yaml
- nfs-storage-class.yaml

View File

@@ -28,6 +28,8 @@ func Stack() stack.Stack {
}
func Cluster() pg.Cluster {
namespace := kube.Namespace(root.CloudNativePG + "-cluster")
meta = kube.NewMetadata(root.CloudNativePG+"-cluster", namespace)
spec := pg.ClusterSpec{
Instances: 3,
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)
}

View File

@@ -35,12 +35,8 @@ func HelmRelease() helm.HelmRelease {
},
},
},
Install: &helm.Install{
CRDs: helm.Create,
},
Upgrade: &helm.Upgrade{
CRDs: helm.CreateReplace,
},
Install: &helm.Install{CRDs: helm.Create},
Upgrade: &helm.Upgrade{CRDs: helm.CreateReplace},
}
return flux.NewFluxHelmRelease(meta, spec)
}