mirror of
https://github.com/NVIDIA/OpenShell.git
synced 2026-10-21 06:11:31 +08:00
96 lines
2.9 KiB
YAML
96 lines
2.9 KiB
YAML
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
apiVersion: v1
|
|
kind: ServiceAccount
|
|
metadata:
|
|
name: openshell-e2e-postgres
|
|
labels:
|
|
app.kubernetes.io/name: openshell-e2e-postgres
|
|
---
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: openshell-e2e-postgres-credentials
|
|
labels:
|
|
app.kubernetes.io/name: openshell-e2e-postgres
|
|
type: Opaque
|
|
stringData:
|
|
password: openshell-e2e-postgres
|
|
uri: postgresql://openshell:openshell-e2e-postgres@openshell-e2e-postgres.openshell.svc/openshell
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: openshell-e2e-postgres
|
|
labels:
|
|
app.kubernetes.io/name: openshell-e2e-postgres
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: openshell-e2e-postgres
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/name: openshell-e2e-postgres
|
|
spec:
|
|
serviceAccountName: openshell-e2e-postgres
|
|
containers:
|
|
- name: postgres
|
|
image: mirror.gcr.io/library/postgres:17.10-alpine3.23@sha256:979c4379dd698aba0b890599a6104e082035f98ef31d9b9291ec22f2b13059ca
|
|
imagePullPolicy: IfNotPresent
|
|
env:
|
|
- name: POSTGRES_USER
|
|
value: openshell
|
|
- name: POSTGRES_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: openshell-e2e-postgres-credentials
|
|
key: password
|
|
- name: POSTGRES_DB
|
|
value: openshell
|
|
# OpenShift assigns a random UID from the namespace range instead of
|
|
# running as the image's "postgres" user (UID 70). The postgres
|
|
# entrypoint fails to chmod /var/lib/postgresql/data because it is
|
|
# owned by UID 70. Setting PGDATA to a subdirectory causes postgres
|
|
# to mkdir+chmod a new directory it owns, which succeeds.
|
|
- name: PGDATA
|
|
value: /var/lib/postgresql/data/pgdata
|
|
ports:
|
|
- name: postgres
|
|
containerPort: 5432
|
|
readinessProbe:
|
|
exec:
|
|
command:
|
|
- /bin/sh
|
|
- -ec
|
|
- pg_isready -U openshell -d openshell
|
|
initialDelaySeconds: 3
|
|
periodSeconds: 3
|
|
timeoutSeconds: 2
|
|
failureThreshold: 20
|
|
volumeMounts:
|
|
- name: postgres-data
|
|
mountPath: /var/lib/postgresql/data
|
|
- name: postgres-run
|
|
mountPath: /var/run/postgresql
|
|
volumes:
|
|
- name: postgres-data
|
|
emptyDir: {}
|
|
- name: postgres-run
|
|
emptyDir: {}
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: openshell-e2e-postgres
|
|
labels:
|
|
app.kubernetes.io/name: openshell-e2e-postgres
|
|
spec:
|
|
selector:
|
|
app.kubernetes.io/name: openshell-e2e-postgres
|
|
ports:
|
|
- name: postgres
|
|
port: 5432
|
|
targetPort: postgres
|