Skip to content

Commit

Permalink
feat: Stackrox DB Move
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurVardevanyan committed Feb 9, 2024
1 parent 2f81dd3 commit be95604
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 165 deletions.
4 changes: 0 additions & 4 deletions kubernetes/postgres/applications/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,3 @@ resources:
- grafana/pv.yaml
- grafana/postgres.yaml
- grafana/network-policy.yaml
- stackrox/longhorn.yaml
- stackrox/pv.yaml
- stackrox/postgres.yaml
- stackrox/network-policy.yaml
62 changes: 0 additions & 62 deletions kubernetes/postgres/applications/stackrox/longhorn.yaml

This file was deleted.

80 changes: 0 additions & 80 deletions kubernetes/postgres/applications/stackrox/pv.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion kubernetes/stackrox-central/base/config-map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ metadata:
data:
central-external-db.yaml: |
centralDB:
source: host=stackrox-primary.postgres.svc port=5432 dbname=stackrox user=stackrox statement_timeout=1.2e+06 pool_min_conns=10 pool_max_conns=90
source: host=stackrox-primary.stackrox.svc port=5432 dbname=stackrox user=stackrox statement_timeout=1.2e+06 pool_min_conns=10 pool_max_conns=90
---
# Source: stackrox-central-services/templates/01-central-09-endpoints-config.yaml
apiVersion: v1
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/stackrox-central/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ resources:
- network-policy.yaml
- secret.yaml
- certificate.yaml
- postgres/postgres.yaml
- postgres/network-policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: stackrox-app
namespace: postgres
namespace: stackrox
annotations:
argocd.argoproj.io/sync-wave: "1"
labels:
app.kubernetes.io/instance: postgres
app.kubernetes.io/instance: stackrox-central-services
spec:
podSelector:
matchLabels:
Expand All @@ -29,18 +29,17 @@ apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: stackrox-postgres
namespace: postgres
namespace: stackrox
annotations:
argocd.argoproj.io/sync-wave: "1"
labels:
app.kubernetes.io/instance: postgres
app.kubernetes.io/instance: stackrox-central-services
spec:
podSelector:
matchLabels:
postgres-operator.crunchydata.com/cluster: stackrox
policyTypes:
- Ingress
- Egress
ingress:
- from:
- namespaceSelector:
Expand All @@ -49,11 +48,3 @@ spec:
podSelector:
matchLabels:
postgres-operator.crunchydata.com/cluster: stackrox
egress:
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: postgres
podSelector:
matchLabels:
postgres-operator.crunchydata.com/cluster: stackrox
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
# StackroxDB Tweak
# alter user stackrox createdb;
# alter user stackrox superuser
# PSQL 15 Public Scheme Tweak
# \c stackrox
# GRANT CREATE ON SCHEMA public TO stackrox;
apiVersion: postgres-operator.crunchydata.com/v1beta1
kind: PostgresCluster
metadata:
name: stackrox
namespace: postgres
namespace: stackrox
annotations:
argocd.argoproj.io/sync-wave: "1"
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
labels:
app.kubernetes.io/instance: postgres
app.kubernetes.io/instance: stackrox-central-services
spec:
backups:
pgbackrest:
Expand Down Expand Up @@ -51,15 +52,15 @@ spec:
differential: "0 7 * * 1-6"
volume:
volumeClaimSpec:
storageClassName: longhorn-static
storageClassName: longhorn
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 15Gi
storage: 25Gi
instances:
- dataVolumeClaimSpec:
storageClassName: longhorn-static
storageClassName: longhorn
accessModes:
- ReadWriteOnce
resources:
Expand Down

0 comments on commit be95604

Please sign in to comment.