initial commit
This commit is contained in:
19
dev/postgres13/catalog-info.yaml
Normal file
19
dev/postgres13/catalog-info.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
apiVersion: backstage.io/v1alpha1
|
||||
kind: Component
|
||||
metadata:
|
||||
name: dev-postgres13
|
||||
title: postgres13 (dev)
|
||||
description: postgres13 instance running in Kubernetes
|
||||
annotations:
|
||||
backstage.io/kubernetes-label-selector: "app=postgres13"
|
||||
links:
|
||||
- url: https://github.com/AllardKrings/kubernetes/dev/postgres13
|
||||
title: postgres13-configuration
|
||||
docs:
|
||||
- url: ./README.md
|
||||
spec:
|
||||
type: service
|
||||
lifecycle: production
|
||||
owner: group:default/allarddcs
|
||||
subcomponentOf: component:default/DEV-cluster
|
||||
|
||||
88
dev/postgres13/postgres13.yaml
Executable file
88
dev/postgres13/postgres13.yaml
Executable file
@@ -0,0 +1,88 @@
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: postgres13
|
||||
namespace: postgres
|
||||
spec:
|
||||
serviceName: postgres13
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: postgres13
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: postgres13
|
||||
spec:
|
||||
containers:
|
||||
- name: postgres13
|
||||
image: postgres:13
|
||||
# command: ["sh"]
|
||||
# args: ["-c", "while true; do echo $(date -u) >> /tmp/run.log; sleep 5; done"]
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
env:
|
||||
- name: POSTGRES_DB
|
||||
value: harbor
|
||||
- name: POSTGRES_USER
|
||||
value: harbor
|
||||
- name: POSTGRES_PASSWORD
|
||||
value: harbor
|
||||
volumeMounts:
|
||||
- mountPath: /var/lib/postgresql/data
|
||||
name: postgres
|
||||
volumes:
|
||||
- name: postgres
|
||||
persistentVolumeClaim:
|
||||
claimName: postgres13-pvc
|
||||
nodeSelector:
|
||||
kubernetes.io/arch: arm64
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: postgres13
|
||||
namespace: postgres
|
||||
labels:
|
||||
name: postgres13
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 5432
|
||||
name: postgres
|
||||
selector:
|
||||
app: postgres13
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: postgres13-pv
|
||||
spec:
|
||||
storageClassName: ""
|
||||
capacity:
|
||||
storage: 2Gi
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
mountOptions:
|
||||
- hard
|
||||
- nfsvers=4.1
|
||||
nfs:
|
||||
server: 192.168.2.110
|
||||
path: /mnt/nfs_share/postgres13dev
|
||||
readOnly: false
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: postgres13-pvc
|
||||
namespace: postgres
|
||||
spec:
|
||||
storageClassName: ""
|
||||
volumeName: postgres13-pv
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
volumeMode: Filesystem
|
||||
resources:
|
||||
requests:
|
||||
storage: 2Gi
|
||||
2
dev/postgres13/secret/get-password.sh
Executable file
2
dev/postgres13/secret/get-password.sh
Executable file
@@ -0,0 +1,2 @@
|
||||
echo User : $(microk8s kubectl get secret postgres -o jsonpath="{.data.POSTGRES_USER}" | base64 -d)
|
||||
echo Password: $(microk8s kubectl get secret postgres -o jsonpath="{.data.POSTGRES_PASSWORD}" | base64 -d)
|
||||
8
dev/postgres13/secret/postgres-secret.yaml
Executable file
8
dev/postgres13/secret/postgres-secret.yaml
Executable file
@@ -0,0 +1,8 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: postgres
|
||||
data:
|
||||
POSTGRES_PASSWORD: bXktc3VwZXItc2VjcmV0LXBhc3N3b3Jk
|
||||
stringData:
|
||||
POSTGRES_USER: root
|
||||
Reference in New Issue
Block a user