You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.5 KiB
Plaintext

{
apiVersion: "apps/v1",
kind: "StatefulSet",
metadata: {
name: "postgres"
},
spec: {
selector: {
matchLabels: {
app: "postgres"
}
},
serviceName: "postgres",
template: {
metadata:{
labels: {
app: "postgres"
}
},
spec: {
containers: [
{
name: "postgres",
image: "docker.io/postgres:13",
ports: [
{containerPort: 5432,
name: "db"}
],
env: [
{
name: "POSTGRES_DB",
value: "picc"
},
{
name: "POSTGRES_PASSWORD",
valueFrom: {
secretKeyRef: {
name: "postgres-password",
key: "password"
}
}
}
],
volumeMounts: [
{
name: "postgres-data",
mountPath: "/var/lib/postgresql/data"
},
{
name: "dbinit",
mountPath: "/docker-entrypoint-initdb.d"
}
]
}
],
volumes: [
{
name: "dbinit",
configMap: {
name: "postgres-dbinit"
}
}
]
}
},
volumeClaimTemplates : [{
metadata: {
name: "postgres-data"
},
spec: {
accessModes: ["ReadWriteOnce"],
resources: {
requests: {
storage: "100Mi"
}
}
}
}]
}
}