Files
sealos/cloud/deploy/manifests/interfaces/postgres/pgadmin.yaml
T
zzjin 86f82bbf1f Dev front (#1901)
* Add apps
Add redis&postgres operator and gui entryoint at cloud.

Signed-off-by: zzjin <tczzjin@gmail.com>

* Update apps
1. update session store support get kubeconfig token.
2. add redisinsight and pgadmin shown at desktop

Signed-off-by: zzjin <tczzjin@gmail.com>

Signed-off-by: zzjin <tczzjin@gmail.com>
2022-10-17 17:39:05 +08:00

156 lines
3.4 KiB
YAML

# Copyright © 2022 sealos.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
apiVersion: v1
kind: Namespace
metadata:
name: pgadmin-service
annotations:
labels:
name: pgadmin-service
---
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: pgadmin
namespace: pgadmin-service
data:
pgadmin-password: U3VwZXJTZWNyZXQ= # SuperSecret
---
apiVersion: v1
kind: ConfigMap
metadata:
name: pgadmin-config
namespace: pgadmin-service
data:
servers.json: |
{
"Servers": {
"1": {
"Name": "PostgreSQL DB",
"Group": "Servers",
"Port": 5432,
"Username": "postgres",
"Host": "postgres.domain.com",
"SSLMode": "prefer",
"MaintenanceDB": "postgres"
}
}
}
---
apiVersion: v1
kind: Service
metadata:
name: pgadmin-service
namespace: pgadmin-service
spec:
ports:
- protocol: TCP
port: 80
targetPort: http
selector:
app: pgadmin
type: ClusterIP
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: pgadmin-data-pv
annotations:
storageclass.kubernetes.io/is-default-class: "true"
openebs.io/cas-type: local
cas.openebs.io/config: |
- name: StorageType
value: hostpath
- name: BasePath
value: /pgadmin-data-pv
provisioner: openebs.io/local
reclaimPolicy: Retain
volumeBindingMode: WaitForFirstConsumer
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pgadmin-data-pv-claim
namespace: pgadmin-service
labels:
app: pgadmin
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi
storageClassName: pgadmin-data-pv
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: pgadmin
namespace: pgadmin-service
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: pgadmin
template:
metadata:
labels:
app: pgadmin
spec:
containers:
- name: pgadmin
securityContext:
runAsNonRoot: true
allowPrivilegeEscalation: false
capabilities:
drop:
- "ALL"
image: dpage/pgadmin4:latest
imagePullPolicy: IfNotPresent
env:
- name: PGADMIN_DEFAULT_EMAIL
value: user@domain.com
- name: PGADMIN_DEFAULT_PASSWORD
valueFrom:
secretKeyRef:
name: pgadmin
key: pgadmin-password
ports:
- name: http
containerPort: 80
protocol: TCP
volumeMounts:
- name: pgadmin-config
mountPath: /pgadmin4/servers.json
subPath: servers.json
readOnly: true
- name: pgadmin-data
mountPath: /var/lib/pgadmin
volumes:
- name: pgadmin-config
configMap:
name: pgadmin-config
- name: pgadmin-data
persistentVolumeClaim:
claimName: pgadmin-data-pv-claim