From 2c54e240d1a6fc549c59762d089d5b228e0cd0f9 Mon Sep 17 00:00:00 2001 From: Junwei Zhao Date: Thu, 12 Jan 2023 09:18:34 +1100 Subject: [PATCH] add postgres local pv --- adhoc-config/postgres-local-pv.yaml | 25 +++++++++++++++++++++++++ cluster.yaml | 6 +++--- recovery.sh | 2 +- 3 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 adhoc-config/postgres-local-pv.yaml diff --git a/adhoc-config/postgres-local-pv.yaml b/adhoc-config/postgres-local-pv.yaml new file mode 100644 index 0000000..47db6f5 --- /dev/null +++ b/adhoc-config/postgres-local-pv.yaml @@ -0,0 +1,25 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: postgres-local-pv + labels: + type: local + name: postgres +spec: + capacity: + storage: 20Gi + volumeMode: Filesystem + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Delete + storageClassName: local-storage + local: + path: /mnt/k8s/db-data-new-postgres-postgresql-0-pvc-79d165df-18f4-404c-ae25-8fc80ba415c6 + nodeAffinity: + required: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/hostname + operator: In + values: + - server-3 diff --git a/cluster.yaml b/cluster.yaml index 100dba6..94f5246 100644 --- a/cluster.yaml +++ b/cluster.yaml @@ -1,4 +1,6 @@ # Full configuration https://kubernetes.io/docs/reference/config-api/kubeadm-config.v1beta2/ +kind: ClusterConfiguration +kubernetesVersion: v1.26.0 apiVersion: kubeadm.k8s.io/v1beta3 bootstrapTokens: - groups: @@ -41,9 +43,7 @@ etcd: - https://192.168.1.111:2379 - https://192.168.1.2:2379 keyFile: /etc/etcd/etcd-key.pem -imageRepository: k8s.gcr.io -kind: ClusterConfiguration -kubernetesVersion: v1.24.1 +imageRepository: registry.k8s.io networking: dnsDomain: cluster.local podSubnet: 10.244.0.0/16 diff --git a/recovery.sh b/recovery.sh index 8cd1c88..a6485cd 100644 --- a/recovery.sh +++ b/recovery.sh @@ -129,7 +129,7 @@ sudo vim /var/lib/kubelet/kubeadm-flags.env lsof | awk '{print $2}' | sort | uniq -c | sort -n # too many open files -sudo /etc/sysctl.conf +sudo vim /etc/sysctl.conf fs.inotify.max_user_instances=2048 fs.file-max = 500000