Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CNPG: Dedicated hosts #290

Merged
merged 2 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Ellers blir Knorten satt opp gjennom [nais/knada-gcp](https://github.com/nais/kn

## Utvikling

For å jobbe med Knorten lokalt trenger man å ha Postgres kjørende, og basen må prepouleres med litt data.
For å jobbe med Knorten lokalt trenger man å ha Postgres kjørende, og basen må prepopuleres med litt data.
I tillegg benytter vi et oppsett med Tailwind og Designsystemet.


Expand Down
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
Loading