Skip to content

Commit

Permalink
Added nodeselector and tolerations, updated testdata
Browse files Browse the repository at this point in the history
  • Loading branch information
petteja committed Nov 19, 2024
1 parent 0b08c31 commit 3cc7358
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 7 deletions.
10 changes: 10 additions & 0 deletions pkg/k8s/cnpg/cnpg.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,16 @@ func NewCluster(name, namespace, database, owner string, options ...ClusterOptio
StorageConfiguration: cnpgv1.StorageConfiguration{
Size: defaultStorageSize,
},
Affinity: cnpgv1.AffinityConfiguration{
NodeSelector: map[string]string{"knada-infrastructure": ""},
Tolerations: []v1.Toleration{
{
Key: "knada-infrastructure",
Operator: v1.TolerationOpExists,
Effect: v1.TaintEffectNoSchedule,
},
},
},
Resources: v1.ResourceRequirements{
Requests: v1.ResourceList{
v1.ResourceCPU: resource.MustParse(defaultRequestCPU),
Expand Down
8 changes: 7 additions & 1 deletion pkg/k8s/cnpg/testdata/cluster-with-app-label.golden
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ metadata:
name: test-cluster
namespace: test-namespace
spec:
affinity: {}
affinity:
nodeSelector:
knada-infrastructure: ""
tolerations:
- effect: NoSchedule
key: knada-infrastructure
operator: Exists
backup:
retentionPolicy: 30d
volumeSnapshot:
Expand Down
8 changes: 7 additions & 1 deletion pkg/k8s/cnpg/testdata/cluster-with-backup.golden
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ metadata:
name: test-cluster
namespace: test-namespace
spec:
affinity: {}
affinity:
nodeSelector:
knada-infrastructure: ""
tolerations:
- effect: NoSchedule
key: knada-infrastructure
operator: Exists
backup:
retentionPolicy: 7d
volumeSnapshot:
Expand Down
8 changes: 7 additions & 1 deletion pkg/k8s/cnpg/testdata/cluster-with-instance-count.golden
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ metadata:
name: test-cluster
namespace: test-namespace
spec:
affinity: {}
affinity:
nodeSelector:
knada-infrastructure: ""
tolerations:
- effect: NoSchedule
key: knada-infrastructure
operator: Exists
backup:
retentionPolicy: 30d
volumeSnapshot:
Expand Down
8 changes: 7 additions & 1 deletion pkg/k8s/cnpg/testdata/cluster-with-monitoring.golden
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ metadata:
name: test-cluster
namespace: test-namespace
spec:
affinity: {}
affinity:
nodeSelector:
knada-infrastructure: ""
tolerations:
- effect: NoSchedule
key: knada-infrastructure
operator: Exists
backup:
retentionPolicy: 30d
volumeSnapshot:
Expand Down
8 changes: 7 additions & 1 deletion pkg/k8s/cnpg/testdata/cluster-with-requests.golden
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ metadata:
name: test-cluster
namespace: test-namespace
spec:
affinity: {}
affinity:
nodeSelector:
knada-infrastructure: ""
tolerations:
- effect: NoSchedule
key: knada-infrastructure
operator: Exists
backup:
retentionPolicy: 30d
volumeSnapshot:
Expand Down
8 changes: 7 additions & 1 deletion pkg/k8s/cnpg/testdata/cluster-with-storage-size.golden
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ metadata:
name: test-cluster
namespace: test-namespace
spec:
affinity: {}
affinity:
nodeSelector:
knada-infrastructure: ""
tolerations:
- effect: NoSchedule
key: knada-infrastructure
operator: Exists
backup:
retentionPolicy: 30d
volumeSnapshot:
Expand Down
8 changes: 7 additions & 1 deletion pkg/k8s/cnpg/testdata/default-cluster.golden
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ metadata:
name: test-cluster
namespace: test-namespace
spec:
affinity: {}
affinity:
nodeSelector:
knada-infrastructure: ""
tolerations:
- effect: NoSchedule
key: knada-infrastructure
operator: Exists
backup:
retentionPolicy: 30d
volumeSnapshot:
Expand Down

0 comments on commit 3cc7358

Please sign in to comment.