Add PGCluster Namespace

This commit is contained in:
Daniel Cosme
2026-04-30 14:37:34 -04:00
parent f1b73cffba
commit f945695b61
3 changed files with 16 additions and 9 deletions

View File

@@ -0,0 +1,6 @@
apiVersion: v1
kind: Namespace
metadata:
name: cnpg-cluster
spec: {}
status: {}

View File

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

View File

@@ -12,6 +12,7 @@ import (
var meta kube.Metadata var meta kube.Metadata
var Namespace = kube.Namespace(root.CloudNativePG + "-system") var Namespace = kube.Namespace(root.CloudNativePG + "-system")
var PGClusterNamespace = kube.Namespace(root.CloudNativePG + "-cluster")
func init() { func init() {
meta = kube.NewMetadata(root.CloudNativePG, Namespace) meta = kube.NewMetadata(root.CloudNativePG, Namespace)
@@ -20,6 +21,7 @@ func init() {
func Stack() stack.Stack { func Stack() stack.Stack {
s := stack.NewStack("cloud-native-pg", map[string]any{ s := stack.NewStack("cloud-native-pg", map[string]any{
"namespace": Namespace, "namespace": Namespace,
"cluster-namespace": PGClusterNamespace,
"helm-repository-source": HelmSource(), "helm-repository-source": HelmSource(),
"helm-release": HelmRelease(), "helm-release": HelmRelease(),
"pg-cluster": Cluster(), "pg-cluster": Cluster(),
@@ -28,8 +30,7 @@ func Stack() stack.Stack {
} }
func Cluster() pg.Cluster { func Cluster() pg.Cluster {
namespace := kube.Namespace(root.CloudNativePG + "-cluster") meta := kube.NewMetadata(root.CloudNativePG+"-cluster", PGClusterNamespace)
meta = kube.NewMetadata(root.CloudNativePG+"-cluster", namespace)
spec := pg.ClusterSpec{ spec := pg.ClusterSpec{
Instances: 3, Instances: 3,
StorageConfiguration: pg.StorageConfiguration{ StorageConfiguration: pg.StorageConfiguration{