-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding missing postgres e2e test files
- Loading branch information
Marco Cadetg
committed
May 6, 2024
1 parent
8db6483
commit 558b488
Showing
4 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: crd.lagoon.sh/v1alpha1 | ||
kind: DatabaseRequest | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: databaserequest | ||
app.kubernetes.io/instance: databaserequest-postgres-sample | ||
app.kubernetes.io/part-of: dbaas-controller | ||
app.kubernetes.io/managed-by: kustomize | ||
app.kubernetes.io/created-by: dbaas-controller | ||
name: databaserequest-postgres-sample | ||
spec: | ||
name: first-postgres-db | ||
scope: development | ||
type: postgres |
19 changes: 19 additions & 0 deletions
19
config/samples/crd_v1alpha1_relationaldatabaseprovider_postgres.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: crd.lagoon.sh/v1alpha1 | ||
kind: RelationalDatabaseProvider | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: dbaas-controller | ||
app.kubernetes.io/managed-by: kustomize | ||
name: relationaldatabaseprovider-postgres-sample | ||
spec: | ||
type: postgres | ||
scope: development | ||
connections: | ||
- name: primary-test-postgres-connection | ||
hostname: postgres-service.postgres | ||
passwordSecretRef: | ||
name: postgres-secret | ||
namespace: postgres | ||
port: 5432 | ||
username: postgres | ||
enabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: postgres-init-pod | ||
namespace: postgres | ||
spec: | ||
restartPolicy: Never | ||
containers: | ||
- name: postgres-client | ||
image: postgres:13 | ||
command: ["sh", "-c"] | ||
args: | ||
- | | ||
PGPASSWORD=e2e-postgres-password psql -h postgres-service.postgres -U postgres -c "CREATE DATABASE IF NOT EXISTS seed-database;" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: postgres | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: postgres | ||
namespace: postgres | ||
labels: | ||
app: postgres | ||
spec: | ||
containers: | ||
- name: postgres | ||
image: postgres:13 | ||
env: | ||
- name: POSTGRES_PASSWORD | ||
value: "e2e-postgres-password" | ||
ports: | ||
- containerPort: 5432 | ||
name: postgres | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: postgres-service | ||
namespace: postgres | ||
spec: | ||
selector: | ||
app: postgres | ||
ports: | ||
- protocol: TCP | ||
port: 5432 | ||
targetPort: 5432 | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: postgres-secret | ||
namespace: postgres | ||
type: Opaque | ||
data: | ||
password: ZTJlLXBvc3RncmVzLXBhc3N3b3Jk |