From 5c5762e0e3429bb0b27e6f07481c6c5e56239a60 Mon Sep 17 00:00:00 2001 From: David Voisin Date: Tue, 17 Mar 2026 14:48:54 +0100 Subject: [PATCH 1/3] doc: add CRs examples --- README.md | 6 ++- .../cr-postgresql.enterprise.yaml | 35 +++++++++++++++++ .../cr-postgresql.starter.custom_rules.yaml | 38 +++++++++++++++++++ .../cr-postgresql.starter.yaml | 35 +++++++++++++++++ 4 files changed, 112 insertions(+), 2 deletions(-) create mode 100644 doc/examples/custom_resources/cr-postgresql.enterprise.yaml create mode 100644 doc/examples/custom_resources/cr-postgresql.starter.custom_rules.yaml create mode 100644 doc/examples/custom_resources/cr-postgresql.starter.yaml diff --git a/README.md b/README.md index 7184312f..66c68fdc 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,10 @@ Example: A CR is an actual instance of the type defined by the CRD. -Example: -`config/samples/databases_v1_postgresql.yaml` +Examples: +* `config/samples/databases_v1_postgresql.yaml` +* `doc/examples/custom_resources/cr-postgresql.starter.yaml` +* `doc/examples/custom_resources/cr-postgresql.enterprise.yaml` # Usage diff --git a/doc/examples/custom_resources/cr-postgresql.enterprise.yaml b/doc/examples/custom_resources/cr-postgresql.enterprise.yaml new file mode 100644 index 00000000..7baa143e --- /dev/null +++ b/doc/examples/custom_resources/cr-postgresql.enterprise.yaml @@ -0,0 +1,35 @@ +# Custom Resource example +# +# Use your own values for these fields: +# * metadata.name +# * spec.name +# * spec.connInfoSecretTarget.name +# +apiVersion: databases.scalingo.com/v1alpha1 +kind: PostgreSQL +metadata: + labels: + app.kubernetes.io/name: scalingo-operator + app.kubernetes.io/managed-by: kustomize + name: postgresql-sample +spec: + authSecret: + name: scalingo + key: api_token + connInfoSecretTarget: + name: my-postgresql-secret + + networking: + internet_access: + enabled: true + firewall: + rules: + - type: "custom_range" + cidr: "0.0.0.0/0" + label: "Allow all" + - type: "managed_range" + range_id: "man-osc-fr1-egress" + + name: my-postgresql-database + plan: postgresql-dr-enterprise-4096 + region: osc-fr1 diff --git a/doc/examples/custom_resources/cr-postgresql.starter.custom_rules.yaml b/doc/examples/custom_resources/cr-postgresql.starter.custom_rules.yaml new file mode 100644 index 00000000..a3031d86 --- /dev/null +++ b/doc/examples/custom_resources/cr-postgresql.starter.custom_rules.yaml @@ -0,0 +1,38 @@ +# Custom Resource example +# +# Use your own values for these fields: +# * metadata.name +# * spec.name +# * spec.connInfoSecretTarget.name +# +apiVersion: databases.scalingo.com/v1alpha1 +kind: PostgreSQL +metadata: + labels: + app.kubernetes.io/name: scalingo-operator + app.kubernetes.io/managed-by: kustomize + name: postgresql-sample +spec: + authSecret: + name: scalingo + key: api_token + connInfoSecretTarget: + name: my-postgresql-secret + + networking: + internet_access: + enabled: true + firewall: + rules: + - type: "custom_range" + cidr: "192.168.0.0/24" + - type: "custom_range" + cidr: "192.168.1.1/32" + - type: "custom_range" + cidr: "192.168.1.2/32" + - type: "custom_range" + cidr: "192.168.1.3/32" + + name: my-postgresql-database + plan: postgresql-dr-starter-4096 + region: osc-fr1 diff --git a/doc/examples/custom_resources/cr-postgresql.starter.yaml b/doc/examples/custom_resources/cr-postgresql.starter.yaml new file mode 100644 index 00000000..ea3dcdab --- /dev/null +++ b/doc/examples/custom_resources/cr-postgresql.starter.yaml @@ -0,0 +1,35 @@ +# Custom Resource example +# +# Use your own values for these fields: +# * metadata.name +# * spec.name +# * spec.connInfoSecretTarget.name +# +apiVersion: databases.scalingo.com/v1alpha1 +kind: PostgreSQL +metadata: + labels: + app.kubernetes.io/name: scalingo-operator + app.kubernetes.io/managed-by: kustomize + name: postgresql-sample +spec: + authSecret: + name: scalingo + key: api_token + connInfoSecretTarget: + name: my-postgresql-secret + + networking: + internet_access: + enabled: true + firewall: + rules: + - type: "custom_range" + cidr: "0.0.0.0/0" + label: "Allow all" + - type: "managed_range" + range_id: "man-osc-fr1-egress" + + name: my-postgresql-database + plan: postgresql-dr-starter-4096 + region: osc-fr1 From 59f242fbc891218cc90fdbf6001bdc424f1cd1ca Mon Sep 17 00:00:00 2001 From: David Voisin Date: Thu, 19 Mar 2026 12:12:32 +0100 Subject: [PATCH 2/3] doc: adapt CR examples to new version v1alpha1 -> v1 --- doc/examples/custom_resources/cr-postgresql.enterprise.yaml | 2 +- .../custom_resources/cr-postgresql.starter.custom_rules.yaml | 2 +- doc/examples/custom_resources/cr-postgresql.starter.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/examples/custom_resources/cr-postgresql.enterprise.yaml b/doc/examples/custom_resources/cr-postgresql.enterprise.yaml index 7baa143e..5acec09c 100644 --- a/doc/examples/custom_resources/cr-postgresql.enterprise.yaml +++ b/doc/examples/custom_resources/cr-postgresql.enterprise.yaml @@ -5,7 +5,7 @@ # * spec.name # * spec.connInfoSecretTarget.name # -apiVersion: databases.scalingo.com/v1alpha1 +apiVersion: databases.scalingo.com/v1 kind: PostgreSQL metadata: labels: diff --git a/doc/examples/custom_resources/cr-postgresql.starter.custom_rules.yaml b/doc/examples/custom_resources/cr-postgresql.starter.custom_rules.yaml index a3031d86..fea753d0 100644 --- a/doc/examples/custom_resources/cr-postgresql.starter.custom_rules.yaml +++ b/doc/examples/custom_resources/cr-postgresql.starter.custom_rules.yaml @@ -5,7 +5,7 @@ # * spec.name # * spec.connInfoSecretTarget.name # -apiVersion: databases.scalingo.com/v1alpha1 +apiVersion: databases.scalingo.com/v1 kind: PostgreSQL metadata: labels: diff --git a/doc/examples/custom_resources/cr-postgresql.starter.yaml b/doc/examples/custom_resources/cr-postgresql.starter.yaml index ea3dcdab..293ff179 100644 --- a/doc/examples/custom_resources/cr-postgresql.starter.yaml +++ b/doc/examples/custom_resources/cr-postgresql.starter.yaml @@ -5,7 +5,7 @@ # * spec.name # * spec.connInfoSecretTarget.name # -apiVersion: databases.scalingo.com/v1alpha1 +apiVersion: databases.scalingo.com/v1 kind: PostgreSQL metadata: labels: From c053a43fcf8077772c9e589f02d625d3e5d4c17c Mon Sep 17 00:00:00 2001 From: David Voisin Date: Wed, 25 Mar 2026 17:58:15 +0100 Subject: [PATCH 3/3] doc: update firewall rules examples --- doc/examples/custom_resources/cr-postgresql.enterprise.yaml | 2 -- .../custom_resources/cr-postgresql.starter.custom_rules.yaml | 2 ++ doc/examples/custom_resources/cr-postgresql.starter.yaml | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/examples/custom_resources/cr-postgresql.enterprise.yaml b/doc/examples/custom_resources/cr-postgresql.enterprise.yaml index 5acec09c..a0344890 100644 --- a/doc/examples/custom_resources/cr-postgresql.enterprise.yaml +++ b/doc/examples/custom_resources/cr-postgresql.enterprise.yaml @@ -27,8 +27,6 @@ spec: - type: "custom_range" cidr: "0.0.0.0/0" label: "Allow all" - - type: "managed_range" - range_id: "man-osc-fr1-egress" name: my-postgresql-database plan: postgresql-dr-enterprise-4096 diff --git a/doc/examples/custom_resources/cr-postgresql.starter.custom_rules.yaml b/doc/examples/custom_resources/cr-postgresql.starter.custom_rules.yaml index fea753d0..0b98886d 100644 --- a/doc/examples/custom_resources/cr-postgresql.starter.custom_rules.yaml +++ b/doc/examples/custom_resources/cr-postgresql.starter.custom_rules.yaml @@ -32,6 +32,8 @@ spec: cidr: "192.168.1.2/32" - type: "custom_range" cidr: "192.168.1.3/32" + - type: "managed_range" + range_id: "man-osc-fr1-egress" name: my-postgresql-database plan: postgresql-dr-starter-4096 diff --git a/doc/examples/custom_resources/cr-postgresql.starter.yaml b/doc/examples/custom_resources/cr-postgresql.starter.yaml index 293ff179..37c9b6cf 100644 --- a/doc/examples/custom_resources/cr-postgresql.starter.yaml +++ b/doc/examples/custom_resources/cr-postgresql.starter.yaml @@ -27,8 +27,6 @@ spec: - type: "custom_range" cidr: "0.0.0.0/0" label: "Allow all" - - type: "managed_range" - range_id: "man-osc-fr1-egress" name: my-postgresql-database plan: postgresql-dr-starter-4096